| To: | Nick Piggin <nickpiggin@xxxxxxxxxxxx> |
|---|---|
| Subject: | [xfs-masters] Re: [interesting] smattering of possible memory ordering bugs |
| From: | Dave Kleikamp <shaggy@xxxxxxxxxxxxxxxxxx> |
| Date: | Fri, 26 Oct 2007 08:45:24 -0500 |
| Cc: | Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, paulus@xxxxxxxxx, benh@xxxxxxxxxxxxxxxxxxx, adaplas@xxxxxxxxx, "Morton, Andrew" <akpm@xxxxxxxxxxxxxxxxxxxx>, xfs-masters@xxxxxxxxxxx |
| In-reply-to: | <200710261209.58519.nickpiggin@xxxxxxxxxxxx> |
| References: | <200710261209.58519.nickpiggin@xxxxxxxxxxxx> |
| Reply-to: | xfs-masters@xxxxxxxxxxx |
| Sender: | xfs-masters-bounce@xxxxxxxxxxx |
Memory barriers aren't one of my strengths, but this appears correct.
Acked-by: Dave Kleikamp <shaggy@xxxxxxxxxxxxxxxxxx>
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
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [xfs-masters] Re: [interesting] smattering of possible memory ordering bugs, Benjamin Herrenschmidt |
|---|---|
| Next by Date: | [xfs-masters] [Bug 770] New: general protection fault, bugzilla-daemon |
| Previous by Thread: | [xfs-masters] Re: [interesting] smattering of possible memory ordering bugs, Benjamin Herrenschmidt |
| Next by Thread: | [xfs-masters] [Bug 770] New: general protection fault, bugzilla-daemon |
| Indexes: | [Date] [Thread] [Top] [All Lists] |