Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp724200rdf; Tue, 21 Nov 2023 15:02:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYhFEUNpWz9BwR1FgFwhkY2F/B9w69HQDYVcQ9eW+qYnzwDk5UM4BAEKlvgpk9zfT4xkt6 X-Received: by 2002:a05:6870:9b0c:b0:1f5:b5ca:435e with SMTP id hq12-20020a0568709b0c00b001f5b5ca435emr777895oab.52.1700607742997; Tue, 21 Nov 2023 15:02:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700607742; cv=none; d=google.com; s=arc-20160816; b=jrw7b8s4okdkvuv66BnocqP5KVWa4yGvm47x75UsNLM+xGdo9ptr++frtYSQD2pkql fDaSRdLNKa2iDi0Tq+SPqyhZr+gkMKJb1sSa1FsCX5ta6cYCfZ6CDRzWWrMn8KkSjkqK D4V+ZTI3F4wJ2lhKW90wjvO8Ln/aMwSypjMr1IkQPtSGmHA3LlgHlU9fAuxu3D12OK9t Ay73GxPNFqZjpt278198CxZ7LSq/RSP7V0w7//mz7tbWWAgERBD0PJS8byMcoQbiIuYQ Ekve+IXxaNMFKtHe0NUaqxaF0aRbAALwVqb8ZQRJhCGOJ7MSEZExoJc4+j2G2VYKUnJI Sm9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=q274GXv74+m8N7WixAqPtztHuSezd+UPyNtaPdOC9ws=; fh=w4sSbwhi9OhsJYmuQhao+wdn3Ci/obuJxdZtlUJ5EdI=; b=QsNapdL3SVyPtdGm0qehJgNpYrhPZnRnam7kSC2vMqIG5TLcZWGb3H79K60sbBDOEZ k79s0LI2CXfIksxjW1enFSZQUDhv+eCeELv0i1bh3JvavDo2+tnFZfrTwxoqpjjdAIk9 0su20LdCUBM6I6xhmXrQaHVzDhbTJBk9ygBjTrCpdP+4Zpj86PU5zruIHjmQGdaZoga9 4Yo/Vr/J0bkxoz4xb76UO1oPxxmzyLV0fH3h3mN45Dxf09U3LCnx0BExb8ZZqwe87pM2 2pPFMtaQR0vfzS3VLHxugCFyrC0fJOL6QcHtl8fxXZ+tjkdgitk+rRX2zhgHSCfzu+Nm ra3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=bYvJCVox; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id f14-20020a05680814ce00b003ae3e1b5191si4157594oiw.20.2023.11.21.15.02.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 15:02:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=bYvJCVox; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 92589802988C; Tue, 21 Nov 2023 15:02:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234727AbjKUXCD (ORCPT + 99 others); Tue, 21 Nov 2023 18:02:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234775AbjKUXCC (ORCPT ); Tue, 21 Nov 2023 18:02:02 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B37F7DD for ; Tue, 21 Nov 2023 15:01:58 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-28396793876so3993721a91.3 for ; Tue, 21 Nov 2023 15:01:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1700607718; x=1701212518; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=q274GXv74+m8N7WixAqPtztHuSezd+UPyNtaPdOC9ws=; b=bYvJCVoxA0rNkHGpfPGECOPagqBCKIl/2G6uLxM4zE+g99RdmXdzjSmfO9z8f73Nyk 4jHwIr7oWUWPpir+xc1NXaNz1COCzDYL+21RdNMxJQmdJ/takOyPfCvN0oEsWQ81x7s9 g4WWFduBxgndAkS8f8TYh3+eRhCNT7wG77IGLpKJlhVoztA4YFOdjSVrvCcLXhVW8GN/ tm5To+QGGWvXGjjmZJH0z617qwpqalHb/fv8tfM9JiJUdP1J93zHfLNbSE99x8W2pzIX 9RxogWNBu6M311iJEv/u7bPqKPhkmLUzFkDrebThA0rKvxlyal2l3FIVVJPg2hpheqvg DuVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700607718; x=1701212518; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=q274GXv74+m8N7WixAqPtztHuSezd+UPyNtaPdOC9ws=; b=Kv+0AP6IhWzvc2wHdQF+OpDQFFbBBxH1yVua5/0VEASqQhhAMp8v9StvWBIZNYRYlY uPdsGFpsBs06bm9Cb5/fbVQl4zdhLNzmM2FTN1HwXIpN1IFvMvP+BhFDQ6miAe9wV8J1 Zx3j9xkGoGwvOIaooUI2456T9uISm4qz0ODIHS0rIB7jDzb40I2fL9jF6jTTGmcxFyhW CJW/hZOcXuEyXWs4na7zxhAhXNC7cIgNgF2VC7/TVtwVcQKwxHBOzkTpyOkc1wtRetQA LF92JSAOKmdbKSme/fTGVuk/p5BKlFCoLGNaOz3g5J506BlqXZ8ZozYHRoiuQed7Y3YK FESA== X-Gm-Message-State: AOJu0YxY7GMw8i+aFneV+6TsC6f2zhMF/t+aklaMXMD0Ycltn7o/C8Hn GFAy1zae1FnHEZm9keEOGOs2KQ== X-Received: by 2002:a17:90a:eb8a:b0:280:5e8:58be with SMTP id o10-20020a17090aeb8a00b0028005e858bemr571458pjy.48.1700607717789; Tue, 21 Nov 2023 15:01:57 -0800 (PST) Received: from google.com (176.13.105.34.bc.googleusercontent.com. [34.105.13.176]) by smtp.gmail.com with ESMTPSA id h1-20020a17090acf0100b002791d5a3e29sm55269pju.6.2023.11.21.15.01.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 15:01:57 -0800 (PST) Date: Tue, 21 Nov 2023 23:01:53 +0000 From: Mingwei Zhang To: Namhyung Kim Cc: Ian Rogers , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Arnaldo Carvalho de Melo , LKML , Kan Liang Subject: Re: [PATCH 1/3] perf/core: Update perf_adjust_freq_unthr_context() Message-ID: References: <20231120221932.213710-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FSL_HELO_FAKE,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 21 Nov 2023 15:02:18 -0800 (PST) On Tue, Nov 21, 2023, Namhyung Kim wrote: Hi Namhyung, > Hi Mingwei, > > On Mon, Nov 20, 2023 at 3:24 PM Mingwei Zhang wrote: > > > > On Mon, Nov 20, 2023, Ian Rogers wrote: > > > On Mon, Nov 20, 2023 at 2:19 PM Namhyung Kim wrote: > > > > > > > > It was unnecessarily disabling and enabling PMUs for each event. It > > > > should be done at PMU level. Add pmu_ctx->nr_freq counter to check it > > > > at each PMU. As pmu context has separate active lists for pinned group > > > > and flexible group, factor out a new function to do the job. > > > > > > > > Another minor optimization is that it can skip PMUs w/ CAP_NO_INTERRUPT > > > > even if it needs to unthrottle sampling events. > > > > > > > > Signed-off-by: Namhyung Kim > > > > > > Series: > > > Reviewed-by: Ian Rogers > > > > > > Thanks, > > > Ian > > > > > > > Can we have "Cc: stable@vger.kernel.org" for the whole series? This > > series should have a great performance improvement for all VMs in which > > perf sampling events without specifying period. > > I was not sure if it's ok to have this performance fix in the stable series. > Critical performance bug fix is ok to be added to stable tree, as the requirements are mentioned here: https://www.kernel.org/doc/Documentation/process/stable-kernel-rules.rst In particular, this patch satisfies the 2nd sub-bullet of the forth bullet. But let me step back. Only this patch is needed with stable tag instead of the whole series. This patch impact 69 lines of code. It satisfies the rule of within 100 lines (bullet 3). I will give a try and test it today or tomorrow and make sure we satisfy bullet 2. Once it gets in, bullet 1 will be satisfied as well. Overall, the intention is to improve PMU performance in VM as early as we can since we don't control the schedule of distro kernel upgrade and we don't control when end customers upgrade their running kernel. So I presume even adding to the stable tree may take years to see the result change. But if we don't do it, it may take way longer (since it does not contain a "Fixes" tag as well). Thanks. -Mingwei > Thanks, > Namhyung