Thread (18 messages) 18 messages, 4 authors, 2018-11-14

Re: [PATCH 05/11] block: avoid ordered task state change for polled IO

From: jianchao.wang <hidden>
Date: 2018-11-14 02:29:33

Hi Jens

On 11/13/18 11:42 PM, Jens Axboe wrote:
quoted hunk ↗ jump to hunk
@@ -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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help