From: Christoph Hellwig <hch@infradead.org>
To: NeilBrown <neilb@suse.de>
Cc: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org
Subject: Re: [PATCH] pktdvd: stop using bdi congestion framework.
Date: Wed, 17 Nov 2021 04:13:51 -0800 [thread overview]
Message-ID: <YZTx/93/9cjYW4zI@infradead.org> (raw)
In-Reply-To: <163712340344.13692.2840899631949534137@noble.neil.brown.name>
> - 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@lst.de>
next prev parent reply other threads:[~2021-11-17 12:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-17 4:30 [PATCH] pktdvd: stop using bdi congestion framework NeilBrown
2021-11-17 12:13 ` Christoph Hellwig [this message]
2021-12-10 3:53 ` NeilBrown
2021-12-10 3:53 ` [PATCH v3] " NeilBrown
2021-12-10 4:32 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YZTx/93/9cjYW4zI@infradead.org \
--to=hch@infradead.org \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=neilb@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).