From: Oleg Nesterov <oleg@tv-sign.ru>
To: Ingo Molnar <mingo@elte.hu>
Cc: lkml <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
Arjan van de Ven <arjanv@infradead.org>,
Nicolas Pitre <nico@cam.org>,
Jes Sorensen <jes@trained-monkey.org>,
Zwane Mwaikambo <zwane@arm.linux.org.uk>,
David Howells <dhowells@redhat.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
Benjamin LaHaise <bcrl@kvack.org>,
Steven Rostedt <rostedt@goodmis.org>,
Christoph Hellwig <hch@infradead.org>, Andi Kleen <ak@suse.de>,
Russell King <rmk+lkml@arm.linux.org.uk>
Subject: Re: [patch 5/9] mutex subsystem, core
Date: Thu, 22 Dec 2005 19:12:49 +0300 [thread overview]
Message-ID: <43AAD081.8F510F6B@tv-sign.ru> (raw)
In-Reply-To: 20051222144626.GA31939@elte.hu
Ingo Molnar wrote:
>
> > This is a minor issue, but still I think it makes sense to optimize
> > for uncontended case:
> >
> > old_val = atomic_xchg(&lock->count, 0); // no sleepers
> >
> > if (old_val == 1) {
> > // sleepers ?
> > if (!list_empty(&lock->wait_list))
> > // need to wakeup them
> > atomic_set(&lock->count, -1);
> > ...
> > }
> > [*]
>
> but then we'd have to set it to -1 again, at [*], because we are now
Oh! You are right, thanks.
Oleg.
prev parent reply other threads:[~2005-12-22 14:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-22 11:42 [patch 5/9] mutex subsystem, core Ingo Molnar
2005-12-22 11:57 ` Christoph Hellwig
2005-12-22 12:52 ` Ingo Molnar
2005-12-22 13:38 ` Oleg Nesterov
2005-12-22 14:46 ` Ingo Molnar
2005-12-22 16:12 ` Oleg Nesterov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43AAD081.8F510F6B@tv-sign.ru \
--to=oleg@tv-sign.ru \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=arjanv@infradead.org \
--cc=bcrl@kvack.org \
--cc=dhowells@redhat.com \
--cc=hch@infradead.org \
--cc=jes@trained-monkey.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=nico@cam.org \
--cc=rmk+lkml@arm.linux.org.uk \
--cc=rostedt@goodmis.org \
--cc=torvalds@osdl.org \
--cc=zwane@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox