[PATCH 4/6] taskstats_tgid_alloc: optimization

From: Oleg Nesterov
Date: Thu Oct 26 2006 - 19:22:34 EST


Every subthread (except first) does unneeded kmem_cache_alloc/kmem_cache_free.

Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>

--- STATS/include/linux/taskstats_kern.h~4_alloc 2006-10-27 01:28:31.000000000 +0400
+++ STATS/include/linux/taskstats_kern.h 2006-10-27 01:39:10.000000000 +0400
@@ -32,6 +32,9 @@ static inline void taskstats_tgid_alloc(
struct taskstats *stats;
unsigned long flags;

+ if (sig->stats != NULL)
+ return;
+
stats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL);
if (!stats)
return;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/