From: Oleg Nesterov Date: Sat, 28 Oct 2006 17:38:52 +0000 (-0700) Subject: [PATCH] taskstats_tgid_alloc: optimization X-Git-Tag: v2.6.19-rc4~41 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=17b02695b254aa2ef0e53df9c8e6548f86e66a9d;p=~shefty%2Frdma-dev.git [PATCH] taskstats_tgid_alloc: optimization Every subthread (except first) does unneeded kmem_cache_alloc/kmem_cache_free. Signed-off-by: Oleg Nesterov Cc: Shailabh Nagar Cc: Balbir Singh Cc: Jay Lan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h index a437ca0d226..664224008fb 100644 --- a/include/linux/taskstats_kern.h +++ b/include/linux/taskstats_kern.h @@ -32,6 +32,9 @@ static inline void taskstats_tgid_alloc(struct signal_struct *sig) struct taskstats *stats; unsigned long flags; + if (sig->stats != NULL) + return; + stats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL); if (!stats) return;