From: Christoph Hellwig <hch@lst.de>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>, Carlos Maiolino <cem@kernel.org>,
linux-xfs@vger.kernel.org
Subject: Re: [PATCH 3/4] xfs: fix incorrect use of gfp flags in xfs_buf_alloc_backing_mem
Date: Tue, 30 Jun 2026 07:15:30 +0200 [thread overview]
Message-ID: <20260630051530.GC20771@lst.de> (raw)
In-Reply-To: <20260630014935.GI6078@frogsfrogsfrogs>
On Mon, Jun 29, 2026 at 06:49:35PM -0700, Darrick J. Wong wrote:
> > + return xfs_buf_alloc_folio(bp, size, gfp_mask);
>
> Hrmm, ok. So first we special-case buffers > PAGE_SIZE -- if they're a
> power of two, we try (not very hard) to allocate a single large folio.
> If that fails or it's not a power-of-two, then we just do vmalloc, which
> allows direct reclaim and retries.
Yes.
> For smaller than PAGE_SIZE buffers that are powers of two, I guess we
> use the slab allocator, otherwise a full folio. That part strikes me as
> a little strange (efficiency, I guess?), but that's what the code did
> before so I guess it's ok.
That's because slab doesn't guarantee alignent for non-power-of two
allocations, and we need that for the block layer. There is a comment
in the code explaining that.
next prev parent reply other threads:[~2026-06-30 5:15 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-17 5:58 fix GFP_ flag use in the buffer cache Christoph Hellwig
2026-06-17 5:58 ` [PATCH 1/4] xfs: split up xfs_buf_alloc_backing_mem Christoph Hellwig
2026-06-22 12:17 ` Carlos Maiolino
2026-06-30 0:52 ` Darrick J. Wong
2026-06-17 5:58 ` [PATCH 2/4] xfs: lift setting __GFP_NOFAIL from xfs_buf_alloc_kmem to the caller Christoph Hellwig
2026-06-22 12:22 ` Carlos Maiolino
2026-06-30 0:52 ` Darrick J. Wong
2026-07-01 9:31 ` Carlos Maiolino
2026-07-01 16:03 ` Darrick J. Wong
2026-06-17 5:58 ` [PATCH 3/4] xfs: fix incorrect use of gfp flags in xfs_buf_alloc_backing_mem Christoph Hellwig
2026-06-22 12:31 ` Carlos Maiolino
2026-06-30 1:49 ` Darrick J. Wong
2026-06-30 5:15 ` Christoph Hellwig [this message]
2026-06-17 5:58 ` [PATCH 4/4] xfs: simplify the failure path in xfs_buf_alloc_vmalloc Christoph Hellwig
2026-06-22 12:34 ` Carlos Maiolino
2026-06-24 7:41 ` Christoph Hellwig
2026-06-24 8:25 ` Carlos Maiolino
2026-06-30 1:51 ` Darrick J. Wong
2026-07-01 12:50 ` fix GFP_ flag use in the buffer cache Carlos Maiolino
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=20260630051530.GC20771@lst.de \
--to=hch@lst.de \
--cc=cem@kernel.org \
--cc=djwong@kernel.org \
--cc=linux-xfs@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 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.