From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2A36264619 for ; Mon, 1 Jun 2026 03:16:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780283812; cv=none; b=dEqvTidU3HrGny7y1/hXnESPACazqKOt8qBOLWGNNTTFh4pVFMFg4ibREEN30pwmv58QNf9gNDXPEB47SKXisVLr7/nKtibqW2GMfG9/xXz17r4qhZH0u+lDWEVzV+jK6grRw5orfXk2j7YmJoTKViPKqQL9qqXkza0sUCWAOVY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780283812; c=relaxed/simple; bh=nanJnpIe+Hu/ywCaBRWOqFVIIOP5mGOP2PQvp3iZE+Q=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=pOCv1460lQya04AgE7hqpQSC11qFevn+w3PXqNv5ZGvMtjEj+tyjXlmo+zPSU+me7Rh4QPn+Ipvpw0ftzfZxIABstsFVp45VqbNUD2NYhY8sFkMI5pEluojCq+ZT6zjuhCgagmZGGbiFm6MyKwhG1RWK97CD6kcWXoF2bmW2hIY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=L2KjTEXz; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="L2KjTEXz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D4721F00893; Mon, 1 Jun 2026 03:16:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780283810; bh=nanJnpIe+Hu/ywCaBRWOqFVIIOP5mGOP2PQvp3iZE+Q=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=L2KjTEXz9ohjWFwydN+6GUMdnl+Vk/rhhIxeaaIOrb7+NH9r0RzdPI2UnZZ/SSb2+ Ci74VFRmAjpKRH7JDHMHws0ceAGqgC7FlXNfjXVWrZyTojW5xFYRigU8VZ2AC3fmKj WwfNLoC2aM4C4I6F0iHhR1AAS1YHLu3U8JsOkUZcpS1pjQ95JLayA5RWw1BsPSZs5u AMp+pZKgZGfkZtMurs5eCR8OmCWf1HATbfdYQACbABxU07Mlv1tG1VFVkOLo6J2IlS 82lg8LO5BbwhIZdHnjBWQ0oGp2eWL6Kvz7i8t1ZMASlVgV7ofsYNbQXkZCUUQqjUVj ZQnpz5zPw51bQ== Message-ID: Date: Mon, 1 Jun 2026 12:16:42 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5] mm/slub: use empty sheaf helpers for oversized sheaves To: hu.shengming@zte.com.cn, vbabka@kernel.org, akpm@linux-foundation.org Cc: hao.li@linux.dev, 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 References: <20260528193537623nAo-xYBNYBysGKSBjREuO@zte.com.cn> Content-Language: en-US From: Harry Yoo In-Reply-To: <20260528193537623nAo-xYBNYBysGKSBjREuO@zte.com.cn> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------wvSHft0BOYReDcApDrNx573m" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------wvSHft0BOYReDcApDrNx573m Content-Type: multipart/mixed; boundary="------------hCJQ0q6epRJOdVh0NFh51kNn"; protected-headers="v1" From: Harry Yoo To: hu.shengming@zte.com.cn, vbabka@kernel.org, akpm@linux-foundation.org Cc: hao.li@linux.dev, 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 Message-ID: Subject: Re: [PATCH v5] mm/slub: use empty sheaf helpers for oversized sheaves References: <20260528193537623nAo-xYBNYBysGKSBjREuO@zte.com.cn> In-Reply-To: <20260528193537623nAo-xYBNYBysGKSBjREuO@zte.com.cn> --------------hCJQ0q6epRJOdVh0NFh51kNn Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 5/28/26 8:35 PM, hu.shengming@zte.com.cn wrote: > From: Shengming Hu >=20 > 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 b= e > released through the same empty-sheaf helper. >=20 > Allocate oversized prefilled sheaves with __alloc_empty_sheaf() and fre= e > them with free_empty_sheaf() after a failed prefill or after they are > returned and flushed. This keeps the oversized and pfmemalloc return pa= ths > consistent, including the SLAB_KMALLOC-specific __GFP_NO_OBJ_EXT and > mark_obj_codetag_empty() handling. >=20 > 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 dro= p > 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. >=20 > 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. >=20 > Keep the capacity initialization in the oversized prefill path, since > capacity is currently only used for prefilled sheaves >=20 > Signed-off-by: Shengming Hu > --- Reviewed-by: Harry Yoo (Oracle) --=20 Cheers, Harry / Hyeonggon --------------hCJQ0q6epRJOdVh0NFh51kNn-- --------------wvSHft0BOYReDcApDrNx573m Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQQQ1ub6gR5ogjaKRmOGXBN6rc5S1gUCahz5mgAKCRCGXBN6rc5S 1jORAQCGOr1TjpksEe8OoFxteeY6Lhd2pwtjIoqbKEIsaGxV/QEAj3/k3IhDOsfD k7sm+l6niLNAxxWRQXpmGtcCvVeIngA= =qI3X -----END PGP SIGNATURE----- --------------wvSHft0BOYReDcApDrNx573m--