From: Hao Li <hao.li@linux.dev>
To: hu.shengming@zte.com.cn
Cc: vbabka@kernel.org, harry@kernel.org, akpm@linux-foundation.org,
cl@gentwo.org, rientjes@google.com, roman.gushchin@linux.dev,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
zhang.run@zte.com.cn, cai.qu@zte.com.cn
Subject: Re: [PATCH v5] mm/slub: use empty sheaf helpers for oversized sheaves
Date: Mon, 1 Jun 2026 13:29:33 +0800 [thread overview]
Message-ID: <ah0YNKL8bqo0Megn@fedora> (raw)
In-Reply-To: <20260528193537623nAo-xYBNYBysGKSBjREuO@zte.com.cn>
On Thu, May 28, 2026 at 07:35:37PM +0800, hu.shengming@zte.com.cn wrote:
> From: Shengming Hu <hu.shengming@zte.com.cn>
>
> Oversized prefilled sheaves are allocated separately because their
> capacity can be larger than the cache's regular sheaf capacity. After
> they are flushed, however, they are empty sheaves as well, and should be
> released through the same empty-sheaf helper.
>
> Allocate oversized prefilled sheaves with __alloc_empty_sheaf() and free
> them with free_empty_sheaf() after a failed prefill or after they are
> returned and flushed. This keeps the oversized and pfmemalloc return paths
> consistent, including the SLAB_KMALLOC-specific __GFP_NO_OBJ_EXT and
> mark_obj_codetag_empty() handling.
>
> Keep the caller-GFP filtering in alloc_empty_sheaf() instead of
> __alloc_empty_sheaf(). In particular, do not clear OBJCGS_CLEAR_MASK in
> the raw helper, so the oversized prefill path does not unexpectedly drop
> caller-provided flags such as __GFP_NOFAIL. The SLAB_KMALLOC-specific
> addition of __GFP_NO_OBJ_EXT remains in __alloc_empty_sheaf(), matching
> the free_empty_sheaf() assumption.
>
> Since oversized sheaves are now allocated and freed through the empty
> sheaf helpers, SHEAF_ALLOC and SHEAF_FREE also account for oversized
> sheaves. Update the stat comments accordingly.
>
> Keep the capacity initialization in the oversized prefill path, since
> capacity is currently only used for prefilled sheaves
>
> Signed-off-by: Shengming Hu <hu.shengming@zte.com.cn>
Reviewed-by: Hao Li <hao.li@linux.dev>
--
Thanks,
Hao
prev parent reply other threads:[~2026-06-01 5:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-28 11:35 [PATCH v5] mm/slub: use empty sheaf helpers for oversized sheaves hu.shengming
2026-05-28 17:59 ` Vlastimil Babka (SUSE)
2026-06-01 3:16 ` Harry Yoo
2026-06-01 5:29 ` Hao Li [this message]
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=ah0YNKL8bqo0Megn@fedora \
--to=hao.li@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=cai.qu@zte.com.cn \
--cc=cl@gentwo.org \
--cc=harry@kernel.org \
--cc=hu.shengming@zte.com.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=vbabka@kernel.org \
--cc=zhang.run@zte.com.cn \
/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.