All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zoltan Menyhart <Zoltan.Menyhart@bull.net>
To: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: unlock_buffer() and clear_bit()
Date: Mon, 27 Mar 2006 11:38:26 +0200	[thread overview]
Message-ID: <4427B292.3080204@bull.net> (raw)
In-Reply-To: <20060327010739.027d410d.akpm@osdl.org>

Andrew Morton wrote:

> This is, I think, a rather inefficient thing we're doing there.  For most
> architectures, that amounts to:
> 
> 	mb();
> 	clear_bit()
> 	mb();
> 
> which is probably more than is needed.  We'd need to get some other
> architecture people involved to see if there's a way of improving this, and
> unlock_page().

This is why I proposed also:

>>> Or a new bit clearing service needs to be added that includes
>>>   the "rel" semantics, say "release_N_clear_bit()"

The architecture dependent "release_N_clear_bit()" should include what
is necessary for the correct unlocking semantics (and it leaves the freedom
for the "stand alone" bit operations implementations).

Note that "lock_buffer()" works on ia64 "by chance", because all the
atomic bit operations are implemented "by chance" by use of the "acq"
semantics.

I'd like to split the bit operations according to their purposes:
- e.g. "test_and_set_bit_N_acquire()" for lock acquisition
- "test_and_set_bit()", "clear_bit()" as they are today
- "release_N_clear_bit()"...

Thaks,

Zoltan

  reply	other threads:[~2006-03-27  9:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-24 23:24 unlock_buffer() and clear_bit() Zoltan Menyhart
2006-03-25 12:02 ` Andrew Morton
2006-03-27  8:53   ` Zoltan Menyhart
2006-03-27  9:07     ` Andrew Morton
2006-03-27  9:38       ` Zoltan Menyhart [this message]
2006-03-27 10:46         ` Nick Piggin
2006-03-27 10:56           ` Nick Piggin
  -- strict thread matches above, loose matches on Subject: below --
2006-03-24 15:18 Zoltan Menyhart
2006-03-24 21:46 ` Chen, Kenneth W

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=4427B292.3080204@bull.net \
    --to=zoltan.menyhart@bull.net \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.