From nobody Tue Feb 10 01:59:34 2026 Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) (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 931F717991 for ; Thu, 4 Apr 2024 05:59:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.166.238 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712210359; cv=none; b=BGvvxYT42nj+u8hCdi217weALNUFqEFvjX6DYOdkcVm33heNSkXSLMhCyeVC19NIqaBte4GmssFk5tLp71Kj0WrJyzw+LB5cRPGEADdcuV7Iui3N6IXB+FOP6bVRiucPbBGimjgDTQyj8xovkhEhi4o5drkNebdhR/u4Cu3zGUI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712210359; c=relaxed/simple; bh=67kxMxBFVgKuDFsm3/aONhz4o7hUjpdqmsftgI1S7cg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=deHDGSGyzeYRZc19DclWVzWwWzxzE/8y56nthJxsr4t4tWhevt2Nfn+NEVrpmCGhQv6rcq6nYA4kgpTFmjccUH303gaBNWSY5phH2YNNVK5mvBWH0NUkmTTxZg+Y35SS9dww4H6SVtsN3BLeC6B7sgc/P0TkQmio+i4BJhIWKlM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=windriver.com; spf=pass smtp.mailfrom=windriver.com; dkim=pass (2048-bit key) header.d=windriver.com header.i=@windriver.com header.b=MOLy/vTn; arc=none smtp.client-ip=205.220.166.238 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=windriver.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=windriver.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=windriver.com header.i=@windriver.com header.b="MOLy/vTn" Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4345pCBe000392; Wed, 3 Apr 2024 22:58:40 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= PPS06212021; bh=yRxDl0C91mFi8jNJ4adnSczKE9V9/dpVGwj8Nv3DPtw=; b= MOLy/vTnWdi4Ev0bU9R08m5bbCKnjCW/Rhh4hBW8IglLPXzQ8lyEvWq8S4xiGYTf oIPAIlUJS3M+3WRa1LF/7E/8GV8X8TMUSuHDfQVqxjkGskWhMHjtxpaB/4ewgbhs oSABaRZ550NPU1nwOladPWALO6WZOj4FocC9Gnubo5lVu9BTkWgKaVElFEvyQ5Hg Y+PrHwxQ2UHeN1IVo3BteCLhEYRkQ2KB/QvdB0mq8szhlDRfg3E5vHwlq73v6e9j CqAxOBsm+1NrS4D28j/UniuW8LEdWcoK1ivxROekhhiNFug3WJRMzYhMfSDKdWv4 Q9sSmdstNEeRiMTL7iE80Q== Received: from ala-exchng01.corp.ad.wrs.com (ala-exchng01.wrs.com [147.11.82.252]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3x9eqeg9gs-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 03 Apr 2024 22:58:40 -0700 (PDT) Received: from ALA-EXCHNG02.corp.ad.wrs.com (147.11.82.254) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.37; Wed, 3 Apr 2024 22:58:39 -0700 Received: from pek-lpd-ccm5.wrs.com (147.11.1.11) by ALA-EXCHNG02.corp.ad.wrs.com (147.11.82.254) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.37 via Frontend Transport; Wed, 3 Apr 2024 22:58:36 -0700 From: To: , , , , , , , <42.hyeyoo@gmail.com> CC: , , Subject: [PATCH v2 1/3] mm/slub: remove the check of !kmem_cache_has_cpu_partial() Date: Thu, 4 Apr 2024 13:58:24 +0800 Message-ID: <20240404055826.1469415-2-xiongwei.song@windriver.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240404055826.1469415-1-xiongwei.song@windriver.com> References: <20240404055826.1469415-1-xiongwei.song@windriver.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: NjyypOTjHp702Ozz0uySYQA1ADPV3hsD X-Proofpoint-GUID: NjyypOTjHp702Ozz0uySYQA1ADPV3hsD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-04_02,2024-04-03_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 phishscore=0 spamscore=0 mlxlogscore=999 clxscore=1015 suspectscore=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 mlxscore=0 adultscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404040037 Content-Type: text/plain; charset="utf-8" From: Xiongwei Song The check of !kmem_cache_has_cpu_partial(s) with CONFIG_SLUB_CPU_PARTIAL enabled here is always false. We have already checked kmem_cache_debug() earlier and if it was true, then we either continued or broke from the loop so we can't reach this code in that case and don't need to check kmem_cache_debug() as part of kmem_cache_has_cpu_partial() again. Here we can remove it. Signed-off-by: Xiongwei Song --- mm/slub.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 1bb2a93cf7b6..059922044a4f 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2610,8 +2610,7 @@ static struct slab *get_partial_node(struct kmem_cach= e *s, partial_slabs++; } #ifdef CONFIG_SLUB_CPU_PARTIAL - if (!kmem_cache_has_cpu_partial(s) - || partial_slabs > s->cpu_partial_slabs / 2) + if (partial_slabs > s->cpu_partial_slabs / 2) break; #else break; --=20 2.34.1 From nobody Tue Feb 10 01:59:34 2026 Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) (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 C5ABC40BE6 for ; Thu, 4 Apr 2024 06:00:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.166.238 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712210402; cv=none; b=H3gD3Wzq0pKp6PNOAf8+S3cGN5gSjgjuJTeZbZ4X+TnFkB77PfbDzurGAgVlIXuZ9FbHbhA/9Gg/hHONZs2CObn+yatwRjZm/IOna8ZBZV2jxN8cwuy8wXp3jeO6I7ot/J2aL0FFXOZKE+YbB/kTbIjbi0p60n8XK0qUvsBQS90= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712210402; c=relaxed/simple; bh=z9cHZ/qfKgBMB6NKxBmf35xFA5LdAxKDMWY91reJmhg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mGoHr7NWwCfpgs3aOxs3vCtKVxvdqB20F11qFJXv1DrrxFC3u2L3BbnRP1czGUfHlaIcp+/uk5zqIBF0qm2wqv95zYgS2V8QDs6vqiVlHP1HGPWZTtMScEU/dsCdThpBXGRz8gw1F/dIpNEx7ulZBEAXzmyWfIgG+s/kVL2UCyE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=windriver.com; spf=pass smtp.mailfrom=windriver.com; dkim=pass (2048-bit key) header.d=windriver.com header.i=@windriver.com header.b=e/O+MMKQ; arc=none smtp.client-ip=205.220.166.238 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=windriver.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=windriver.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=windriver.com header.i=@windriver.com header.b="e/O+MMKQ" Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4345pec2024549; Wed, 3 Apr 2024 22:58:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= PPS06212021; bh=avXvV/YgaEweVfIX+OYFhfHn6ohAwRQj390NbocEzvk=; b= e/O+MMKQ4iBkNhp30A38D+LdknJ4gBqYNPz8sDUWqB6Rt7Ukq5HH3fmmTXaeqOSW OQB+sARQ+ugqCvyKn17GpHsqlkSB269TWH0w8LqUddYYZUPMDZGrD3EwcRpe0zHG c0td1NXEPL/Tl2na7+mxm6qLC3a6tWz0INVuIzJHralP2JkvQvbpMnJBmGFaIGiA zG6mArk8PZpPMQOSMGcg/lpSvcENYbwOBr+hPFiQTTgQ7R+yxmsB9oWhB0+rLRru FXmHScMmWf50Bvk2IG/6ogQcxccQdW8jH1U+1QI+Rg5crZQzXxail6DXDj4Qop9x 7rU8L2+vFNNKcfCBp4pJVA== Received: from ala-exchng02.corp.ad.wrs.com (ala-exchng02.wrs.com [147.11.82.254]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3x9en989ng-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 03 Apr 2024 22:58:43 -0700 (PDT) Received: from ALA-EXCHNG02.corp.ad.wrs.com (147.11.82.254) by ALA-EXCHNG02.corp.ad.wrs.com (147.11.82.254) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.37; Wed, 3 Apr 2024 22:58:43 -0700 Received: from pek-lpd-ccm5.wrs.com (147.11.1.11) by ALA-EXCHNG02.corp.ad.wrs.com (147.11.82.254) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.37 via Frontend Transport; Wed, 3 Apr 2024 22:58:40 -0700 From: To: , , , , , , , <42.hyeyoo@gmail.com> CC: , , Subject: [PATCH v2 2/3] mm/slub: add slub_get_cpu_partial() helper Date: Thu, 4 Apr 2024 13:58:25 +0800 Message-ID: <20240404055826.1469415-3-xiongwei.song@windriver.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240404055826.1469415-1-xiongwei.song@windriver.com> References: <20240404055826.1469415-1-xiongwei.song@windriver.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: pGdg9kS9SmD2FeZs-34uq8T6B03R4GKO X-Proofpoint-ORIG-GUID: pGdg9kS9SmD2FeZs-34uq8T6B03R4GKO X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-04_02,2024-04-03_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 impostorscore=0 suspectscore=0 adultscore=0 malwarescore=0 mlxlogscore=929 lowpriorityscore=0 spamscore=0 phishscore=0 clxscore=1015 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404040037 Content-Type: text/plain; charset="utf-8" From: Xiongwei Song Add slub_get_cpu_partial() and dummy function to help improve get_partial_node(). It can help remove #ifdef of CONFIG_SLUB_CPU_PARTIAL and improve filling cpu partial logic. Signed-off-by: Xiongwei Song --- mm/slub.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mm/slub.c b/mm/slub.c index 059922044a4f..590cc953895d 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -604,11 +604,21 @@ static void slub_set_cpu_partial(struct kmem_cache *s= , unsigned int nr_objects) nr_slabs =3D DIV_ROUND_UP(nr_objects * 2, oo_objects(s->oo)); s->cpu_partial_slabs =3D nr_slabs; } + +static inline unsigned int slub_get_cpu_partial(struct kmem_cache *s) +{ + return s->cpu_partial_slabs; +} #else static inline void slub_set_cpu_partial(struct kmem_cache *s, unsigned int nr_objects) { } + +static inline unsigned int slub_get_cpu_partial(struct kmem_cache *s) +{ + return 0; +} #endif /* CONFIG_SLUB_CPU_PARTIAL */ =20 /* --=20 2.34.1 From nobody Tue Feb 10 01:59:34 2026 Received: from mx0b-0064b401.pphosted.com (mx0b-0064b401.pphosted.com [205.220.178.238]) (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 E28C048788 for ; Thu, 4 Apr 2024 05:59:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.178.238 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712210371; cv=none; b=btFl4ZP+uNAxFcp9DatcPjykY9myqMmu/0VHtEf6XdfZwCLyhO+4F1Lm4t7rMcsS/WwylrkeJ8w09MtfoBOuMeMc3rtUWOVaFhOTqd3YO59NQwQWcGbreLz5epTnE0zdPllWnbRC3KaYYcs5vMrKgP/Y6dudmUiY1ry1eb2jMvQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712210371; c=relaxed/simple; bh=NQ+BfK4nleuI2Do9g/iZmGss/EFlpHre9fcaunDLuek=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Q2ozUxYD3lI26BW/2C1wRqzK8sn4bL47C3Hh0H51wSWNG2pgF2encQuf89dOLLMjqNe2EoNZj1z2GsIvlFIw7flciM64zOawnT3jTu+AkEsaAoVVhFiPCocpufJzgFlfqtmXiWw5l4nsDcNMP4XS/feKShXLyWS+zZFPi0dIoGU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=windriver.com; spf=pass smtp.mailfrom=windriver.com; dkim=pass (2048-bit key) header.d=windriver.com header.i=@windriver.com header.b=DK16AvjF; arc=none smtp.client-ip=205.220.178.238 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=windriver.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=windriver.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=windriver.com header.i=@windriver.com header.b="DK16AvjF" Received: from pps.filterd (m0250811.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4344vEJ5006418; Thu, 4 Apr 2024 05:58:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= PPS06212021; bh=/rH/4dIIFl0tP0DZ8KBYwKtVJ20Qari0JGnwd0w4aJA=; b= DK16AvjFscZbHJfWB3SOOHjr7Yax33Mv64mMZqqHthRLfqi02cOn086ofAxfuDAv BHRa9/64buMKJWrGm1zJoZHegHBh7Mq7cuSORoXIwpHBfBKJgpGyrsrVrKsl3JKb u6DQOric5Bi+s73hvdxWAr/eVix587befoksPj11jEukxowZ54Oqde+aOfeZDWTu dmVdHSKZclKirlZxPa2s9gag/m+3BxTpmmMWFPEExYtMjFjDwepl1u07wX74x7lF ZV23UNuae87o013Qfgjap/9jqcytoj7dsVImzdcmXNxVa6uowkPDijafP/lr8cRs tlur3KKB9SIAo6CruK5ybQ== Received: from ala-exchng01.corp.ad.wrs.com (ala-exchng01.wrs.com [147.11.82.252]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3x9epk89h3-13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 04 Apr 2024 05:58:55 +0000 (GMT) Received: from ALA-EXCHNG02.corp.ad.wrs.com (147.11.82.254) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.37; Wed, 3 Apr 2024 22:58:46 -0700 Received: from pek-lpd-ccm5.wrs.com (147.11.1.11) by ALA-EXCHNG02.corp.ad.wrs.com (147.11.82.254) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.37 via Frontend Transport; Wed, 3 Apr 2024 22:58:43 -0700 From: To: , , , , , , , <42.hyeyoo@gmail.com> CC: , , Subject: [PATCH v2 3/3] mm/slub: simplify get_partial_node() Date: Thu, 4 Apr 2024 13:58:26 +0800 Message-ID: <20240404055826.1469415-4-xiongwei.song@windriver.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240404055826.1469415-1-xiongwei.song@windriver.com> References: <20240404055826.1469415-1-xiongwei.song@windriver.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: iScp0TsPV-TMjLRsoPJ93q7ds1TOZWuW X-Proofpoint-ORIG-GUID: iScp0TsPV-TMjLRsoPJ93q7ds1TOZWuW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-04_02,2024-04-03_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 adultscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 phishscore=0 mlxscore=0 clxscore=1015 spamscore=0 suspectscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404040036 Content-Type: text/plain; charset="utf-8" From: Xiongwei Song The break conditions for filling cpu partial can be more readable and simple. If slub_get_cpu_partial() returns 0, we can confirm that we don't need to fill cpu partial, then we should break from the loop. On the other hand, we also should break from the loop if we have added enough cpu partial slabs. Meanwhile, the logic above gets rid of the #ifdef and also fixes a weird corner case that if we set cpu_partial_slabs to 0 from sysfs, we still allocate at least one here. Signed-off-by: Xiongwei Song --- The measurement below is to compare the performance effects when checking if we need to break from the filling cpu partial loop with the following either-or condition: Condition 1: When the count of added cpu slabs is greater than cpu_partial_slabs/2: (partial_slabs > slub_get_cpu_partial(s) / 2) Condition 2: When the count of added cpu slabs is greater than or equal to cpu_partial_slabs/2: (partial_slabs >=3D slub_get_cpu_partial(s) / 2) The change of breaking condition can effect how many cpu partial slabs would be put on the cpu partial list. Run the test with a "Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz" cpu with 16 cores. The OS is Ubuntu 22.04. hackbench-process-pipes 6.9-rc2(with ">") 6.9.0-rc2(with ">=3D") Amean 1 0.0373 ( 0.00%) 0.0356 * 4.60%* Amean 4 0.0984 ( 0.00%) 0.1014 * -3.05%* Amean 7 0.1803 ( 0.00%) 0.1851 * -2.69%* Amean 12 0.2947 ( 0.00%) 0.3141 * -6.59%* Amean 21 0.4577 ( 0.00%) 0.4927 * -7.65%* Amean 30 0.6326 ( 0.00%) 0.6649 * -5.10%* Amean 48 0.9396 ( 0.00%) 0.9884 * -5.20%* Amean 64 1.2321 ( 0.00%) 1.3004 * -5.54%* hackbench-process-sockets 6.9-rc2(with ">") 6.9.0-rc2(with ">=3D") Amean 1 0.0609 ( 0.00%) 0.0623 * -2.35%* Amean 4 0.2107 ( 0.00%) 0.2140 * -1.56%* Amean 7 0.3754 ( 0.00%) 0.3966 * -5.63%* Amean 12 0.6456 ( 0.00%) 0.6734 * -4.32%* Amean 21 1.1440 ( 0.00%) 1.1769 * -2.87%* Amean 30 1.6629 ( 0.00%) 1.7031 * -2.42%* Amean 48 2.7321 ( 0.00%) 2.7897 * -2.11%* Amean 64 3.7397 ( 0.00%) 3.7640 * -0.65%* It seems there is a bit performance penalty when using ">=3D" to break up the loop. Hence, we should still use ">" here. --- mm/slub.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 590cc953895d..6beff3b1e22c 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2619,13 +2619,10 @@ static struct slab *get_partial_node(struct kmem_ca= che *s, stat(s, CPU_PARTIAL_NODE); partial_slabs++; } -#ifdef CONFIG_SLUB_CPU_PARTIAL - if (partial_slabs > s->cpu_partial_slabs / 2) - break; -#else - break; -#endif =20 + if ((slub_get_cpu_partial(s) =3D=3D 0) || + (partial_slabs > slub_get_cpu_partial(s) / 2)) + break; } spin_unlock_irqrestore(&n->list_lock, flags); return partial; --=20 2.34.1