All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Qu Wenruo <wqu@suse.com>
Cc: Christoph Hellwig <hch@lst.de>,
	Qu Wenruo <quwenruo.btrfs@gmx.com>,
	clm@fb.com, dsterba@suse.com, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] btrfs: don't limit direct reads to a single sector
Date: Tue, 21 Jun 2022 08:59:09 +0200	[thread overview]
Message-ID: <20220621065909.GA1186@lst.de> (raw)
In-Reply-To: <2bb7e620-fb2c-52d3-0ecf-87c2f75a1305@suse.com>

On Tue, Jun 21, 2022 at 02:55:06PM +0800, Qu Wenruo wrote:
> A little off-topic here, what did the extra XFS/iomap do here?
>
> IIRC the multi-page bio vector is already there for years.

Yes.

> As long as the pages in page cache are contiguous, bio_add_page() will 
> create such multi-page vector, without any extra support from fs.

Yes.  Every file system supports that case right now, but that only
covers the case where pages are contiguous by luck because the
allocations worked that way.  The iomap THP support is all about
having I/O map (and to a small extent the file system, which for now
is just xfs) to be able to deal with large folios, that is > PAGE_SIZE
compound allocations.

>>  At which point
>> allocating the larger csums array is also not a problem as we can
>> find contigous memory for that easily as well.  For direct I/O on the
>> other hand the destination could be THPs or hugetlbs even when memory
>> is badly fragmented.
>
> My point here is just no need to align any limit.
>
> Smash a good enough value here is enough, or we need to dig way deeper to 
> see if the MAX_SECTORS based one is really correct or not.

So my plan here was to also enforce the limit for buffered I/O and
provide a mempool for the maximum allocation size instead of just
failing on memory presure right now.  But there is another series
or two I need to finish first to have the buffered I/O code in the
shape where this can be easily added.


  reply	other threads:[~2022-06-21  6:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-21  6:26 [PATCH v2] btrfs: don't limit direct reads to a single sector Christoph Hellwig
2022-06-21  6:35 ` Qu Wenruo
2022-06-21  6:40   ` Christoph Hellwig
2022-06-21  6:55     ` Qu Wenruo
2022-06-21  6:59       ` Christoph Hellwig [this message]
2022-06-21  7:04         ` Qu Wenruo
2022-06-21  8:37 ` Nikolay Borisov
2022-06-21 13:34 ` David Sterba

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=20220621065909.GA1186@lst.de \
    --to=hch@lst.de \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    --cc=wqu@suse.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.