From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) (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 54B3435F5E5 for ; Fri, 29 May 2026 03:51:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780026706; cv=none; b=Sc//+rA3seYDoabmoPjrFWsjQ7n1dfcn/JW1VPhaRN0D8I3GpkKyoHUorLqkg+xotuv02WgZryFqmTiXIf3rYgbPoCRHCMShcpAzPWs9g52i/zYPZCQSuSRRvkj+LwrUnSf3QBZjZZiT70uSJfLdR4dEKXBeR823s+DSleEha0I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780026706; c=relaxed/simple; bh=j3rvySjkR7ZET63LZon7GIrLS9yJfgjSFaCTwAlNhkY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=N7Jgn70p7x2hq6zSE+M1wZHCPapJh8B/SWZbBisZTplLmxUqSxoasBkqtrh+5HVVbKN7zvJlSaHgJo5Jtyskyy+WJvLBO25u/YnHQ36OJqg8flXYFH92xkm97SUJm4vZpraj+EwxE3hYku7kBO84frRTDoZH/pv7THlkn7QrKXw= 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=KKudH0N4; arc=none smtp.client-ip=91.218.175.182 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="KKudH0N4" 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=1780026701; 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=Om+9rENfxhYxcbjRM0HRMEqhY91mSkBoqb3WHHhFk5M=; b=KKudH0N4UN1XACB2rtOpVcH6cVASD1OJbFI26I+ETm3F157R6v50OPVUSi33rSv7pm+n6K bXEqsfRMPUAfxa0NMYMrG/utt8pG7TafNwSZ3+U6OhA86H7Sz8wg3Bkj58OOidR6VP2bYm 0Rwio8d/fyiRnY8ZM4ZDb/obxb9jHY4= 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 v3 0/2] mm/slub: batch partial slab list operations Date: Fri, 29 May 2026 11:50:50 +0800 Message-ID: <20260529035120.81304-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 is a cleanup patch that wraps duplicated code into helper functions. Patch 2 reduces the number of list operations by processing slabs in batches, thereby minimizing the time spent inside the critical section. Changes in v3: - Reorder the two patches for better logical flow. (Thanks Vlastimil) - Introduce set_node_partial_state for symmetry. (Thanks Vlastimil) Changes in v2: - Patch 1 applies the same optimization to __refill_objects_node. (Thanks Harry and Vlastimil) - Patch 2 introduces a helper to wraps duplicated code. (Thanks Harry) Hao Li (2): mm/slub: introduce helpers for node partial slab state mm/slub: detach and reattach partial slabs in batch mm/slub.c | 51 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 14 deletions(-) base-commit: 6b41dc6749232c14f3e069f8115084a7bbeee402 -- 2.54.0