From: Sudeep Holla <sudeep.holla@arm.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Frederic Weisbecker <frederic@kernel.org>,
Sudeep Holla <sudeep.holla@arm.com>,
LKML <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
linux-pm@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
Jacob Pan <jacob.jun.pan@linux.intel.com>
Subject: Re: [PATCH 2/6] cpuidle: Introduce CPUIDLE_FLAG_MWAIT
Date: Tue, 14 Jan 2025 14:34:52 +0000 [thread overview]
Message-ID: <Z4Z2DHENCad2hEFC@bogus> (raw)
In-Reply-To: <CAJZ5v0gEhGJCkfMn6jhF2D_4BYKJZev_Eyq5AhkTeT02_cHcXQ@mail.gmail.com>
On Tue, Jan 14, 2025 at 03:01:26PM +0100, Rafael J. Wysocki wrote:
> On Thu, Jan 2, 2025 at 4:02 PM Frederic Weisbecker <frederic@kernel.org> wrote:
> >
> > From: Peter Zijlstra <peterz@infradead.org>
> >
> > Provide a way to tell the cpuidle core about states monitoring
> > TIF_NEED_RESCHED on the hardware level, monitor/mwait users being the
> > only examples in use.
> >
> > This will allow cpuidle core to manage TIF_NR_POLLING on behalf of all
> > kinds of TIF_NEED_RESCHED watching states while keeping a necessary
> > distinction for the governors between software loops polling on
> > TIF_NEED_RESCHED and hardware monitored writes to thread flags.
> >
> > [fweisbec: _ Initialize flag from acpi_processor_setup_cstates() instead
> > of acpi_processor_setup_lpi_states(), as the latter seem to
> > be about arm64...
> > _ Rename CPUIDLE_FLAG_NO_IPI to CPUIDLE_FLAG_MWAIT]
> >
> > Signed-off-by: Peter Zijlstra <peterz@infradead.org>
> > Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
> > ---
> > drivers/acpi/processor_idle.c | 3 +++
> > drivers/idle/intel_idle.c | 5 ++++-
> > include/linux/cpuidle.h | 1 +
> > 3 files changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
> > index 698897b29de2..66cb5536d91e 100644
> > --- a/drivers/acpi/processor_idle.c
> > +++ b/drivers/acpi/processor_idle.c
> > @@ -806,6 +806,9 @@ static int acpi_processor_setup_cstates(struct acpi_processor *pr)
> > if (cx->type == ACPI_STATE_C1 || cx->type == ACPI_STATE_C2)
> > drv->safe_state_index = count;
> >
> > + if (cx->entry_method == ACPI_CSTATE_FFH)
> > + state->flags |= CPUIDLE_FLAG_MWAIT;
>
> FFH need not mean MWAIT in principle.
>
> FFH in _CST means MWAIT in practice because _CST is used on x86 which
> implements FFH through MWAIT, but it would be good at least to put a
> comment here to explain that this code is only expected to run on x86.
>
> Or better still, add something like acpi_arch_idle_state_flags(u8
> entry_method) that will return CPUIDLE_FLAG_MWAIT for ACPI_CSTATE_FFH
> and 0 otherwise and then do
>
> state->flags |= acpi_arch_idle_state_flags(cx->entry_method);
>
+1, was about to suggest the same. Though I am not aware of any Arm platforms
using C-States(LPI was added to suit Arm requirements), it is better to keep
the FFH definition arch specific.
--
Regards,
Sudeep
next prev parent reply other threads:[~2025-01-14 14:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-02 15:01 [PATCH 0/6 v3] cpuidle: Handle TIF_NR_POLLING on behalf of polling idle states Frederic Weisbecker
2025-01-02 15:01 ` [PATCH 1/6] cpuidle: Remove unnecessary current_clr_polling_and_test() from haltpoll Frederic Weisbecker
2025-01-02 15:01 ` [PATCH 2/6] cpuidle: Introduce CPUIDLE_FLAG_MWAIT Frederic Weisbecker
2025-01-14 14:01 ` Rafael J. Wysocki
2025-01-14 14:34 ` Sudeep Holla [this message]
2025-01-14 14:37 ` Rafael J. Wysocki
2025-01-02 15:01 ` [PATCH 3/6] x86/cpuidle: Move buggy mwait implementations away from CPUIDLE_FLAG_MWAIT Frederic Weisbecker
2025-01-14 14:35 ` Rafael J. Wysocki
2025-01-02 15:01 ` [PATCH 4/6] cpuidle: Handle TIF_NR_POLLING on behalf of CPUIDLE_FLAG_MWAIT states Frederic Weisbecker
2025-01-14 14:50 ` Rafael J. Wysocki
2025-01-17 18:09 ` K Prateek Nayak
2025-01-02 15:01 ` [PATCH 5/6] cpuidle: Remove call_cpuidle_s2idle() Frederic Weisbecker
2025-01-14 14:53 ` Rafael J. Wysocki
2025-01-02 15:02 ` [PATCH 6/6] cpuidle: Handle TIF_NR_POLLING on behalf of software polling idle states Frederic Weisbecker
2025-01-14 14:56 ` Rafael J. Wysocki
2025-01-17 17:51 ` [PATCH 0/6 v3] cpuidle: Handle TIF_NR_POLLING on behalf of " K Prateek Nayak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z4Z2DHENCad2hEFC@bogus \
--to=sudeep.holla@arm.com \
--cc=bp@alien8.de \
--cc=daniel.lezcano@linaro.org \
--cc=dave.hansen@linux.intel.com \
--cc=frederic@kernel.org \
--cc=jacob.jun.pan@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).