Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp8027166rwn; Wed, 14 Sep 2022 07:58:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR46AARg9++gVkd3AUcSOJtciOuwmK0+GOYzRkZqx+BlcZZvQgC2AphZmaxCWj5REsF9x+Ej X-Received: by 2002:a17:907:272a:b0:77c:d7df:c9da with SMTP id d10-20020a170907272a00b0077cd7dfc9damr12129908ejl.332.1663167527059; Wed, 14 Sep 2022 07:58:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663167527; cv=none; d=google.com; s=arc-20160816; b=aXkZg7xZ+ucxZYPuDgYuG1zJBg1b6LB03qqSE6YkgXIEOix6PmbZYHvOzYH/I/jf8m oX5DPMH88BMJ5Bu8Yrt3UTsjR46bbbJQhMlBxBdkf0ly7avp7w2zwm/CM+jdngEcqM8M mZtfJP+A36hBo5wqaOlgYZWQA/MhPaZHl6rYdRVCCBzwqCdNFgHE5K2ttcj3t/86nOWX 9wEvh8LT6GdixkkgggREztQiHIpvjyqIsvlGToby4Aroqn7kz/2di680pD2OUwelRsiS KH06vsdg3TaHucpbeIdmf7PmvVOVluqpZvdcJVoMW7wwfmqbLE14S+vC5loYU1Nep++V lPZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=hdSD8tJb664Fr8pl0NO+kf8L2z4TDzTohEl0wY+gzYc=; b=W97SN+eZX6L1kO2PadpN/uyiHosuJnrAV64wTnNDIrBh+cuLdtmFLThN1yR09bjM72 K7EWTX0FTItud4f1b56ezlZFetVTrS0LHrxn2F0gdIezRMbmz+JkEWRbiDmJ/OamlJtq LmsdW6z/EcJNlADF1LtlgSy6LTrAAw1EzEt7r0ZoWFEQiGukjqnZ+jq3I0M3r8JyWD3S HarC1HwpHfZcZrShSbBz0LvESz7XWuctl/sLzaXkNWmfvBHUBNHrv7JRcv+/DAOMdslp JaV7iNnzy0J6y1lLIRR/KivcP1w7oY3LssuxXj3Q7wjS0jikb64ynns4GqMULd2XiUQv oHfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b=W15M6v32; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fastly.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sh33-20020a1709076ea100b0077537c14200si13804789ejc.205.2022.09.14.07.58.21; Wed, 14 Sep 2022 07:58:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b=W15M6v32; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fastly.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230057AbiINO01 (ORCPT + 99 others); Wed, 14 Sep 2022 10:26:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229849AbiINO0F (ORCPT ); Wed, 14 Sep 2022 10:26:05 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7C2325C59 for ; Wed, 14 Sep 2022 07:25:28 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id u132so15085962pfc.6 for ; Wed, 14 Sep 2022 07:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date; bh=hdSD8tJb664Fr8pl0NO+kf8L2z4TDzTohEl0wY+gzYc=; b=W15M6v323Iel/iK6eFB5fJmsZj9UgNfzHvij6SGJNxbTuWnqIovbfOPRNq3jRPbdSH 0oyEjnHDaHKU56TfRiVWrQ8OK4AkxXGpiH4n2ZY07EN7lKx2rh0fiNP/u3aArQnoqFKx /juLxkWKnaA99ijCsePo3+Yh3Qbi1J71jaTZA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date; bh=hdSD8tJb664Fr8pl0NO+kf8L2z4TDzTohEl0wY+gzYc=; b=J/+plrMpLSU1QvCX32ujbWG440HbcpTqEoYfTEp7HU7A/7gO4hmFIdsSZTtcX8MG1z xYtF+eEUSNdh3MsqzAH/O49P3HVKHlkfUCCU7nA5tLaSSdGv/kUOESgFVPJL6kz5ciug lru9PGjwg0mZbhFP8H791dsYu1Gyyw2R3SSadwG9L1clPuVrE9gbQrhryDA3ue0qsUCZ eqc9jTOPX9eSJoh6JkJvtZ0JhGU4Dr4goynokHMk0NFksWm4RSjzXUUreMVLh5V0b9db P80bnc7NLXL8bXdthhVzsgXKBJ+bok4ZV/OPOG+lRvfD9vt33ktgt+WHSDqCY56FKrsh 7cAw== X-Gm-Message-State: ACgBeo2n1VPmkUtIQBUS85ZSFucGx/dHAuA6vgPMvOuM/qUhjOwoTWu3 cywXsYO7LEJMFpyOUpHRW9LTrQ== X-Received: by 2002:aa7:97b4:0:b0:547:f861:1fc3 with SMTP id d20-20020aa797b4000000b00547f8611fc3mr2784496pfq.42.1663165527599; Wed, 14 Sep 2022 07:25:27 -0700 (PDT) Received: from fastly.com (c-73-223-190-181.hsd1.ca.comcast.net. [73.223.190.181]) by smtp.gmail.com with ESMTPSA id e19-20020a656bd3000000b004351358f056sm9642274pgw.85.2022.09.14.07.25.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Sep 2022 07:25:27 -0700 (PDT) Date: Wed, 14 Sep 2022 07:25:24 -0700 From: Joe Damato To: Dave Hansen Cc: x86@kernel.org, linux-mm@kvack.org, Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [RFC 1/1] mm: Add per-task struct tlb counters Message-ID: <20220914142523.GC4422@fastly.com> References: <1663120270-2673-1-git-send-email-jdamato@fastly.com> <1663120270-2673-2-git-send-email-jdamato@fastly.com> <20220914141507.GA4422@fastly.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220914141507.GA4422@fastly.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 14, 2022 at 07:15:07AM -0700, Joe Damato wrote: > On Wed, Sep 14, 2022 at 12:40:55AM -0700, Dave Hansen wrote: > > On 9/13/22 18:51, Joe Damato wrote: > > > TLB shootdowns are tracked globally, but on a busy system it can be > > > difficult to disambiguate the source of TLB shootdowns. > > > > > > Add two counter fields: > > > - nrtlbflush: number of tlb flush events received > > > - ngtlbflush: number of tlb flush events generated > > > > > > Expose those fields in /proc/[pid]/stat so that they can be analyzed > > > alongside similar metrics (e.g. min_flt and maj_flt). > > > > On x86 at least, we already have two other ways to count flushes. You > > even quoted them with your patch: > > > > > count_vm_tlb_event(NR_TLB_REMOTE_FLUSH); > > > + current->ngtlbflush++; > > > if (info->end == TLB_FLUSH_ALL) > > > trace_tlb_flush(TLB_REMOTE_SEND_IPI, TLB_FLUSH_ALL); > > > > Granted, the count_vm_tlb...() one is debugging only. But, did you try > > to use those other mechanisms? For instance, could you patch > > count_vm_tlb_event()? > > I tried to address this in my cover letter[1]... Err, I forgot the [1]: https://lore.kernel.org/linux-mm/1663120270-2673-1-git-send-email-jdamato@fastly.com/