* [Linux-ia64] Re: O(1) scheduler fix for 2.5-ia64
@ 2002-11-05 0:22 David Mosberger
2002-11-05 11:35 ` Erich Focht
2002-11-05 18:54 ` David Mosberger
0 siblings, 2 replies; 3+ messages in thread
From: David Mosberger @ 2002-11-05 0:22 UTC (permalink / raw)
To: linux-ia64
>>>>> On Mon, 4 Nov 2002 19:53:07 +0100, Erich Focht <efocht@ess.nec.de> said:
Erich> Hi David, this problem is wellknown and I actually thought
Erich> that it was solved. But it looks like the complex
Erich> prepare_arch_switch() etc. macros didn't make it into the 2.5
Erich> kernels for IA64. They are needed on IA64 because we have to
Erich> release the runqueue lock during context switch. This is
Erich> similar to sparc64. Thanks to John Hawks for noticing this.
Yes, this seems to have fallen through the cracks. Can you remind me
what the deadlock scenario looked like?
--david
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Linux-ia64] Re: O(1) scheduler fix for 2.5-ia64
2002-11-05 0:22 [Linux-ia64] Re: O(1) scheduler fix for 2.5-ia64 David Mosberger
@ 2002-11-05 11:35 ` Erich Focht
2002-11-05 18:54 ` David Mosberger
1 sibling, 0 replies; 3+ messages in thread
From: Erich Focht @ 2002-11-05 11:35 UTC (permalink / raw)
To: linux-ia64
On Tuesday 05 November 2002 01:22, David Mosberger wrote:
> >>>>> On Mon, 4 Nov 2002 19:53:07 +0100, Erich Focht <efocht@ess.nec.de>
> >>>>> said:
>
> Erich> Hi David, this problem is wellknown and I actually thought
> Erich> that it was solved. But it looks like the complex
> Erich> prepare_arch_switch() etc. macros didn't make it into the 2.5
> Erich> kernels for IA64. They are needed on IA64 because we have to
> Erich> release the runqueue lock during context switch. This is
> Erich> similar to sparc64. Thanks to John Hawks for noticing this.
>
> Yes, this seems to have fallen through the cracks. Can you remind me
> what the deadlock scenario looked like?
This can happen when the runqueue lock is held during a context switch
which requires wrapping around the context numbers:
Example:
CPU#0:
schedule()
-> spin_lock_irq(&rq->lock)
-> context_switch()
-> wrap_mmu_context()
-> read_lock(&tasklist_lock)
CPU#1:
sys_wait4() or release_task() or forget_original_parent()
-> write_lock(&tasklist_lock)
-> do_notify_parent()
-> wake_up_parent()
-> try_to_wake_up()
-> spin_lock_irq(&parent_rq->lock)
If the parent's rq happens to be on CPU#0, we'll wait for the rq->lock
of that CPU which will not be released, because there we wait for the
tasklist_lock to become available.
Regards,
Erich
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Linux-ia64] Re: O(1) scheduler fix for 2.5-ia64
2002-11-05 0:22 [Linux-ia64] Re: O(1) scheduler fix for 2.5-ia64 David Mosberger
2002-11-05 11:35 ` Erich Focht
@ 2002-11-05 18:54 ` David Mosberger
1 sibling, 0 replies; 3+ messages in thread
From: David Mosberger @ 2002-11-05 18:54 UTC (permalink / raw)
To: linux-ia64
>>>>> On Tue, 5 Nov 2002 12:35:35 +0100, Erich Focht <efocht@ess.nec.de> said:
Erich> This can happen when the runqueue lock is held during a
Erich> context switch which requires wrapping around the context
Erich> numbers:
Ah, right. I really dislike the fact that the locking rules for
platform-independent locks will vary from one platform to the other.
Hopefully someone will look into fixing that at some point.
--david
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-11-05 18:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-05 0:22 [Linux-ia64] Re: O(1) scheduler fix for 2.5-ia64 David Mosberger
2002-11-05 11:35 ` Erich Focht
2002-11-05 18:54 ` David Mosberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox