From c7af77b584b02d3e321b00203a618a9c93782121 Mon Sep 17 00:00:00 2001 From: Livio Soares Date: Tue, 18 Dec 2007 15:21:13 +0100 Subject: sched: mark rwsem functions as __sched for wchan/profiling This following commit http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=fdf8cb0909b531f9ae8f9b9d7e4eb35ba3505f07 un-inlined a low-level rwsem function, but did not mark it as __sched. The result is that it now shows up as thread wchan (which also affects /proc/profile stats). The following simple patch fixes this by properly marking rwsem_down_failed_common() as a __sched function. Also in this patch, which is up for discussion, marks down_read() and down_write() proper as __sched. For profiling, it is pretty much useless to know that a semaphore is beig help - it is necessary to know _which_ one. By going up another frame on the stack, the information becomes much more useful. In summary, the below change to lib/rwsem.c should be applied; the changes to kernel/rwsem.c could be applied if other kernel hackers agree with my proposal that down_read()/down_write() in the profile is not enough. [ akpm@linux-foundation.org: build fix ] Signed-off-by: Livio Soares Signed-off-by: Andrew Morton Signed-off-by: Ingo Molnar --- lib/rwsem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/rwsem.c') diff --git a/lib/rwsem.c b/lib/rwsem.c index cdb4e3d05607..7d02700a4b0e 100644 --- a/lib/rwsem.c +++ b/lib/rwsem.c @@ -146,7 +146,7 @@ __rwsem_do_wake(struct rw_semaphore *sem, int downgrading) /* * wait for a lock to be granted */ -static struct rw_semaphore * +static struct rw_semaphore __sched * rwsem_down_failed_common(struct rw_semaphore *sem, struct rwsem_waiter *waiter, signed long adjustment) { -- cgit v1.2.3