mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	paulus@samba.org, benh@kernel.crashing.org, adaplas@gmail.com,
	"Morton, Andrew" <akpm@linux-foundation.org>,
	xfs-masters@oss.sgi.com
Subject: Re: [interesting] smattering of possible memory ordering bugs
Date: Fri, 26 Oct 2007 08:45:24 -0500	[thread overview]
Message-ID: <1193406324.6834.3.camel@norville.austin.ibm.com> (raw)
In-Reply-To: <200710261209.58519.nickpiggin@yahoo.com.au>

Memory barriers aren't one of my strengths, but this appears correct.

Acked-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>

On Fri, 2007-10-26 at 12:09 +1000, Nick Piggin wrote:
> Index: linux-2.6/fs/jfs/jfs_metapage.c
> ===================================================================
> --- linux-2.6.orig/fs/jfs/jfs_metapage.c
> +++ linux-2.6/fs/jfs/jfs_metapage.c
> @@ -39,11 +39,12 @@ static struct {
>  #endif
>  
>  #define metapage_locked(mp) test_bit(META_locked, &(mp)->flag)
> -#define trylock_metapage(mp) test_and_set_bit(META_locked,
> &(mp)->flag)
> +#define trylock_metapage(mp) test_and_set_bit_lock(META_locked,
> &(mp)->flag)
>  
>  static inline void unlock_metapage(struct metapage *mp)
>  {
> -       clear_bit(META_locked, &mp->flag);
> +       clear_bit_unlock(META_locked, &mp->flag);
> +       smp_mb__after_clear_bit();
>         wake_up(&mp->wait);
>  }
>   

Thanks,
Shaggy
-- 
David Kleikamp
IBM Linux Technology Center


      parent reply	other threads:[~2007-10-26 13:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-26  2:09 Nick Piggin
2007-10-26  3:35 ` Benjamin Herrenschmidt
2007-10-26  3:47   ` Nick Piggin
2007-10-26  4:32     ` Benjamin Herrenschmidt
2007-10-26 13:45 ` Dave Kleikamp [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=1193406324.6834.3.camel@norville.austin.ibm.com \
    --to=shaggy@linux.vnet.ibm.com \
    --cc=adaplas@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=paulus@samba.org \
    --cc=xfs-masters@oss.sgi.com \
    /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

all inboxes | Powered by JetHome®