From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 135D6C04A6A for ; Thu, 10 Aug 2023 18:07:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 67E356B0071; Thu, 10 Aug 2023 14:07:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 62F726B0072; Thu, 10 Aug 2023 14:07:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4CF776B0075; Thu, 10 Aug 2023 14:07:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 3ACFF6B0071 for ; Thu, 10 Aug 2023 14:07:01 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 0870BC1106 for ; Thu, 10 Aug 2023 18:07:01 +0000 (UTC) X-FDA: 81108976242.24.9FBAD9E Received: from mail-vs1-f52.google.com (mail-vs1-f52.google.com [209.85.217.52]) by imf03.hostedemail.com (Postfix) with ESMTP id 1384820023 for ; Thu, 10 Aug 2023 18:06:58 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=BMqbAQkM; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf03.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.217.52 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691690819; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=aPggHN+KL9d2/Q3Rpvyp82p/xsp4vjRXrDXYASWyz9A=; b=eIDjsrmFyP2gPcYt9wReUrcaJ7FCD07GKXNGHMLTwpcWaQebwmWna4dPohGJVdryL2htiz HEDbXR6aQlo7nf2mQ62TeFS1NTBpmO6lKEhCN4z2DRZ+LCqUAcHZuMpxtYeUJ0HhCATQF+ Zh0L84WNiSuDPXqHWhszBsNHPGrkMHA= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=BMqbAQkM; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf03.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.217.52 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691690819; a=rsa-sha256; cv=none; b=TuWevv3oNHHnpecJAkSTeU1oCe6jyYPrcQrRpYdaYDxTMFxUK/oha4cRjcod07iANYggCx /SzKY8lpQy/RUt5ESScJs0dyXbvnD6ANICl6dtsgIdEmhWr+hEsPXTvxITM2nMRKJ+26A6 S2l2qt+IqmxywH7cRwQQNgKzPxfWVY4= Received: by mail-vs1-f52.google.com with SMTP id ada2fe7eead31-44758510539so518068137.2 for ; Thu, 10 Aug 2023 11:06:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691690818; x=1692295618; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=aPggHN+KL9d2/Q3Rpvyp82p/xsp4vjRXrDXYASWyz9A=; b=BMqbAQkMVc4rNnjupLXTyP46meAanoIfIMW4T0t0IUlx/+2MG7a0S0b5RTy3cQS5zR UtOu4AtWVCWv2ZDSnR59p03Wf2dOihR9kTtTZW1lJ4ciU8Xys+foIenrTWYVS5tabNhY v66CoAjyVnctyRya8RHvHYoZ7ygBpa7URgI5YHMq7OWfieVIx8t+5SE8cDMcnsgpWTP7 U2kek4gr6DFxjlrALNrTkwHf/MwRBCKcNbkIfvUHeYOXVOq0Iou3r7Ru54QzFYs/xJlm y+u5oz/jBXkAeYpGBeDZvx8oG94p0CPUaKILu55nO9GHlR6GikKAwmiLPVrdpGfitIby sF7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691690818; x=1692295618; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aPggHN+KL9d2/Q3Rpvyp82p/xsp4vjRXrDXYASWyz9A=; b=W+ct0lBvPnj4iGI7fIeAGaOCXmABTfPOb4XwhxOjmt9dATEof2OciIcETg675cog0k Wq+jGNjpPr87aflmsW8BOD2GmIvUbDVMUDMe9FcSP2T5+p4PRaygRNvmQMaSlLrLUHlp sU22cxIvNIg6ao0wKhglJauAikNU6LT7QJYUe35TGXRui64fmA48SWxgqL11TaSlTUgU Mb+8zS20m+nxYjdvJnbqu2bufsSnANsjwumoQ8udOIx+rCp74s6PjsBfanKv1M2F5wrk Q1cstlDFXsKWDMuWR+CybKaC2QKCZR3oyxbd51/o2PEkUBSKtWouYY2X5WYl/Ggik+VH psYA== X-Gm-Message-State: AOJu0Yx0/NmD+6Q9ZYeva/UQVCtPHTyv8phOcAsOFiJxuZ68Q90FrLCC bT/s1I+TEde5HKuTYx1t2bDJq+DTxEe/lmP/qfc= X-Google-Smtp-Source: AGHT+IHaXzdlEcSoa1ZAf6+x7x1exg0T7bfxl5sQsWyIGsDQA0mv57xzP5uDE3HaRcFNWqTYUbLDcRa6a6OZAgEPS0Q= X-Received: by 2002:a67:ff81:0:b0:447:6ef1:c4e with SMTP id v1-20020a67ff81000000b004476ef10c4emr2295262vsq.34.1691690817970; Thu, 10 Aug 2023 11:06:57 -0700 (PDT) MIME-Version: 1.0 References: <20230723190906.4082646-1-42.hyeyoo@gmail.com> <30b5d85348d84891bf61d7c57370d8b46df8e1a0.camel@linux.ibm.com> In-Reply-To: <30b5d85348d84891bf61d7c57370d8b46df8e1a0.camel@linux.ibm.com> From: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Fri, 11 Aug 2023 03:06:46 +0900 Message-ID: Subject: Re: [RFC 0/2] An attempt to improve SLUB on NUMA / under memory pressure To: jaypatel@linux.ibm.com Cc: Vlastimil Babka , Christoph Lameter , Pekka Enberg , Joonsoo Kim , David Rientjes , Andrew Morton , Roman Gushchin , Feng Tang , "Sang, Oliver" , Binder Makin , aneesh.kumar@linux.ibm.com, tsahu@linux.ibm.com, piyushs@linux.ibm.com, fengwei.yin@intel.com, ying.huang@intel.com, lkp , "oe-lkp@lists.linux.dev" , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 1384820023 X-Stat-Signature: qwhrk9xixfgrmb3q7kksrzu4d7tj3rnk X-Rspam-User: X-HE-Tag: 1691690818-537151 X-HE-Meta: U2FsdGVkX1+cGRydTZgYQA2ueqp40FS8qfcKiSpM8V6IxrgieX9FYrTbylZCdyeML2CjtxVAnRLiJihyT/+eWeYTf1vmHnOS0ic/7qvCwY+Fm5skTj6WpRwGhy8siYjJ15JYZpayZb5PFQH+4Ml0jGJLiOmAzyNZSUEvkmbbBtGdZ8h+b6l9tKHv4E6DC7EMGKCU0FUHJdo0jK6M+3IA2UKENVhZ/SBBU6udBzBZnpb+38usOtkvQ6QNL3sQtOqhqMcFzwEWlNazap9pLnDI3QqQeptgj53iWMYaRyl7kqxyx8w+6gi9ZaLvmJOGCRlehrcxQwSVrAfysvxfVc81dFFq86QFWsLYq2L/Ccb4ev6iG0kmgzV0bd8fscEXzeD+K2uNEUaZhVysvIkxhUGfERbYnDAoCac6sZEX3vLuu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dnwSV5UPOkIy0BR8j+fxYdUcfZrdZHpass8= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Aug 10, 2023 at 7:56=E2=80=AFPM Jay Patel = wrote: > > On Mon, 2023-07-24 at 04:09 +0900, Hyeonggon Yoo wrote: > > Hello folks, > > > > This series is motivated by kernel test bot report [1] on Jay's patch > > that modifies slab order. While the patch was not merged and not in > > the > > final form, I think it was a good lesson that changing slab order has > > more > > impacts on performance than we expected. > > > > While inspecting the report, I found some potential points to improve > > SLUB. [2] It's _potential_ because it shows no improvements on > > hackbench. > > but I believe more realistic workloads would benefit from this. Due > > to > > lack of resources and lack of my understanding of *realistic* > > workloads, > > I am asking you to help evaluating this together. > > Hi Hyeonggon, > I tried hackbench test on Powerpc machine with 16 cpus but > got ~32% of Regression with patch. Thank you so much for measuring this! That's very helpful. It's interesting because on an AMD machine with 2 NUMA nodes there was not much difference. Does it have more than one socket? Could you confirm if the offending patch is patch 1 or 2? If the offending one is patch 2, can you please check how large is L3 cache miss rate during hackbench? > Results as > > +-------+----+---------+------------+------------+ > | | | Normal | With Patch | | > +-------+----+---------+------------+------------+ > | Amean | 1 | 1.3700 | 2.0353 | ( -32.69%) | > | Amean | 4 | 5.1663 | 7.6563 | (- 32.52%) | > | Amean | 7 | 8.9180 | 13.3353 | ( -33.13%) | > | Amean | 12 | 15.4290 | 23.0757 | ( -33.14%) | > | Amean | 21 | 27.3333 | 40.7823 | ( -32.98%) | > | Amean | 30 | 38.7677 | 58.5300 | ( -33.76%) | > | Amean | 48 | 62.2987 | 92.9850 | ( -33.00%) | > | Amean | 64 | 82.8993 | 123.4717 | ( -32.86%) | > +-------+----+---------+------------+------------+ > > Thanks > Jay Patel > > > > It only consists of two patches. Patch #1 addresses inaccuracy in > > SLUB's heuristic, which can negatively affect workloads' performance > > when large folios are not available from buddy. > > > > Patch #2 changes SLUB's behavior when there are no slabs available on > > the > > local node's partial slab list, increasing NUMA locality when there > > are > > available memory (without reclamation) on the local node from buddy. > > > > This is early state, but I think it's a good enough to start > > discussion. > > Any feedbacks and ideas are welcome. Thank you in advance! > > > > Hyeonggon > > > > https://lore.kernel.org/linux-mm/202307172140.3b34825a-oliver.sang@inte= l.com > > [1] > > https://lore.kernel.org/linux-mm/CAB=3D+i9S6Ykp90+4N1kCE=3DhiTJTE4wzJDi= 8k5pBjjO_3sf0aeqg@mail.gmail.com > > [2] > > > > Hyeonggon Yoo (2): > > Revert "mm, slub: change percpu partial accounting from objects to > > pages" > > mm/slub: prefer NUMA locality over slight memory saving on NUMA > > machines > > > > include/linux/slub_def.h | 2 -- > > mm/slab.h | 6 ++++ > > mm/slub.c | 76 ++++++++++++++++++++++++++---------- > > ---- > > 3 files changed, 55 insertions(+), 29 deletions(-) > > >