On Wed, 17 Nov 2021, Christoph Hellwig wrote: > > - set_bdi_congested(bio->bi_bdev->bd_disk->bdi, BLK_RW_ASYNC); > > - do { > > - spin_unlock(&pd->lock); > > - congestion_wait(BLK_RW_ASYNC, HZ); > > - spin_lock(&pd->lock); > > - } while(pd->bio_queue_size > pd->write_congestion_off); > > + ___wait_var_event(&pd->congested, > > + pd->bio_queue_size <= pd->write_congestion_off, > > + TASK_UNINTERRUPTIBLE, 0, 0, > > + ({pd->congested = true; > > + spin_unlock(&pd->lock); > > + schedule(); > > + spin_lock(&pd->lock); > > + }) > > I'd be tempted to open code the ___wait_var_event here as this is pretty > unreadable. But otherwise this change looks good to me: > > Reviewed-by: Christoph Hellwig <hch@xxxxxx> Thanks for the review. I'm comfortable with eiuther __wait_var_event() or an open-coded version. I'll follow-up with the latter. Jens: I don't see this in linux-next. Are you happy to take one version or the other? Thanks, NeilBrown