Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1557550pxb; Wed, 2 Feb 2022 07:36:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzEHJ4EO/uuMxMk0hAtmiksm8rWGFxeQKARu4hzGkUgwDbtEZh4di3vo9ir1RAB+iyfHvMt X-Received: by 2002:a17:90b:1647:: with SMTP id il7mr8652854pjb.119.1643816162319; Wed, 02 Feb 2022 07:36:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643816162; cv=none; d=google.com; s=arc-20160816; b=CJDV9kPA9D1p9dQIbCpOeL3Kkj7blJR92anxfTuJllK3EBfcbycLxG/+hP7bqa489R 2k/O6v4ZQvm6WTWxFfI4kD05SmWAymDNQVDqpvMJ/dW0nYr8bJnhXzF111nPy9L5e4hu 1fXnImJ5TC+5B8LM0xH7n+rrVVGLjWJ8plLxPBDdJGTQD/w4W5ovwYNj2dKoSME7Cvuv 5Fe0QRb3WJghTVvTHGRQfmJsi1YZXEwPq4NdveyEAdb17CwN6Jzlvr6knop4HfyEEUvJ UbNeCA5iUkKib+7L2B99VhRzXIBdzSlFRU/yFrQ/dObDfKE9vUg249Y49ltjPTrwLPCs UmVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=BIdNhi2/wGNy2B+fCo9w5bfywyakFJRFI4mxzMFaGNI=; b=f3uhFEhJH9vT5sXOglezvSHEbICMNkPTDSCFDWwk7RaR/Pi6SqsJ4MNqNADCMrPxCR qa1PDSgbvuG2pbzg5eVZSLxsoVyCaLiSfAEmuVt1xcirRxiv2SFWJhe3taTZC93n3rv2 +iRbdGx8QhvpnATOm3KvX/BV173o6P5PtSyKX/A9dMV33ZXpwDUqY8w1oSXV6swvuMKK 0ND8h54ELqXpefQUh4tLewEpdTL9iYj2h3W8BNl3ywzCkYvXeHNrLx+jHogkd+u0coqE B+p3yJS1bDbJ7XQarrMptFvjOOnQEOmy422MlpyLqslagNUJ8HgwvlBNZsBHX2d3R5Er ggsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="gLyTG/GC"; 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=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 3si17547540pll.54.2022.02.02.07.35.49; Wed, 02 Feb 2022 07:36:02 -0800 (PST) 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=@google.com header.s=20210112 header.b="gLyTG/GC"; 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=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234946AbiBAHdY (ORCPT + 99 others); Tue, 1 Feb 2022 02:33:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234008AbiBAHdW (ORCPT ); Tue, 1 Feb 2022 02:33:22 -0500 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69195C06173B for ; Mon, 31 Jan 2022 23:33:22 -0800 (PST) Received: by mail-il1-x133.google.com with SMTP id z7so13544299ilb.6 for ; Mon, 31 Jan 2022 23:33:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BIdNhi2/wGNy2B+fCo9w5bfywyakFJRFI4mxzMFaGNI=; b=gLyTG/GCZt1AfbBHRqQhlP90Gt1rlSLXTySgMzrQ0CHApygwv6J5YrLQTKz9p5jyk7 lrrs0IG7jM2uvVhryW0VwU06UROgs9JmbHTWfs5uEzAwvSwCRbFx2c8aZrFoholr6D/w eK7nfmhw6eD6Zmhkc3wlXq7aOeYN33qCXywk5jkZuSZ9noYuFQ5VHgYudes6HpMv8S9n QfM0U+EFu3e+2upWnDOKh6HYOaetkbKigh00UWd4NKfH3UAkfOX066zGnRrx08A/c+9V PKQoBOIGaBix7qoJ1xRy9tJhVZMBqHHRrEgtkK3ORQBPuXjXPzRfuGuQnzrK4zlNZyKU X8Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BIdNhi2/wGNy2B+fCo9w5bfywyakFJRFI4mxzMFaGNI=; b=HUz4pYb+xIK7ZWSNjXLVoDDkpscCmW9QlE4yq6CaPd9+lzj+6i8Uzqt7wEe0f+Kk0y QKR/IkXI7eXqNtouTLV8uR/5qAsgYOSP2ys5Mui3D95ei0vbPhqPE0sEopbpAsZj86Ph DiPNAdFqtbsa7ONg1vagiyr8zNjwa4Ogei2CSvulCp6jPj/LY+y4c4mQrZbe+FsBFD3D IC+ajCd4RsHZi8MoI9mFs1msoACVJRWAXTfqj1DutELJzb8X7thNdwNZFlCjFdz7OjM1 RrHpbGpEsb+ZpDlDm5wlD2B81CqZ49Ba9y9n39VKO3tN68UjysqKSTCGr9Y/RbRNawK6 VUBg== X-Gm-Message-State: AOAM533I1Z9Yase4C3P99Wf1lt/VklxT3cCDvfBzieb3vr0KhV8tm+MA 54TD04GR112HJtcMKBh86udP7vdIUNZsSJ2zZtZNoQ== X-Received: by 2002:a92:c5c8:: with SMTP id s8mr4153649ilt.295.1643700801640; Mon, 31 Jan 2022 23:33:21 -0800 (PST) MIME-Version: 1.0 References: <20220126233454.3362047-1-eranian@google.com> <20220126233454.3362047-9-eranian@google.com> In-Reply-To: From: Stephane Eranian Date: Mon, 31 Jan 2022 23:33:10 -0800 Message-ID: Subject: Re: [PATCH v5 08/13] ACPI: add perf low power callback To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, kim.phillips@amd.com, acme@redhat.com, jolsa@redhat.com, songliubraving@fb.com, "Rafael J. Wysocki" , linux-acpi@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 27, 2022 at 5:06 AM Peter Zijlstra wrote: > > On Wed, Jan 26, 2022 at 03:34:49PM -0800, Stephane Eranian wrote: > > This patch add an optional callback needed by some PMU features, e.g., AMD > > "This patch" is a documented fail. > I understand this is not ideal. But the BRS feature must be disabled before going low-power. Do you have a better proposal? Been trying to find the simplest way to support this with no impact when not needed. > > BRS, to give a chance to the perf_events code to change its state before > > going to low power and after coming back. > > > > The callback is void when the PERF_NEEDS_LOPWR_CB flag is not set. > > This flag must be set in arch specific perf_event.h header whenever needed. > > When not set, there is no impact of the ACPI code. > > > > Signed-off-by: Stephane Eranian > > --- > > drivers/acpi/acpi_pad.c | 6 ++++++ > > drivers/acpi/processor_idle.c | 5 +++++ > > include/linux/perf_event.h | 6 ++++++ > > 3 files changed, 17 insertions(+) > > > > diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c > > index f45979aa2d64..a306a07a60b5 100644 > > --- a/drivers/acpi/acpi_pad.c > > +++ b/drivers/acpi/acpi_pad.c > > @@ -164,6 +164,9 @@ static int power_saving_thread(void *data) > > tsc_marked_unstable = 1; > > } > > local_irq_disable(); > > + > > + perf_lopwr_cb(true); > > + > > tick_broadcast_enable(); > > tick_broadcast_enter(); > > stop_critical_timings(); > > @@ -172,6 +175,9 @@ static int power_saving_thread(void *data) > > > > start_critical_timings(); > > tick_broadcast_exit(); > > + > > + perf_lopwr_cb(false); > > + > > local_irq_enable(); > > > > if (time_before(expire_time, jiffies)) { > > You forgot to Cc the maintainers of this stinking pile of poo. Can we > please delete it instead?