Linux Power Management development
 help / color / mirror / Atom feed
From: Christian Loehle <christian.loehle@arm.com>
To: Mete Durlu <meted@linux.ibm.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Anna-Maria Behnsen <anna-maria@linutronix.de>,
	Frederic Weisbecker <frederic@kernel.org>,
	Ingo Molnar <mingo@kernel.org>, Thomas Gleixner <tglx@kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Daniel Lezcano <daniel.lezcano@kernel.org>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>,
	Ilya Leoshkevich <iii@linux.ibm.com>,
	linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH v3 4/5] s390/idle: Introduce cpuidle for s390
Date: Thu, 18 Jun 2026 17:06:30 +0100	[thread overview]
Message-ID: <e6723ea1-2400-4edc-aee8-8be7d9cb7945@arm.com> (raw)
In-Reply-To: <f280ac2a-7690-42eb-aca2-3cef711d71c9@linux.ibm.com>

On 6/18/26 15:47, Mete Durlu wrote:
> On 6/18/26 4:41 PM, Christian Loehle wrote:
>> On 6/18/26 13:00, Mete Durlu wrote:
>>> Introduce generic cpuidle driver on s390. Use a two stage approach to
>>> handle idle scenarios and use idle governor for idle stage selection.
>>> Two stages are, from shallow to deep, idle polling and enabled wait.
>>>
>>> Suggested-by: Christian Borntraeger <borntraeger@linux.ibm.com>
>>> Suggested-by: Heiko Carstens <hca@linux.ibm.com>
>>> Signed-off-by: Mete Durlu <meted@linux.ibm.com>
>>> ---
> 
> [..snip..]
> 
> 
>>> +static int s390_cpuidle_cpu_online(unsigned int cpu)
>>> +{
>>> +    struct cpuidle_device *dev = &per_cpu(cpuidle_dev, cpu);
>>> +    int rc;
>>> +
>>> +    if (dev->registered) {
>>> +        cpuidle_pause_and_lock();
>>> +        rc = cpuidle_enable_device(dev);
>>> +        cpuidle_resume_and_unlock();
>>> +        if (rc)
>>> +            pr_err("Failed to enable cpuidle device on cpu %u\n", cpu);
>>> +    } else {
>>> +        dev->cpu = cpu;
>>> +        rc = cpuidle_register_device(dev);
>>> +        if (rc)
>>> +            pr_err("Failed to register cpuidle driver on cpu %u\n", cpu);
>>> +    }
>>> +    return rc;
>>
>> Most other drivers allow for hotplug cpu_online to succeed even if cpuidle doesn't, is
>> this intentionally done otherwise here?
> 
> Yes it is by design. Users would not be aware that something went wrong
> if we don't fail here (unless they check dmesg regularly which we don't
> expect). By failing here driver communicates that there is a problem
> and allows users to resolve that instead of letting a cpu run with
> degraded performance.
> 

Okay, thanks!
So FWIW this looks reasonable to me now, can't really comment much
on the s390 specifics, in particular as a guest, but from a purely
cpuidle perspective this looks okay, so good to see that this seems
to be working for you!

Reviewed-by: Christian Loehle <christian.loehle@arm.com>

  reply	other threads:[~2026-06-18 16:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-18 12:00 [PATCH v3 0/5] s390/idle: CPU idle driver Mete Durlu
2026-06-18 12:00 ` [PATCH v3 1/5] s390/tick: Remove CIF_NOHZ_DELAY flag Mete Durlu
2026-06-18 12:00 ` [PATCH v3 2/5] tick: Remove arch_needs_cpu Mete Durlu
2026-06-18 12:00 ` [PATCH v3 3/5] s390: Enable TIF_POLLING_NRFLAG Mete Durlu
2026-06-18 12:00 ` [PATCH v3 4/5] s390/idle: Introduce cpuidle for s390 Mete Durlu
2026-06-18 14:41   ` Christian Loehle
2026-06-18 14:47     ` Mete Durlu
2026-06-18 16:06       ` Christian Loehle [this message]
2026-06-18 12:00 ` [PATCH v3 5/5] s390/configs: Enable cpuidle driver on s390 Mete Durlu
2026-06-18 13:18   ` Christian Borntraeger

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=e6723ea1-2400-4edc-aee8-8be7d9cb7945@arm.com \
    --to=christian.loehle@arm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=anna-maria@linutronix.de \
    --cc=borntraeger@linux.ibm.com \
    --cc=daniel.lezcano@kernel.org \
    --cc=frederic@kernel.org \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=meted@linux.ibm.com \
    --cc=mingo@kernel.org \
    --cc=rafael@kernel.org \
    --cc=svens@linux.ibm.com \
    --cc=tglx@kernel.org \
    /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