Hi Jens
On 11/13/18 11:42 PM, Jens Axboe wrote:
> @@ -181,6 +181,7 @@ static void blkdev_bio_end_io_simple(struct bio *bio)
> struct task_struct *waiter = bio->bi_private;
>
> WRITE_ONCE(bio->bi_private, NULL);
> + smp_wmb();
> wake_up_process(waiter);
> }
The wake up path has contained a full memory barrier with the raw_spin_lock
and following smp_mb__after_spinlock
Please refer to:
wake_up_process
-> try_to_wake_up
raw_spin_lock_irqsave(&p->pi_lock, flags);
smp_mb__after_spinlock();
So the smp_wmb here is not necessary.
Thanks
Jianchao