From: Christoph Hellwig <hch@lst.de>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
Andrew Morton <akpm@linux-foundation.org>,
Christoph Lameter <cl@gentwo.org>,
David Rientjes <rientjes@google.com>,
Roman Gushchin <roman.gushchin@linux.dev>,
Harry Yoo <harry.yoo@oracle.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-block@vger.kernel.org, linux-mm@kvack.org,
David Hildenbrand <david@redhat.com>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>,
Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>,
Brendan Jackman <jackmanb@google.com>,
Johannes Weiner <hannes@cmpxchg.org>, Zi Yan <ziy@nvidia.com>
Subject: Re: [PATCH 1/3] slab, block: generalize bvec_alloc_gfp
Date: Fri, 24 Oct 2025 11:05:27 +0200 [thread overview]
Message-ID: <20251024090527.GA27267@lst.de> (raw)
In-Reply-To: <50e96fd8-114b-4de3-939e-9ba606e64b06@suse.cz>
On Fri, Oct 24, 2025 at 10:38:20AM +0200, Vlastimil Babka wrote:
> On 10/23/25 10:08, Christoph Hellwig wrote:
> > bvec_alloc_gfp is useful for any place that tries to kmalloc first and
> > then fall back to a mempool. Rename it and move it to blk.h to prepare
>
> I wonder if such fall backs are necessary because IIRC mempools try to
> allocate from the underlying provider (i.e. kmalloc caches first), and only
> give out the reserves when that fails. Is it done for less overhead or
> something?
That's the mempool behavior, yes. But the bvec allocator only has a
mempool for the largest possible allocation, while usually trying
smaller allocations instead.
>
> > for using it to allocate the default integrity buffer.
> >
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> That says blk.h but you move it to slab.h? Assuming you intended slab.h.
Yes. I initially had it in blk.h, but it felt more general.
> However gfp flags are not slab only so it should be rather
> include/linux/gfp.h - added maintainers of that to Cc.
Ok.
> We do have gfp_nested_mask() there which is quite similar but not exactly.
> Maybe a canonical macro not for nested, but for opportunistic allocations
> (if a one size fits all solution can be found) would be useful too, as
> people indeed reinvent those manually in various places with subtle differences.
That's exactly what I've been trying to avoid indeed.
next prev parent reply other threads:[~2025-10-24 9:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-23 8:08 make block layer auto-PI deadlock safe Christoph Hellwig
2025-10-23 8:08 ` [PATCH 1/3] slab, block: generalize bvec_alloc_gfp Christoph Hellwig
2025-10-24 1:44 ` Martin K. Petersen
2025-10-24 8:38 ` Vlastimil Babka
2025-10-24 9:05 ` Christoph Hellwig [this message]
2025-10-26 21:19 ` Matthew Wilcox
2025-10-27 6:47 ` Christoph Hellwig
2025-10-27 13:09 ` Matthew Wilcox
2025-10-27 13:14 ` Christoph Hellwig
2025-10-23 8:08 ` [PATCH 2/3] block: blocking mempool_alloc doesn't fail Christoph Hellwig
2025-10-24 1:45 ` Martin K. Petersen
2025-10-23 8:08 ` [PATCH 3/3] block: make bio auto-integrity deadlock safe Christoph Hellwig
2025-10-24 1:47 ` Martin K. Petersen
2025-10-27 6:03 ` Kanchan Joshi
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=20251024090527.GA27267@lst.de \
--to=hch@lst.de \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=cl@gentwo.org \
--cc=david@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=harry.yoo@oracle.com \
--cc=jackmanb@google.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=martin.petersen@oracle.com \
--cc=mhocko@suse.com \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--cc=ziy@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox