All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Linux Memory Management List <linux-mm@kvack.org>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	Matthew Wilcox <willy@infradead.org>
Subject: Is it possible to force an address_space to always allocate pages in specific order?
Date: Wed, 14 Sep 2022 14:17:24 +0800	[thread overview]
Message-ID: <1780f977-2717-8ea8-c5ec-6cf30d98d261@gmx.com> (raw)

Hi,

With recent folio MM changes, I'm wondering if it's possible to force an
address space to always allocate a folio in certain order?

E.g. For certain inode, we always allocate pages (folios) in the order
of 2 for its page cache.

I'm asking this seemingly weird question for the following reasons:

- Support multi-page blocksize of various filesystems
   Currently most file systems only go support sub-page, not multi-page
   blocksize.

   Thus if there is forced order for all the address space, it would be
   much easier to implement multi-page blocksize support.
   (Although I strongly doubt if we need such multi-page blocksize
    support for most fses)

- For btrfs metadata optimization
   Btrfs metadata is always using multiple blocks (and power of 2 of
   cource) for one of its metadata block.

   Currently we have to do a lot of cross-page handling, if we can ensure
   all of our metadata block are using folios, we can get rid of such
   cross-page checks (at a cost of possible higher chance hitting
   ENOMEM).

It looks like our current __filemap_get_folio() is still allocating new
folios using fixed order 0, thus it's not really possible for now.

Would it be possible in the future or it may need too much work for this
to work?
(Other than some folio order member in address_space?)

Thanks,
Qu

             reply	other threads:[~2022-09-14  6:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-14  6:17 Qu Wenruo [this message]
2022-09-14 22:23 ` Is it possible to force an address_space to always allocate pages in specific order? Matthew Wilcox
2022-09-14 23:03   ` Qu Wenruo

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=1780f977-2717-8ea8-c5ec-6cf30d98d261@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.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 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.