Re: [PATCH] Fix race with shared tag queue maps

2007-09-14 Thread Jens Axboe
On Thu, Sep 13 2007, Linus Torvalds wrote: > > > On Thu, 13 Sep 2007, Jens Axboe wrote: > > > > My bad, I think I added the smp_mb__before_clear_bit() when it was > > __test_and_set_bit() like in the first hunk. > > Ahh, that wouldn't work at all. The "__test_and_set_bit()" thing isn't > atomi

Re: [PATCH] Fix race with shared tag queue maps

2007-09-13 Thread Arkadiusz Miskiewicz
On Thursday 13 of September 2007, Jens Axboe wrote: > Hi, > > There's a race condition in blk_queue_end_tag() for shared tag maps, > users include stex (promise supertrak thingy) and qla2xxx. [...] > I'm cc'ing users that reported stex > problems, hopefully they can test this patch and report back

Re: [PATCH] Fix race with shared tag queue maps

2007-09-13 Thread Linus Torvalds
On Thu, 13 Sep 2007, Jens Axboe wrote: > > My bad, I think I added the smp_mb__before_clear_bit() when it was > __test_and_set_bit() like in the first hunk. Ahh, that wouldn't work at all. The "__test_and_set_bit()" thing isn't atomic at all, and no amount of memory barriers around it would he

Re: [PATCH] Fix race with shared tag queue maps

2007-09-13 Thread Jens Axboe
On Thu, Sep 13 2007, Linus Torvalds wrote: > > > 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_m

Re: [PATCH] Fix race with shared tag queue maps

2007-09-13 Thread Linus Torvalds
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()"