[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.10.0901061401270.10871@gandalf.stny.rr.com>
Date: Tue, 6 Jan 2009 14:03:02 -0500 (EST)
From: Steven Rostedt <rostedt@...dmis.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
cc: Peter Zijlstra <peterz@...radead.org>,
Matthew Wilcox <matthew@....cx>,
Andi Kleen <andi@...stfloor.org>,
Chris Mason <chris.mason@...cle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
linux-btrfs <linux-btrfs@...r.kernel.org>,
Ingo Molnar <mingo@...e.hu>,
Thomas Gleixner <tglx@...utronix.de>,
Gregory Haskins <ghaskins@...ell.com>,
Nick Piggin <npiggin@...e.de>
Subject: Re: [PATCH][RFC]: mutex: adaptive spin
>
> Btw, this also fixes a bug: your patch did
>
> + __set_task_state(task, state);
> + /* didnt get the lock, go to sleep: */
> + schedule();
>
> for the schedule case without holding the mutex spinlock.
>
> And that seems very buggy and racy indeed: since it doesn't hold the mutex
> lock, if the old owner releases the mutex at just the right point (yeah,
> yeah, it requires a scheduling event on another CPU in order to also miss
> the whole "task_is_current()" logic), the wakeup can get lost, because you
> set the state to sleeping perhaps _after_ the task just got woken up. So
> we stay sleeping even though the mutex is clear.
That is indeed a bug.
Peter, why did you need to move __set_task_state down here? The -rt patch
does not do this.
-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists