Skip to contentSkip to conversation

taskstats_tgid_alloc: optimization

PATCH In review Oleg Nesterov 1 participant 1 message Oct 26, 2006 Taskstats statistics interface

lore
Share & tools
lore
#0 lore raw

PATCH 4/6 taskstats_tgid_alloc: optimization

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

include/linux/taskstats_kern.h renamed from include/linux/taskstats_kern.h~4_alloc +3 -0
@@ -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;