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 >

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

2007-09-14 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

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

2007-09-14 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-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 atomic at all, and

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

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

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()"

[PATCH] Fix race with shared tag queue maps

2007-09-13 Thread Jens Axboe
Hi, There's a race condition in blk_queue_end_tag() for shared tag maps, users include stex (promise supertrak thingy) and qla2xxx. The former at least has reported bugs in this area, not sure why we haven't seen any for the latter. It could be because the window is narrow and that other

[PATCH] Fix race with shared tag queue maps

2007-09-13 Thread Jens Axboe
Hi, There's a race condition in blk_queue_end_tag() for shared tag maps, users include stex (promise supertrak thingy) and qla2xxx. The former at least has reported bugs in this area, not sure why we haven't seen any for the latter. It could be because the window is narrow and that other

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() needs it,

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

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 help