]> err.no Git - linux-2.6/commit
[PATCH] taskstats_exit_alloc: optimize/simplify
authorOleg Nesterov <oleg@tv-sign.ru>
Thu, 7 Dec 2006 04:36:50 +0000 (20:36 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Thu, 7 Dec 2006 16:39:34 +0000 (08:39 -0800)
commit128fb95650b3273a8dc9ba5514b6fe7db8ea30bf
tree82e8070451edbd7421b6176083658f5f2b997b58
parent38da288b8ba2b07b4e07165027e650b61d7c8ffc
[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 <oleg@tv-sign.ru>
Cc: Balbir Singh <balbir@in.ibm.com>
Acked-by: Shailabh Nagar <nagar@watson.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/taskstats.c