On 17:25, Neil Brown wrote: tely Tue, 8 Dec 2009 14:54:42 +0100 > Andre Noll <maan@xxxxxxxxxxxxxxx> wrote: > > Thanks again. > I have made most of the changes you suggest. Thanks. Feel free to add Reviewed-by: Andre Noll <maan@xxxxxxxxxxxxxxx> > > Calling atomic_inc() twice isn't an atomic operation any more. If > > this doesn't matter (because all modifications of rdev->nr_pending > > are supposed to happen within RCU read-side critical sections) then > > why is rdev->nr_pending an atomic_t at all? > > Calling atomic_inc() twice is still two atomic operations, and that is what I > need. > The important thing is that the read-modify-write cycle of atomic_inc isn't > interrupted, so if two thread both do atomic_inc at the same time the result > really is adding 2, not just adding one. A conceivable problem is that someone else might remove the whole thing between the two atomic_inc() calls because it calls atomic_dec_and_test() and finds it is zero. But this can't possibly happen here, can it? > Multiple RCU read-side blocks can run at the same time on different > processors - so we definitely need to protection of 'atomic_'. Yes, definitely. Regards Andre -- The only person who always got his work done by Friday was Robinson Crusoe
Attachment:
signature.asc
Description: Digital signature