Re: [PATCH][5/8] Arch agnostic completely out of line locks / ppc64

From: Anton Blanchard
Date: Thu Sep 09 2004 - 19:39:42 EST



Hi,

> Why do we care about profile_pc() here? It should do the right thing
> as-is.

With preempt off profile_pc works as expected, timer ticks in spinlocks
are apportioned to the calling function. Turn preempt on and you end up
with one big bucket called __preempt_spin_lock where most of the
spinlock ticks end up.

> What you care about is wchan, and stack unwiding _over_ the spinlocks.
> Since a spinlock can never be part of the wchan callchain, I vote we just
> change "in_sched_functions()" to claim that anything in the spinlock
> section is also a scheduler function as far as it's concerned.
>
> That makes wchan happy, and profile_pc() really never should care.

At the moment profile_pc is simple and only looks at the timer interrupt
pt_regs. With 2 levels of locks (_spin_lock -> __preempt_spin_lock) we
now have to walk the stack. Obviously fixable, it just a bit more work
in profile_pc. We would also need to move __preempt_spin_lock into the
lock section which should be fine if we change wchan backtracing to do
as you suggest.

Anton
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/