Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1130274ybt; Tue, 7 Jul 2020 08:25:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRsD3PJpGkSlNWaqvqAwJx5Fu3QnsnM4sY9iUjX+890TpMRg3lrq9OH74tT5eLFvvQWbAD X-Received: by 2002:a05:6402:202e:: with SMTP id ay14mr61804903edb.233.1594135552680; Tue, 07 Jul 2020 08:25:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594135552; cv=none; d=google.com; s=arc-20160816; b=tgYB3L9jFcYLpL+wNHHpgijNhx4cIWBPY1RYPO7eY7Xhzy98IQLjUlf/XRNnbxyyec Hq5IYJEZBEL7eJLtg6cQXkSe4mDbpeYr0mZ120S3ZP8rAsfmoT3HT9wV8jBmLhVD3U71 QFwiZMxcpLMIjtDv1dQzcYjIQ1gcBLVQQoiTbEAHxcmynrIfBB1dQFFzGgbA91ou5POm TIdunfNANoY7VXvrx+HJEjtYQDP2K4bSniythveJJRWKWoyj2L2hldtUibOdy6Ei2Apt CCw+sGh0RRpSxY7xNc77WTzwV9HbMbo0+hl9xsf6Pzd2lDOsPjpJUt9MWQeB0DZVEoz/ H9sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=3Txgzoid44mqUrO9velpnvNnz2jII+44h3kdWBj9Cc4=; b=myAQKXT3vg6bnaq0Hd7Bc+g4Taq+jyO2hPDOf9otxHtIKNyVwNz4LUWUHu512xgB26 ByPSpRXnqUeZFk8MzPhH5GsNKh1kZuwRQvW+tTn11r3PQjTQiGrStyuXK0kH8mPgqcOJ Q2ub/inqjHDDkL09TYzGpcQQWalJZSPSIuo9b2y6oPI/2u8k/9a+Fq6OqbQQO29BppDz 9gYiQaUH6U9lh070czG5WGUiVkihAi8513Aml7PBOwIvePspM17cT5Vs+enxRoalb6K0 5MWk7iEPCgguNtmLtyyH8dVwJ3S2zytR0OCpwQ+5kSsG0Rf9TFSo+9aUsOXrj25iMvaD SGoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DhKd6Ea+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g7si6493225ejb.452.2020.07.07.08.25.28; Tue, 07 Jul 2020 08:25:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DhKd6Ea+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730040AbgGGPYJ (ORCPT + 99 others); Tue, 7 Jul 2020 11:24:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729353AbgGGPYD (ORCPT ); Tue, 7 Jul 2020 11:24:03 -0400 Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89B41C061755 for ; Tue, 7 Jul 2020 08:24:03 -0700 (PDT) Received: by mail-qk1-x743.google.com with SMTP id 80so38478917qko.7 for ; Tue, 07 Jul 2020 08:24:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3Txgzoid44mqUrO9velpnvNnz2jII+44h3kdWBj9Cc4=; b=DhKd6Ea+KrKdh3mxPFxa58dg9l3ChgyupBfwMp6hpUaKFKyTmjRsMo9nBZYfcGRz+E RNnS00Snbrv9MRHdVkLMxAr3D4nQCFXxCZEdS0Au2PYimd2d9l0cyT0gij1BO+CuH2ms PLEtRAafi8TyWezJn8Rt6xLQQ0vwZUZF1T+JpURMgO1AUUp6bNUf9mTmr7YgZ6wdw1Lv EfDpvFqSCcnTJtlNskKECRHBaC8pHDhMmErXmMPxlfM99Ezh82KTZZnJR3hXZyweB8Cf CUHYjR+QOLll2iVMY6cH6H2Tibx+OYd3ql4ciOg2spcnO+c7LfUc4H5bKbiV8jFISjOZ ZI8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3Txgzoid44mqUrO9velpnvNnz2jII+44h3kdWBj9Cc4=; b=WEDpgwkN3HuD4Ksc/EXkB5z/GR+nmazGsDg1LLFI4PJNU/4N54DTa3GnMoro0JQ7OJ RgXCp5eTulN5ZqbMqy+BQpFSBcoCJ4xkvgP4ycf+dUqe/F/TNPnvnuVL+ifmdXkolkOl sh1dHDMiQMFahFzD672QcMIlmCKf0fmDF7pNUJgLTfTS/fkZq42Oc73OhJwYczZ+1FAF OiGNWOKpwoHpAQPc2139RJbZUbiFW+zhGrat2ZqNOvvudkQXo8xSImjoojNYwREoYLQ0 AK9zMsfojQ2kySuNjoyXQ4ybHPngz1zA5/xxKBpM1dgd8M8PoQ/NKPTAb50O6fQIauHO I+0A== X-Gm-Message-State: AOAM532d8jTBKarHDUaF2t3/BsHznjZBNzGdkfkoNdhcQZMzB65BURAi 96Dk18FppdhhNZAzDOXJugIpwck2qRwbPCqH718= X-Received: by 2002:a37:4289:: with SMTP id p131mr22832369qka.28.1594135442792; Tue, 07 Jul 2020 08:24:02 -0700 (PDT) MIME-Version: 1.0 References: <1593678728-128358-1-git-send-email-xlpang@linux.alibaba.com> <7374a9fd-460b-1a51-1ab4-25170337e5f2@linux.alibaba.com> In-Reply-To: <7374a9fd-460b-1a51-1ab4-25170337e5f2@linux.alibaba.com> From: Pekka Enberg Date: Tue, 7 Jul 2020 18:23:46 +0300 Message-ID: Subject: Re: [PATCH 1/2] mm/slub: Introduce two counters for the partial objects To: Xunlei Pang Cc: Christoph Lameter , Andrew Morton , Wen Yang , Yang Shi , Roman Gushchin , "linux-mm@kvack.org" , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! (Sorry for the delay, I missed your response.) On Fri, Jul 3, 2020 at 12:38 PM xunlei wrote: > > On 2020/7/2 PM 7:59, Pekka Enberg wrote: > > On Thu, Jul 2, 2020 at 11:32 AM Xunlei Pang wrote: > >> The node list_lock in count_partial() spend long time iterating > >> in case of large amount of partial page lists, which can cause > >> thunder herd effect to the list_lock contention, e.g. it cause > >> business response-time jitters when accessing "/proc/slabinfo" > >> in our production environments. > > > > Would you have any numbers to share to quantify this jitter? I have no > > We have HSF RT(High-speed Service Framework Response-Time) monitors, the > RT figures fluctuated randomly, then we deployed a tool detecting "irq > off" and "preempt off" to dump the culprit's calltrace, capturing the > list_lock cost up to 100ms with irq off issued by "ss", this also caused > network timeouts. Thanks for the follow up. This sounds like a good enough motivation for this patch, but please include it in the changelog. > > objections to this approach, but I think the original design > > deliberately made reading "/proc/slabinfo" more expensive to avoid > > atomic operations in the allocation/deallocation paths. It would be > > good to understand what is the gain of this approach before we switch > > to it. Maybe even run some slab-related benchmark (not sure if there's > > something better than hackbench these days) to see if the overhead of > > this approach shows up. > > I thought that before, but most atomic operations are serialized by the > list_lock. Another possible way is to hold list_lock in __slab_free(), > then these two counters can be changed from atomic to long. > > I also have no idea what's the standard SLUB benchmark for the > regression test, any specific suggestion? I don't know what people use these days. When I did benchmarking in the past, hackbench and netperf were known to be slab-allocation intensive macro-benchmarks. Christoph also had some SLUB micro-benchmarks, but I don't think we ever merged them into the tree. - Pekka