From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-177.mta0.migadu.com (out-177.mta0.migadu.com [91.218.175.177]) (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 049D53B4E8F for ; Thu, 28 May 2026 09:53:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779961995; cv=none; b=pxqhG7LUtRRzAfqTBIvjhf7Mjq9LeiV9ke8v/RbaHnDVWFVodNbWLW0TTgfgm2G1i/G/uEdP5splL3bpapEdxhql+sV3jZnAkjwnyISoMZPywTQYIu2bDpzZZv5oZhlPN9zX2W4ndMvGkyCt+Gfp28CAkdbRO8gFAkEHbEAVk1c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779961995; c=relaxed/simple; bh=HDP6Q3wUVeN/wAUx9VV09n1SeqoQZakF0ivQ1Z3tHdg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=rF71LDe6IMsPQLdQDnchsQPwZ2SKTCZDUqCqqB2eypY8gmuzF9gQDAZssApKLxCPgJasLVdWRe6DVOotKb+kjKP9Qpyo7YV1KyYWuwggfK9uBXdPPB668RUBWWlrELWgUPM8DT7d8LQdEzBZ+mmQX6/mGaf3AfRxY4cB4bNo0Ko= 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=ra/Ithy0; arc=none smtp.client-ip=91.218.175.177 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="ra/Ithy0" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1779961991; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Xx63pevhIvHmAd7I82DAKAH03djxp5+URK5s8BIYmFg=; b=ra/Ithy00r6TNwU5FTp/Bc6N7TJJ4zwPoJ0OOASNlN3w3vqAf7tlS6Ybo8zwpqA7Ks4fl4 uTIycdD+UIN8iXwk7lgHe0dHKh8BNmh351V7v5Ok0uONwmmY5unLd1JmF5ZMUMCnJlrN1k 2Ay0OIQ98XfdOBWg3tyBruXtyh5OSLE= From: Hao Li To: vbabka@kernel.org, harry@kernel.org, akpm@linux-foundation.org Cc: cl@gentwo.org, rientjes@google.com, roman.gushchin@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Hao Li Subject: [PATCH v2 0/2] mm/slub: batch partial slab list operations Date: Thu, 28 May 2026 17:52:42 +0800 Message-ID: <20260528095254.43721-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-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT The loops in get_partial_node_bulk() and __refill_objects_node() perform individual list operations for each slab. This patchset optimize this. Patch 1 reduces the number of list operations by processing slabs in batches, thereby minimizing the time spent inside the critical section. Patch 2 is a cleanup patch that wraps duplicated code into a helper function. Changes in v2: - Patch 1 apply the same optimization to __refill_objects_node. (Thanks Harry and Vlastimil) - Patch 2 introduce a helper to wraps duplicated code. (Thanks Harry) Hao Li (2): mm/slub: detach and reattach partial slabs in batch mm/slub: introduce helper to decrement partial slab count and clear flag mm/slub.c | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) base-commit: 6b41dc6749232c14f3e069f8115084a7bbeee402 -- 2.54.0