Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1487633iog; Tue, 14 Jun 2022 07:05:26 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tLgnybmHQ81yG/d7+J0wdVwqCz5aOeLDKBGnIzRrbVlsd02vK4bzBFzZuSPGvK3id9Ku8b X-Received: by 2002:a17:902:c244:b0:168:c4c3:e80e with SMTP id 4-20020a170902c24400b00168c4c3e80emr4831352plg.18.1655215526376; Tue, 14 Jun 2022 07:05:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655215526; cv=none; d=google.com; s=arc-20160816; b=cBxCVgYvgOttGLiQMqAXMPVXDVWJ7rwwSFZg6VMMwG3eb0Ycmmx8e6gZbtOxroHM9X DfzYbgdQYfYp3IJJkhY1LKDXQvGT335VOxjkzd36lBihlaf3GfvUY/CMR0gSUNikbl2J D8ngYrrDcwEIOj8mx2LbKXbiYWaHu/VPgwokIo/XasoAhKp94PxFa9LurDsjysms7SiE fJkJ8CzozL1U6bGQJU3xFnYPZ4n7eGNoPvwJ/ICi0zRzcZj70gE46wWt3r1MyUCS/sef FnlOU4Uz1t4XOs/ghwIU8Dquspemr3FXt0mlXAAmwy+R/oM2gaT8d0UGvBELEEw0sdD1 nQbQ== 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; bh=stigbHyDfR6uhTG6foFK4YFKLsIvOO9igz8IuzTE9PU=; b=WNuKLtgI/XfpI0oxVBD3/+bG+vApLH4zL7tBVy6B31o7ktgtafpmvO+YAlMlP4ZPLq a6EmA8XV/g1thjdcVrxylmcvrSEKf171XH2zUeZEMaC3QM8MFylfzlpYlRVUMMd1drgv rBgOjG1c2tA7MfYIP1ZdASBlmIW9YAM5XwDovmyJZfj/DVfF4o9JZYjEXOn8NiyXstNP +oOjud2CUpSWNqm6o9GvDWYNKxcg96JpKDdKiUokw1v11t3Xc2RK/1nakUyc5A5JZwvb WoGZ86PNwRHqfjIzHz5NalhBaTySqrQpIXq7AX4VmwN0XWNMY+LjwhfEoeguj6rXawe6 HFaw== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bd8-20020a170902830800b0016771073a58si12815392plb.248.2022.06.14.07.04.55; Tue, 14 Jun 2022 07:05:26 -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; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234128AbiFNODP (ORCPT + 99 others); Tue, 14 Jun 2022 10:03:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231223AbiFNODM (ORCPT ); Tue, 14 Jun 2022 10:03:12 -0400 Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com [209.85.219.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFF16338BD; Tue, 14 Jun 2022 07:03:11 -0700 (PDT) Received: by mail-yb1-f174.google.com with SMTP id v81so15410697ybe.0; Tue, 14 Jun 2022 07:03:11 -0700 (PDT) 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=stigbHyDfR6uhTG6foFK4YFKLsIvOO9igz8IuzTE9PU=; b=UNtyK8oH+Bj/Q1FqUXs87b+uPRSF0dn+GLr0HrxZfcWwWy2Gxjt6fnjjpjEhhfbwvW YX21QGP4q/MSSd769grmLab/Pd+ZVkKs2UHJX9nwCPWD6AWN5rNZgwjm3Sv6ucNYq8wO nEhXFQSiuM70c02fH2tgErNj6oWNsollLrHgFudhGgI1iQyMG6YOe1v/LadJlNvZwDbn wJZswH4VdPBwwna+587+Ac72/niTmln2alXsxBKDMXp1z25eBbVZHMsSaRsFL3N+Uj/E AEZOWVoO79xXwzu4EbiioFV9apVKResA+gT0eMsllFp88h1Cx24cHTbC8BAcUgB5eTKD HHdg== X-Gm-Message-State: AJIora8YyYhN/F/gJig1vSSGpMB8TLYY8hr6kGL2u+D/OGybXOKEAPKW kuveEvnrbW7un4cpWHCgbcDtwtq+WwMiwN1228a1kU+T X-Received: by 2002:a25:6b50:0:b0:64f:4b33:664 with SMTP id o16-20020a256b50000000b0064f4b330664mr5343474ybm.153.1655215391002; Tue, 14 Jun 2022 07:03:11 -0700 (PDT) MIME-Version: 1.0 References: <20220527005345.189906-1-eiichi.tsukata@nutanix.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Tue, 14 Jun 2022 16:03:00 +0200 Message-ID: Subject: Re: [PATCH v4] cpuidle: haltpoll: Add trace points for guest_halt_poll_ns grow/shrink To: Marcelo Tosatti , Eiichi Tsukata Cc: "Rafael J. Wysocki" , Daniel Lezcano , Steven Rostedt , Ingo Molnar , Linux PM , Linux Kernel Mailing List , Joao Martins Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 Mon, May 30, 2022 at 7:37 PM Marcelo Tosatti wrote: > > On Fri, May 27, 2022 at 12:53:45AM +0000, Eiichi Tsukata wrote: > > Add trace points as are implemented in KVM host halt polling. > > This helps tune guest halt polling params. > > > > Signed-off-by: Eiichi Tsukata > > --- > > drivers/cpuidle/governors/haltpoll.c | 3 +++ > > include/trace/events/power.h | 29 ++++++++++++++++++++++++++++ > > 2 files changed, 32 insertions(+) > > > > diff --git a/drivers/cpuidle/governors/haltpoll.c b/drivers/cpuidle/governors/haltpoll.c > > index cb2a96eafc02..1dff3a52917d 100644 > > --- a/drivers/cpuidle/governors/haltpoll.c > > +++ b/drivers/cpuidle/governors/haltpoll.c > > @@ -19,6 +19,7 @@ > > #include > > #include > > #include > > +#include > > > > static unsigned int guest_halt_poll_ns __read_mostly = 200000; > > module_param(guest_halt_poll_ns, uint, 0644); > > @@ -90,6 +91,7 @@ static void adjust_poll_limit(struct cpuidle_device *dev, u64 block_ns) > > if (val > guest_halt_poll_ns) > > val = guest_halt_poll_ns; > > > > + trace_guest_halt_poll_ns_grow(val, dev->poll_limit_ns); > > dev->poll_limit_ns = val; > > } else if (block_ns > guest_halt_poll_ns && > > guest_halt_poll_allow_shrink) { > > @@ -100,6 +102,7 @@ static void adjust_poll_limit(struct cpuidle_device *dev, u64 block_ns) > > val = 0; > > else > > val /= shrink; > > + trace_guest_halt_poll_ns_shrink(val, dev->poll_limit_ns); > > dev->poll_limit_ns = val; > > } > > } > > diff --git a/include/trace/events/power.h b/include/trace/events/power.h > > index af5018aa9517..c708521e4ed5 100644 > > --- a/include/trace/events/power.h > > +++ b/include/trace/events/power.h > > @@ -500,6 +500,35 @@ DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_remove_request, > > > > TP_ARGS(name, type, new_value) > > ); > > + > > +TRACE_EVENT(guest_halt_poll_ns, > > + > > + TP_PROTO(bool grow, unsigned int new, unsigned int old), > > + > > + TP_ARGS(grow, new, old), > > + > > + TP_STRUCT__entry( > > + __field(bool, grow) > > + __field(unsigned int, new) > > + __field(unsigned int, old) > > + ), > > + > > + TP_fast_assign( > > + __entry->grow = grow; > > + __entry->new = new; > > + __entry->old = old; > > + ), > > + > > + TP_printk("halt_poll_ns %u (%s %u)", > > + __entry->new, > > + __entry->grow ? "grow" : "shrink", > > + __entry->old) > > +); > > + > > +#define trace_guest_halt_poll_ns_grow(new, old) \ > > + trace_guest_halt_poll_ns(true, new, old) > > +#define trace_guest_halt_poll_ns_shrink(new, old) \ > > + trace_guest_halt_poll_ns(false, new, old) > > #endif /* _TRACE_POWER_H */ > > > > /* This part must be outside protection */ > > -- > > 2.36.1 > > > > > > Signed-off-by: Marcelo Tosatti I took this as an ACK and applied the patch as 5.20 material. Thanks!