[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.0.999.0709130813220.16478@woody.linux-foundation.org>
Date:	Thu, 13 Sep 2007 08:16:52 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Jens Axboe <jens.axboe@...cle.com>
cc:	linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
	orgis@...ld.uni-potsdam.de, arekm@...en.pl, ed.lin@...mise.com,
	Andrew Morton <akpm@...ux-foundation.org>,
	James.Bottomley@...elEye.com
Subject: Re: [PATCH] Fix race with shared tag queue maps
On Thu, 13 Sep 2007, Jens Axboe wrote:
> +
> +	/*
> +	 * Ensure ordering with tag section
> +	 */
> +	smp_mb__before_clear_bit();
> +
> +	if (unlikely(!test_and_clear_bit(tag, bqt->tag_map))) {
You don't need the "smp_mb__before_clear_bit()" there.
The regular "clear_bit()" needs it, but the "test_and_xxx()" versions are 
architecturally defined to be memory barriers, exactly because they are 
regularly used for locking.
This is even documented - see Documentation/atomic_ops.txt.
		Linus
-
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
 
