From: Ming Lei <ming.lei@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jens Axboe <axboe@kernel.dk>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: [PATCH] block: fix -EAGAIN IOPOLL task/vm accounting
Date: Mon, 31 Aug 2020 11:12:51 +0800 [thread overview]
Message-ID: <20200831031251.GA257809@T590> (raw)
In-Reply-To: <20200830152800.GA16467@infradead.org>
On Sun, Aug 30, 2020 at 04:28:00PM +0100, Christoph Hellwig wrote:
> On Sun, Aug 30, 2020 at 09:09:02AM -0600, Jens Axboe wrote:
> > On 8/30/20 12:26 AM, Christoph Hellwig wrote:
> > > On Sat, Aug 29, 2020 at 10:51:11AM -0600, Jens Axboe wrote:
> > >> We currently increment the task/vm counts when we first attempt to queue a
> > >> bio. But this isn't necessarily correct - if the request allocation fails
> > >> with -EAGAIN, for example, and the caller retries, then we'll over-account
> > >> by as many retries as are done.
> > >>
> > >> This can happen for polled IO, where we cannot wait for requests. Hence
> > >> retries can get aggressive, if we're running out of requests. If this
> > >> happens, then watching the IO rates in vmstat are incorrect as they count
> > >> every issue attempt as successful and hence the stats are inflated by
> > >> quite a lot potentially.
> > >>
> > >> Add a bio flag to know if we've done accounting or not. This prevents
> > >> the same bio from being accounted potentially many times, when retried.
> > >
> > > Can't the resubmitter just use submit_bio_noacct? What is the call
> > > stack here?
> >
> > The resubmitter is way higher than that. You could potentially have that
> > done in the block layer, but not higher up.
> >
> > The use case is async submissions, going through ->read_iter() again.
> > Or ->write_iter().
>
> But how does a bio flag help there? If we go through the file ops
> again the next submission will be a new bio structure.
Yeah, we also have use cases of stack bio variable.
Thanks,
Ming
next prev parent reply other threads:[~2020-08-31 3:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-29 16:51 [PATCH] block: fix -EAGAIN IOPOLL task/vm accounting Jens Axboe
2020-08-30 6:26 ` Christoph Hellwig
2020-08-30 15:09 ` Jens Axboe
2020-08-30 15:28 ` Christoph Hellwig
2020-08-31 3:12 ` Ming Lei [this message]
2020-08-31 14:02 ` Jens Axboe
2020-08-31 14:12 ` Christoph Hellwig
2020-08-31 14:18 ` Jens Axboe
2020-09-01 5:42 ` Christoph Hellwig
2020-09-01 14:01 ` 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=20200831031251.GA257809@T590 \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
/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).