Skip to content

Commit

Permalink
[PATCH] taskstats_tgid_alloc: optimization
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Oct 28, 2006
1 parent 093a8e8 commit 17b0269
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/linux/taskstats_kern.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 17b0269

Please sign in to comment.