From: Oleg Nesterov Date: Thu, 7 Dec 2006 04:36:50 +0000 (-0800) Subject: [PATCH] taskstats_exit_alloc: optimize/simplify X-Git-Tag: v2.6.20-rc1~145^2^2~189 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=128fb95650b3273a8dc9ba5514b6fe7db8ea30bf;p=pandora-kernel.git [PATCH] taskstats_exit_alloc: optimize/simplify If there are no listeners, every task does unneeded kmem_cache alloc/free on exit. We don't need listeners->sem for 'if (!list_empty())' check. Yes, we may have a false positive, but this doesn't differ from the case when the listener is unregistered after we drop the semaphore. So we don't need to do allocation beforehand. Signed-off-by: Oleg Nesterov Cc: Balbir Singh Acked-by: Shailabh Nagar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed