Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2413709pxa; Fri, 7 Aug 2020 10:29:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVikeCdK265CL+KBCKvA4VMVcwyNW3c/0fb5Upx7SgHag7ka6dMVqGTbZdSuSLpnMvWo7C X-Received: by 2002:aa7:da0e:: with SMTP id r14mr10035462eds.236.1596821397308; Fri, 07 Aug 2020 10:29:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596821397; cv=none; d=google.com; s=arc-20160816; b=lyj2aB4f3cU0spLZRA/mu9cxoYkG07jcRlt8nRV0Jxc28/vw0aVlWHdCm96a3aV9FQ scpP1eQ8036zPEMsDTDwzsV4lP7o5iFqNlXSQ4kLPRHpwxPqYqMbF5ErBzy66/mMb1jf 0CULA5nIYXsGQVdX9lRFMz0WjfRx/MWdPgBBxNnrfrNvuvaycYPySu3MF6LjI4shDDVm gDc1rZlJP8WCA2jKklepupBIQPFKr73rSpzA/PKlow4XOoFo3PhEtIUm2+wbzCTaZj7x 20sWpBxoDxeKobe1rwDgx9Sm7b4SKl3fSfWL1QpjnEN0waPSieovVyfUerau4UpeL4Mx HcvA== 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=pcPljqLlsSaByEgdnjwhb5jRujI3GPfRCMC3xF366sQ=; b=uxpoulWdvmDWkbY5gjZtDXYTf0BmmoJsDICMv8unxvdIh1V86IPXOga94igjcN7NCm 8mRS0sZLSx10xvtGGwPoaH9DN4JbgAKkHpRsTCJhL/4ZaxU0cfFpgEj3IabAriXXy9ws Uo/nh5A+dDsz4bmO+2Y8JNhrwAY02Q0LP/MgTseIGKJSCwLLnoBx1R36Jh1NUmI/vnqx X+TMr1eC9wRu7ANqtRCR5yO+2t3rmIXRQd3f2ItY5ACrTGIGxMSERVdZfH8saBzQgKZH p+ZbOoUMDo7jDnvZhKMHd22c1bBxPq4X0nDM3e/6Qz8GgsZ3q2IA9Mjb5PDa/rTqqDtU yLCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lvNI74fM; 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 rl3si5972746ejb.643.2020.08.07.10.29.33; Fri, 07 Aug 2020 10:29:57 -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=lvNI74fM; 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 S1726067AbgHGR2s (ORCPT + 99 others); Fri, 7 Aug 2020 13:28:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726015AbgHGR2q (ORCPT ); Fri, 7 Aug 2020 13:28:46 -0400 Received: from mail-ot1-x344.google.com (mail-ot1-x344.google.com [IPv6:2607:f8b0:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD4F0C061756 for ; Fri, 7 Aug 2020 10:28:46 -0700 (PDT) Received: by mail-ot1-x344.google.com with SMTP id z18so2176693otk.6 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=aNOVCkjhxBAReVN3G5KJ3bySxCyYQQKhW8DFfAjjLm2sbgDn/TWdAcYZe5bRax6ICO p90HNd43JVpndGKaDN5v4MdCvPQ0X2ix+APN3KwYIBEQ4F5qJVUwJWlf0JVkK7+dzjH4 NjSKN3oJ45guo4sRFiDj9PUU57rmDXxXRoBhYM9U6xW5Xh6AtlpktZtYIkWrun4hvvTJ h5sukmnSAZ4Votp66LxF60cc2IQOwJtP3uXgkb0vkHlUiNE6hE8QRk2+HT9t0G9r47sS VQV2zvs+QPKBn6IIJ8IT7G65jfsa1rrz/Yxm9esVD2HAMcVaj2rHzN58DMj11eQPaNWA 4wgw== X-Gm-Message-State: AOAM5338PT/pgkrzNS3Lsi22b2XA3wmlTrwSzuFe2y4mH3EE02qJ7Mr6 yygI6jQPeoQky2t4ujn2W7wdbFN2y8FIvb11/VfWt3IeK/E= 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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