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 1312F46AA86 for ; Tue, 21 Jul 2026 15:42:18 +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=1784648540; cv=none; b=Xn6s2cACAuWKgmvq09ZBtG69R7TvJQumyI9W7h/l0rc0vy8LEaksE9wuDt9b4lb2VgA9j0mKhPBSwi/2KocHI9F+RjmyE6IZ2ncjWamki+hCuJmCtxtuFPdVCYh7oVktJgqXfUW97/d8DjDdduNQnDVy7qG1/90Brs763LI7H1A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784648540; c=relaxed/simple; bh=62OF6NSssJksSpHLhyQP/rtfjuUGRZH7myJpUU0DmfM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Z/h9lMNN4f0LFQtX4L/+OIawYfyJm8wxS1qmfxPdQf/dIdlZsFgRjJXIh9lek7EAjSODbtopgltMQJFh1fQs99rnrZ2aaF6iNXlqBDJwRSMBwcw6+q7BY7mTflg/JvB0ciTRm6EAV9Q9Da7MRcqr2gloXbdfitQiFY29zn87JeA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KW2YAXJC; 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="KW2YAXJC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB7701F00A3A; Tue, 21 Jul 2026 15:42:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784648538; bh=62OF6NSssJksSpHLhyQP/rtfjuUGRZH7myJpUU0DmfM=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=KW2YAXJCNl8qhVsFRzwOAYPlM2AWvmsNX+Tlkjsxa3a1k+SYEadjOodVb+Usmz+bq LHm2JGHEnPvDDzUUdaCM2PlAjMq00MF/ah2bpPK/D+nOQSRkLJp0N1nvFWbjnl+Ari EnohuB0idMlXpGF2dQTIRDzCeh2I5k3Z+gVOmoSZAzHVc3N8fnJdvcBIZnA/ThOQ7a UGUnfEJQ2iF+YuWmTPmv+mrNU8etsXXQFxoGTc6P9B+c90lz/9IDZ66S4R150Wj/LD NBPMcrJ58izFbj6bQQqiiQ75uWpXkT8ddrQiZkWC0sfg0vE8hVvfpJLEOSefxrTV6/ YWvfAy9rOkocg== Message-ID: Date: Wed, 22 Jul 2026 00:42:11 +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 v3] mm/slub: prevent pfmemalloc objects from entering the barn To: hu.shengming@zte.com.cn, vbabka@kernel.org Cc: akpm@linux-foundation.org, 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: <20260721170439864YfrJGliTZWCikCX-HcPzl@zte.com.cn> Content-Language: en-US From: Harry Yoo In-Reply-To: <20260721170439864YfrJGliTZWCikCX-HcPzl@zte.com.cn> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------3tg7DmIrLoZVRKTFmyx5wMJE" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------3tg7DmIrLoZVRKTFmyx5wMJE Content-Type: multipart/mixed; boundary="------------sknT1z40q0AKvdHcsxeuBT70"; protected-headers="v1" From: Harry Yoo To: hu.shengming@zte.com.cn, vbabka@kernel.org Cc: akpm@linux-foundation.org, 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 v3] mm/slub: prevent pfmemalloc objects from entering the barn References: <20260721170439864YfrJGliTZWCikCX-HcPzl@zte.com.cn> In-Reply-To: <20260721170439864YfrJGliTZWCikCX-HcPzl@zte.com.cn> --------------sknT1z40q0AKvdHcsxeuBT70 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 7/21/26 6:04 PM, hu.shengming@zte.com.cn wrote: > Vlastimil wrote: >> On 7/21/26 09:34, Vlastimil Babka (SUSE) wrote: >>> On 7/21/26 02:45, hu.shengming@zte.com.cn wrote: >>>> From: Shengming Hu >>>> >>>> kmem_cache_return_sheaf() may refill a partially consumed sheaf befo= re >>>> placing it in the barn. Without an explicit restriction, this refill= may >>>> draw objects from pfmemalloc slabs and consume emergency reserves. >>>> >>>> Add __GFP_NOMEMALLOC so that returned sheaves are refilled only from= >>>> non-pfmemalloc slabs. Also add __GFP_NOWARN, as suggested by Hao Li,= >>>> because this refill is a best-effort attempt and failure is acceptab= le.. >>>> If the refill fails, flush and free the sheaf instead. >>>> >>>> Fixes: 3c1ea5c5019f ("slab: sheaf prefilling for guaranteed allocati= ons") >>> >>> Wonder if 1ce20c28eafd ("slab: handle pfmemalloc slabs properly with >>> sheaves") is a better match. Until that commit we just didn't care, a= nd it >>> seems like this is a case that commit missed? >=20 > Agreed, 1ce20c28eafd is a better match. Thanks for catching this. Agreed, thanks! --=20 Cheers, Harry / Hyeonggon --------------sknT1z40q0AKvdHcsxeuBT70-- --------------3tg7DmIrLoZVRKTFmyx5wMJE Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQQQ1ub6gR5ogjaKRmOGXBN6rc5S1gUCal+TUwAKCRCGXBN6rc5S 1pTOAQCaYmEPjb3oa7nqKKas83R+C6PdrboJ4y0zaJuND5YOVwEAmvNtaHdwKxXE oGimas2EKd6CfXp885aX53GRy6KGYwY= =TL4q -----END PGP SIGNATURE----- --------------3tg7DmIrLoZVRKTFmyx5wMJE--