summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2006-10-28 19:38:52 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-28 20:30:54 +0200
commit17b02695b254aa2ef0e53df9c8e6548f86e66a9d (patch)
tree6d39c830549641e3b73ad8881f0aecbd1d680ee6
parent[PATCH] taskstats_tgid_free: fix usage (diff)
downloadlinux-17b02695b254aa2ef0e53df9c8e6548f86e66a9d.tar.xz
linux-17b02695b254aa2ef0e53df9c8e6548f86e66a9d.zip
[PATCH] taskstats_tgid_alloc: optimization
Every subthread (except first) does unneeded kmem_cache_alloc/kmem_cache_free. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Cc: Shailabh Nagar <nagar@watson.ibm.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: Jay Lan <jlan@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--include/linux/taskstats_kern.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h
index a437ca0d226b..664224008fb2 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;