From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-173.mta0.migadu.com (out-173.mta0.migadu.com [91.218.175.173]) (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 8D1263290B7 for ; Tue, 21 Jul 2026 06:10:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784614261; cv=none; b=YrpzuHffj4XKQtV0eKA8Ku5j6JKL3hVNdt0+J6OWNG4e2ro8vZJlNfy0KmzP9ykYiz9eV3D5sYtRYArFqUCePGC2URTCimeGMiwPpAH71p5w/D6gMV/QhsA1PWwNm8CgP4lQOPCaP9LcfiZX1n1xEbUtXf/J4GL/WjW/NwAXeVU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784614261; c=relaxed/simple; bh=GCD+gRoV8DeT0dtVMYzY4/5o1HI4gFNUpV5+MO2w/2Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ez6zg8f9NzmzQmuguMLncFcUW+dl4tzG9u0asBM2YjoifwNqaY8RySaxGrFB4H9H2alH667DsXhiZuT0IWT50zdAoZUd9nHB0qChvqo0pQSeKXldJXlxFmD8mi32iIYjglyUb8evoCas1CngfLmeWMKt/qnaxq5FCTKxwAYATms= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=wY5ZZ1zv; arc=none smtp.client-ip=91.218.175.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="wY5ZZ1zv" Date: Tue, 21 Jul 2026 14:10:46 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1784614255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dcuZrfp5xVpGEBorCEbOVhI4KnWfZ/XuKtgqVJ7Ilgw=; b=wY5ZZ1zveKLkGNMuM67V5CDJqeAK3mHmhTaiLB3Vo+PyUMy/Imojc79igwO/Iz1nqa1vvN 7uDLJKtev6Rcng0Gg9KGGkf7mhGZ6ZbXn5ImZXdjhQH0dUCsNRAD5cV39f4zyFwqjC9dni Bb+XfrhaoNzZ+8NyzCWeS9r1P/etXQg= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Hao Li 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 v3] mm/slub: prevent pfmemalloc objects from entering the barn Message-ID: References: <20260721084522552ZPa16p1SRj3PYat3sqxuN@zte.com.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260721084522552ZPa16p1SRj3PYat3sqxuN@zte.com.cn> X-Migadu-Flow: FLOW_OUT On Tue, Jul 21, 2026 at 08:45:22AM +0800, hu.shengming@zte.com.cn wrote: > From: Shengming Hu > > kmem_cache_return_sheaf() may refill a partially consumed sheaf before > 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 acceptable. > If the refill fails, flush and free the sheaf instead. > > Fixes: 3c1ea5c5019f ("slab: sheaf prefilling for guaranteed allocations") > Cc: stable@vger.kernel.org > Signed-off-by: Shengming Hu LGTM Reviewed-by: Hao Li -- Thanks, Hao