From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B43222F1FEA for ; Tue, 7 Apr 2026 10:49:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775558981; cv=none; b=oXXgG4x1XxIgZT20HqybevRkAkwE2KAXEW5q72tq6ji3G5YlZzaqeRDTjo1b0D5CkdkZTzzS2O8BxMsN9XKmoyO2s3u7btIGGgtuufJv1QELtB8SQ6HAqy5x7ulOQZ1O84OgzyOp29dxO0QIYQtUSKhvp9z7UCcLaQqIC0trWzs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775558981; c=relaxed/simple; bh=yaqqzWcBkz9jMC2g5Pf5xF7lU+dIw75/p3GRmnmxZug=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=owmnW4CDtZ9NGvKCBfpeWQl0hi0EQcpIBW8FeMck5im1NB1nlW+11lbVkp1l0pGtw3NOp1tA9auR4+IeNRepC/83wa/Mz0ZvwnG54EOPkb0eoX+56eeHZcBMh8pF/NiFJr8xDzYumlehTRK0dn9KQf5E86cO8prjKsUmNfVcHAI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dzh5IUru; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dzh5IUru" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23364C116C6; Tue, 7 Apr 2026 10:49:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775558981; bh=yaqqzWcBkz9jMC2g5Pf5xF7lU+dIw75/p3GRmnmxZug=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dzh5IUrutaRxhZXz1W3am7LI8nPeJxe+kz1+aNkv8ZJ2oDkOCH6R2JK2/o+t3T5DX gkQ9H+60DlaDJ/NHCyo6aYNH62kgs2ww1ZBN9rXUBvXdnAlGOQ5QgsWXkp2YJojBns Yoanq+Pl8G1Kwn7Wk4octwg/U+dk/QKOoykZXg5XnqI95EURyuM5gyh09xu1WHY++t gF9uTh8b0gFb6vz+doNTynt/DOCoNlDAGQmUfx40bg6auimYgf/fSD4pPRvfKCLqlZ QzNp8M26wMA+Ygg9/UEpRhGkqxRs2EGEaYOfNTFw0fSNMOQ9qFaz0GH0EcAprSA5oC JBkR7koy0k18Q== Date: Tue, 7 Apr 2026 19:49:39 +0900 From: "Harry Yoo (Oracle)" To: Hao Li Cc: vbabka@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 Subject: Re: [PATCH v2] slub: clarify kmem_cache_refill_sheaf() comments Message-ID: References: <20260407100255.40035-1-hao.li@linux.dev> 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: <20260407100255.40035-1-hao.li@linux.dev> On Tue, Apr 07, 2026 at 05:59:10PM +0800, Hao Li wrote: > In the in-place refill case, some objects may already have been added > before the function returns -ENOMEM. > Clarify this behavior and polish the rest of the comment for readability. > > Signed-off-by: Hao Li > --- > Thanks Harry for suggestions on v1! You're welcome! Overall looks good to me, so: Acked-by: Harry Yoo (Oracle) With some small nitpicking :) > --- > mm/slub.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/mm/slub.c b/mm/slub.c > index 4927407c9699..a45eb1bd2ce5 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -5120,12 +5120,15 @@ void kmem_cache_return_sheaf(struct kmem_cache *s, gfp_t gfp, > } > > /* > - * refill a sheaf previously returned by kmem_cache_prefill_sheaf to at least > - * the given size > + * Refill a sheaf previously returned by kmem_cache_prefill_sheaf to at least > + * the given size. > * > - * the sheaf might be replaced by a new one when requesting more than > - * s->sheaf_capacity objects if such replacement is necessary, but the refill > - * fails (returning -ENOMEM), the existing sheaf is left intact > + * Return: 0 on success. The sheaf will contain at least @size objects. > + * The sheaf might be replaced with a new one if more than sheaf->capacity nit: "The sheaf might have been replaced with a new one" ... > + * objects are requested. > + * > + * Return: -ENOMEM on failure. The refill might partially fill the existing nit: ..."Some objects might have been added to the sheaf, but the sheaf will not be replaced." sounds a little bit more clear (tm). > + * sheaf or leave it unchanged, but it will not replace the existing sheaf. > * > * In practice we always refill to full sheaf's capacity. > */ > -- > 2.50.1 > -- Cheers, Harry / Hyeonggon