[PATCH 4/6] taskstats_tgid_alloc: optimization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Oleg Nesterov <[email protected]>

--- 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux