Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp929734rdg; Wed, 11 Oct 2023 09:15:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFbiy/4m0/bq2Ivd2Vk08W3mik3c98fBDKLTe0TqYQhtHEI4kmvotiT9wfiDukL+vL5cdaa X-Received: by 2002:a05:6870:a11b:b0:1d6:5670:fcce with SMTP id m27-20020a056870a11b00b001d65670fccemr26141534oae.51.1697040926396; Wed, 11 Oct 2023 09:15:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697040926; cv=none; d=google.com; s=arc-20160816; b=cyCv2GAc0auYuNLPZIyxxU6MlNcaQ+MV/r41aYG/20Bw1lrpjv1/ZEVmcJFA3gUGuZ vo/uYGLF0exocXsM7DzGzKnvYz8aHc47LDB+R0MrCnOLNez4k0cDmPuq5L7NIZhgtJxm rp3IiIrBX15OeionZ8oxVTmVyPgkFEJ82q9ErdUCe8UsfhKQIE7oitd1CV3nGYRPkor0 AyV4o6GR2yvybJdiZTLHjp+EHcn9SVpIdY/SYjycH1DRu/VaN8TiISfMtsfHN4zkKRwf 6uark3R3YqxOVfO0BXUfxe0glKIpw0LlMM0HqIemUiX+wXaKVwOr+E9CzdmIp5E+c0SW c1mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=MZpT+GU55RnerJK20yoYs9l4GZg5Bzb2wSf3W9XTKz8=; fh=q669Xh6e/iyt+qSnnlb/nJ3bw/Q/nAzz62QhTktQbpo=; b=eeXOS3Dz7GQqKuaM7XbZ4K7FvbJid8kCgaUqgKHTGJVzvkvfGKnItblRn42LDxr2A8 8T7hgj9v3/6Eiv86j8xbez0jzEEnH2LXXpcXpQxCVEYN719O8u92zvRyM8l6l0rZKAeI gJlnV7XtpNoDDikMPSYqYgNI4MTSX7HKdvwQmmkq0FBK4jDwXcqGfuAYu1Km99pMtv06 E3rutSaeRffNPix/8iWOtAEI9SsBYqRwJ05IvXppMro2YjFIwMkTcXWEnoahViWvV4ne klbYTGbdOGFZvSjsbT/SF4nun/JFK9ZessP8CdmP8FFlAixp/cddL5LZRA2L6m7Oihbz i0Kg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id 10-20020a630a0a000000b005a0110eb926si85875pgk.593.2023.10.11.09.15.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 09:15:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id E0A3380E8FF8; Wed, 11 Oct 2023 09:15:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232830AbjJKQO5 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 11 Oct 2023 12:14:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231495AbjJKQOz (ORCPT ); Wed, 11 Oct 2023 12:14:55 -0400 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EF63B0; Wed, 11 Oct 2023 09:14:54 -0700 (PDT) Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-2777a5e22b5so5642600a91.1; Wed, 11 Oct 2023 09:14:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697040894; x=1697645694; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h6Rqn3iDNwBIeSwR0FMBrCcNoeILKrR52Gk76BQ01wg=; b=WXC0vHJyO+VSup/29i9CdcFvYLb+JRELOswFj/ppx3r6poImLnA9zgK4i9Hxolao3u ty0r9UP/1MBtbpJQSbNfVa8rUBny95nDTBBZJlRWtS3iigYHzQ6OE7G1Y7v5p+7wEIo6 9c7myybAlGx7YWZx+WquCOgaCwma6BZlzKl3r7oLoQWJOhGxykM8AZkCJpQaB18IrPBd I7qwzn9vEHIBkbQ1SXnYxJ748xYgAFOLqfhUh/AykyB8vHyfqM29XZZBPMQ8MAEqOy2H qS2zAe1Q/694DvZwyudshz0QLiZju5hmGYF1VuW7aGZaCQLMAn3ibR2EIHE+K0PTrJ1N BGuA== X-Gm-Message-State: AOJu0Yyngg/OzAvIAr8NCBOHtfmGOcx+hWATs7Vb7dfwvlE2fzCnFu42 CF0sEXeLXppV/1+1emWc7LxQTHlU8ARk9A7txf4= X-Received: by 2002:a17:90a:f317:b0:27c:f8f4:fedb with SMTP id ca23-20020a17090af31700b0027cf8f4fedbmr3993191pjb.21.1697040893737; Wed, 11 Oct 2023 09:14:53 -0700 (PDT) MIME-Version: 1.0 References: <20230916040915.1075620-1-irogers@google.com> In-Reply-To: From: Namhyung Kim Date: Wed, 11 Oct 2023 09:14:42 -0700 Message-ID: Subject: Re: [PATCH v1] perf evlist: Avoid frequency mode for the dummy event To: Ian Rogers Cc: Mingwei Zhang , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Kan Liang , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Jihong , Stephane Eranian Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=2.6 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Wed, 11 Oct 2023 09:15:05 -0700 (PDT) X-Spam-Level: ** On Tue, Oct 3, 2023 at 4:02 PM Namhyung Kim wrote: > > On Tue, Oct 3, 2023 at 3:36 PM Ian Rogers wrote: > > With the PMU disabled, isn't there still a risk of an interrupt still > > being in flight? In other words the disable doesn't prevent a race and > > we'll catch this on the next timer call to > > perf_adjust_freq_unthr_context. I think we can also improve the code > > by just disabling a PMU once, we can take advantage of the > > perf_event_pmu_context and disable that PMU, iterate its events and > > then re-enable the PMU - i.e. no need for an enable and disable per > > event. I'll put a patch together. > > Thanks, I was thinking about that too. It's also a side effect of > the context rewrite. Maybe we could iterate pmu_ctx's active lists > and skip pmus with PERF_PMU_CAP_NO_INTERRUPT and > individual non-sampling events. Or we can add pmu_ctx->nr_freq and check it before accessing pmu MSRs. Thanks, Namhyung