From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-184.mta0.migadu.com (out-184.mta0.migadu.com [91.218.175.184]) (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 DC30131F9BD for ; Mon, 25 May 2026 11:51:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.184 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779709911; cv=none; b=HnQM05oCy2KXk5wt+Gag+OFb5QwQCe/DJ9ePsWHjXStjn7NXmvAGjNBUNiRW7MQBn9sh43qxM8aHGPCdjVRPdyDK0+p/EcSnJgWE9FqAUbnyz37OumF/Yv2Ez4WEUgZhh/NB39FhjZbNI2Ur2K6FTG+tTdW9aunfxik93+f8v3k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779709911; c=relaxed/simple; bh=JDe4vw9wc6I1+ABuhELU4aemWRBzmh9XHEU+Nrk/Rj4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dAU6Ss5gaSPeWFYTBGkMzKNdp0BKjow/ezRaVLW/e8wCb3Q84hNxa7pVrxzXzLhn92zoNLC6PvoQxshiKwXX3w61mve2Pxpunm+RGA8QO4y7fBIhrWGVjZwhCz/BInmZ75yEGquyk0/DD4/NHlrAXDqZkfNaX6qugL87kTT6wZQ= 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=kp8VSFHw; arc=none smtp.client-ip=91.218.175.184 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="kp8VSFHw" Date: Mon, 25 May 2026 19:51:37 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1779709906; 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=mRIUQCbGsDH0fRnrDCtYh7/ipZrmkoTvcdRHt/l2kgs=; b=kp8VSFHwpoTdQVY5gHjIP1nOoPOyAs3RBFQABRGieQeB1sTC/eWuYNgXI7ZTLsAg1VvXjR GD65u2SAWJdYNrN3oOuYw7G6kaODevz9n7cYXs8VRC8QuAD373Iz1/5AjrfNLBF+fWFgHf 5XWBG+qA+7ipBw1kjKRIVj3/Agnm9dc= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Hao Li To: "Vlastimil Babka (SUSE)" Cc: Harry Yoo , Christoph Lameter , David Rientjes , Roman Gushchin , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, hu.shengming@zte.com.cn, Vinicius Costa Gomes Subject: Re: [PATCH v3 2/2] mm, slab: simplify returning slab in __refill_objects_node() Message-ID: References: <20260522-b4-refill-optimistic-return-v3-0-2ba78ec1c6ed@kernel.org> <20260522-b4-refill-optimistic-return-v3-2-2ba78ec1c6ed@kernel.org> <80d69c1c-a779-4402-af89-3be67b7f0e47@kernel.org> 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: <80d69c1c-a779-4402-af89-3be67b7f0e47@kernel.org> X-Migadu-Flow: FLOW_OUT On Mon, May 25, 2026 at 09:15:49AM +0200, Vlastimil Babka (SUSE) wrote: > On 5/25/26 08:47, Hao Li wrote: > > On Fri, May 22, 2026 at 04:23:21PM +0200, Vlastimil Babka (SUSE) wrote: > >> When we return slabs to the partial list because we didn't fully refill > >> from them, we observe the min_partial limit when the returned slab is > >> empty, and discard it when over the limit. But it's unlikely for the > >> limit to be reached while we were refilling, and the worst outcome is to > >> have temporarily more free slabs on the list than necessary. > > > > Just wondering if the empty slabs temporarily exceed the limit and then some > > objects get allocated from them, would this lead to more fragmented slabs in > > the node partial list? > > I think since we're adding the slabs to tail and refill from head, it > shouldn't happen that easily. This makes sense! > Fragmenting is possible in general due to bad > luck, I doubt this change could make it noticeably worse. I ran a test and even though the data is pretty noisy, the length of the partial list indeed didn't really grow much. And after applying both patches, I can see some improvement (1~2%) in overall performance! Reviewed-by: Hao Li Tested-by: Hao Li -- Thanks, Hao