From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (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 F409E282F38 for ; Mon, 1 Jun 2026 05:29:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780291787; cv=none; b=gPmA72S7N9FzonV5xRuoD7WUaRGWz+5DbNFqz80d+MrOSC+8taKGPzIvuzHxk4G2NyakDSmaKHFNLtTQkXBCfvOH0o9UwGG+EybbYQ/XfGNI96chbY2Tme8qJIlYL1oDMKDrtDKCEiB1yGzx59xH/yPQqmzJgVr5EhXVvIFtUpw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780291787; c=relaxed/simple; bh=JcUPJG2/d/cceAaM10ZeXJvIxIO/7Un3Fh2+yMn3+GY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SghguTdreuQjUSJ1iTtAiEpYAPFH48uTXX0P04F0RjyRtMUudYAhv0Z77lj4j9kapXq5r1F4B3RM7FHzQD98hUuVL36iLjnVkcBh2halfJFiP5m/aTXuawOH4I1ok4Olyk7GgM0fHwZWoDnrVmyKJlLBrITDqdzdE2AqX51RQvI= 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=wqj7qqnD; arc=none smtp.client-ip=91.218.175.183 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="wqj7qqnD" Date: Mon, 1 Jun 2026 13:29:33 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1780291784; 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=KsKpIHqnf51QbeZWlXH2bfGBPrOfF8CYCvVjN2m0bnQ=; b=wqj7qqnDdg0CTuiDo5Y081fpkL9o6vjT87F4EeAz3vGmlfY5/GU723zR8TPY7vVPusfuEK vqw1fOKPZF2j9bK6uYnZRGvJnY2o2ghie1qjXMiPqgGnBwcS6aDVRjF9iVYOXK9fBTe1q/ hpQVBRx2h0AmysTgccf7mANwS1BTac4= 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 v5] mm/slub: use empty sheaf helpers for oversized sheaves Message-ID: References: <20260528193537623nAo-xYBNYBysGKSBjREuO@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: <20260528193537623nAo-xYBNYBysGKSBjREuO@zte.com.cn> X-Migadu-Flow: FLOW_OUT On Thu, May 28, 2026 at 07:35:37PM +0800, hu.shengming@zte.com.cn wrote: > From: Shengming Hu > > 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 Reviewed-by: Hao Li -- Thanks, Hao