提交 17b02695 编写于 作者: O Oleg Nesterov 提交者: Linus Torvalds

[PATCH] taskstats_tgid_alloc: optimization

Every subthread (except first) does unneeded kmem_cache_alloc/kmem_cache_free.
Signed-off-by: NOleg 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: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 093a8e8a
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册