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 X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C23D3C433E0 for ; Fri, 7 Aug 2020 17:28:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 77B6E221E5 for ; Fri, 7 Aug 2020 17:28:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lvNI74fM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 77B6E221E5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E48F76B000C; Fri, 7 Aug 2020 13:28:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DF9E66B000D; Fri, 7 Aug 2020 13:28:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D0FE56B0027; Fri, 7 Aug 2020 13:28:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0154.hostedemail.com [216.40.44.154]) by kanga.kvack.org (Postfix) with ESMTP id BBDAD6B000C for ; Fri, 7 Aug 2020 13:28:47 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 6D5A5181AC553 for ; Fri, 7 Aug 2020 17:28:47 +0000 (UTC) X-FDA: 77124457494.24.cows59_44127a126fc2 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 3D0B41A4A5 for ; Fri, 7 Aug 2020 17:28:47 +0000 (UTC) X-HE-Tag: cows59_44127a126fc2 X-Filterd-Recvd-Size: 4553 Received: from mail-ot1-f67.google.com (mail-ot1-f67.google.com [209.85.210.67]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Fri, 7 Aug 2020 17:28:46 +0000 (UTC) Received: by mail-ot1-f67.google.com with SMTP id k12so2208814otr.1 for ; Fri, 07 Aug 2020 10:28:46 -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=pcPljqLlsSaByEgdnjwhb5jRujI3GPfRCMC3xF366sQ=; b=lvNI74fMbQTw+8M58BgwRChxDSXnuBaigD7ycw6XMt5W1E6aOHaOc1QKCKumH60SwS cSpZz92jRmTtH8YU80yP119KbtH9tkQPB4gsNsdTYot8Q5jFfuM5B4BZ3Qk1IA+KLQOv kf5UMHXHl8BxAggENKovoflSBpi8OYVS7LW2YXeLEBTzrUdEvM6BYJRWHLmyNz9r50c0 yOIXS2Sdl6To0nDBGs5rdC83Ui3dQtr12tLqKXFn/Qfg1zK+mc++zTtg2gJnEo76nKT3 /TLWkZVePhsgkD5gJjrLYh9ehJd2tbhP3EWS+2dWSXVd89xlEROPK64FDJau2tiA1HjP Srdg== 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=pcPljqLlsSaByEgdnjwhb5jRujI3GPfRCMC3xF366sQ=; b=og2poHClhn1aEkifXvFCRA2I9/hoCRj3ZjQqzag+JOs17jLdkRrFUNPylNAaV6U8C8 FrGmOMlbYT+EUKVDmVhnMClT1M+18gjUWX5tJWyNXGQC5YMmmGtIVPmNLTwmGBKRtokt 8lFx4zk+36OXvR9RN47AvzjPTufxhX6Ogjqtm1tGClMOPodd/5dz4vYthrBNSijydNWE nIpU3Aw73vWzEAeACVj39sRnFLgdwTODf6NNfsJWvUbl3o5Jhw02YU0n5obwUBpHlRRP wR2bE5A6DHg50YjEqVlLEbaps4+uAkoJICJxOeIIvvXtpPbPNLYhdJD6cXTz+lxLR5Z3 LfXg== X-Gm-Message-State: AOAM5333qr8i0/LurKlNHI8bjERmf3NpiVmyiEkZ1uElR0/J7a8TZqok +23n5ftmdBoGxmfYFEMqPBrxrl7mGI/Xk6QKhg4= X-Google-Smtp-Source: ABdhPJyhRNkJ7IwFovJWB4fr/hjEdbgkIhGpcwsemu7+FnTI1YphMimo6fZOrfenJDcYeti2RNOLqc2dB+aC9WrUFY8= X-Received: by 2002:a9d:3d77:: with SMTP id a110mr12761833otc.11.1596821326081; Fri, 07 Aug 2020 10:28:46 -0700 (PDT) MIME-Version: 1.0 References: <1593678728-128358-1-git-send-email-xlpang@linux.alibaba.com> In-Reply-To: From: Pekka Enberg Date: Fri, 7 Aug 2020 20:28:27 +0300 Message-ID: Subject: Re: [PATCH 1/2] mm/slub: Introduce two counters for the partial objects To: Christopher Lameter Cc: Vlastimil Babka , Xunlei Pang , Andrew Morton , Wen Yang , Yang Shi , Roman Gushchin , "linux-mm@kvack.org" , LKML , Konstantin Khlebnikov , David Rientjes Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 3D0B41A4A5 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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: Hi Christopher, On Fri, 7 Aug 2020, Pekka Enberg wrote: > > I think we can just default to the counters. After all, if I > > understood correctly, we're talking about up to 100 ms time period > > with IRQs disabled when count_partial() is called. As this is > > triggerable from user space, that's a performance bug whatever way you > > look at it. On Fri, Aug 7, 2020 at 4:02 PM Christopher Lameter wrote: > Well yes under extreme conditions and this is only happening for sysfs > counter retrieval. You will likely get some stall even in less extreme conditions, and in any case, the kernel should not allow user space to trigger such a stall. On Fri, Aug 7, 2020 at 4:02 PM Christopher Lameter wrote: > There could be other solutions to this. This solution here is penalizing > evertu hotpath slab allocation for the sake of relatively infrequently > used counter monitoring. There the possibility of not traversing the list > ande simply estimating the value based on the number of slab pages > allocated on that node. Why do you consider this to be a fast path? This is all partial list accounting when we allocate/deallocate a slab, no? Just like ___slab_alloc() says, I assumed this to be the slow path... What am I missing? No objections to alternative fixes, of course, but wrapping the counters under CONFIG_DEBUG seems like just hiding the actual issue... - Pekka