From: Sudeep Holla <sudeep.holla@arm.com>
To: Preeti U Murthy <preeti@linux.vnet.ibm.com>,
Thomas Gleixner <tglx@linutronix.de>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Suzuki Poulose <Suzuki.Poulose@arm.com>,
Lorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>,
Catalin Marinas <Catalin.Marinas@arm.com>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Subject: Re: [PATCH] clockevents: return error from tick_broadcast_oneshot_control if !GENERIC_CLOCKEVENTS_BROADCAST
Date: Fri, 26 Jun 2015 09:38:12 +0100 [thread overview]
Message-ID: <558D0F74.4050704@arm.com> (raw)
In-Reply-To: <558CDE57.3050008@linux.vnet.ibm.com>
On 26/06/15 06:08, Preeti U Murthy wrote:
> On 06/25/2015 09:00 PM, Sudeep Holla wrote:
>>
>>
>> On 25/06/15 14:55, Thomas Gleixner wrote:
>>> On Thu, 25 Jun 2015, Sudeep Holla wrote:
>>>
>>>> tick_broadcast_enter returns 0 when CPU can switch to broadcast
>>>> timer and non-zero otherwise. However when GENERIC_CLOCKEVENTS_BROADCAST
>>>> and TICK_ONESHOT are disabled, tick_broadcast_oneshot_control returns 0
>>>> which indicates to the CPUIdle framework that the CPU can enter deeper
>>>> idle states even when the CPU local timer will be shutdown. If the
>>>> target state needs broadcast but not broadcast timer is available, then
>>>> the CPU can not resume back from that idle state.
>>>>
>>>> This patch returns error when there's no broadcast timer support
>>>> available so that CPUIdle framework prevents the CPU from entering any
>>>> idle states losing the local timer.
>>>
>>> That's wrong and breaks stuff which does not require the broadcast
>>> nonsense.
>>>
>>
>> OK, sorry for not considering that case.
>>
>>> If TICK_ONESHOT is disabled, then everything is in periodic mode and
>>> tick_broadcast_enter() rightfully returns 0. Ditto for 'highres=off'
>>> on the command line.
>>>
>>> But there is a case which is not correctly handled right now. That's
>>> what you are trying to solve in the wrong way.
>>>
>>
>> Correct I was trying to solve exactly the case mentioned below.
>>
>>> If
>>> GENERIC_CLOCKEVENTS_BROADCAST=n
>>>
>>> or
>>>
>>> GENERIC_CLOCKEVENTS_BROADCAST=y and no broadcast device is available,
>>>
>>> AND cpu local tick device has the C3STOP flag set,
>>>
>>> then we have no way to tell the idle code that going deep is not
>>> allowed.
>>>
>>> So we need to be smarter than blindly changing a return
>>> value. Completely untested patch below.
>>>
>>
>> Agreed, thanks for the quick patch, I have tested it and it works fine.
>> You can add
>>
>> Tested-by: Sudeep Holla <sudeep.holla@arm.com>
>
> What about the case where GENERIC_CLOCKEVENTS_BROADCAST=y and
> TICK_ONESHOT=n (HZ_PERIODIC=y) ? Have you tested this ?
>
Yes I did test this config, but not the one through cmdline which tglx
is suggesting in the other mail. It doesn't hang but all cpus are in
shallow idle states(WFI in ARM) and no progress in the boot. But IMO
that's different issue and that config is not tested for long time and
need more investigation. I will get into that ASAP but that's least used
configuration.
> This will hang the kernel at boot if you are using the hrtimer mode of
> broadcast. This is because the local timers of all cpus are shutdown
> when the cpuidle driver registers itself, on finding out that there are
> idle states where local tick devices stop. The broadcast tick device is
> then in charge of waking up the cpus at every period. In hrtimer mode of
> broadcast, there is no such real device and we hang.
>
No sure what you mean by this. IIUC when you select HIGH_RES_TIMERS,
TICK_ONESHOT is selected by default. So I don't understand how to get
HZ_PERIODIC=y, HIGH_RES_TIMERS=n and hrtimer mode of broadcast. Am I
missing something ?
> There was a patch sent out recently to fix this on powerpc.
> https://lkml.org/lkml/2015/6/24/42
>
Yes I saw that and IIUC you don't register the idle states where local
timer stops, correct ? But I am not seeing the hang on ARM as described
in the log, I will spend more time to check if I am missing something
and not testing the right configuration.
Regards,
Sudeep
next prev parent reply other threads:[~2015-06-26 8:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-25 10:27 [PATCH] clockevents: return error from tick_broadcast_oneshot_control if !GENERIC_CLOCKEVENTS_BROADCAST Sudeep Holla
2015-06-25 13:55 ` Thomas Gleixner
2015-06-25 15:30 ` Sudeep Holla
2015-06-26 5:08 ` Preeti U Murthy
2015-06-26 7:47 ` Thomas Gleixner
2015-06-26 11:25 ` Preeti U Murthy
2015-06-26 11:50 ` Thomas Gleixner
2015-06-26 12:37 ` Preeti U Murthy
2015-06-26 12:34 ` Preeti U Murthy
2015-06-26 12:38 ` Thomas Gleixner
2015-06-26 12:46 ` Preeti U Murthy
2015-07-01 9:08 ` Thomas Gleixner
2015-06-26 12:58 ` Sudeep Holla
2015-06-26 8:38 ` Sudeep Holla [this message]
2015-06-26 4:59 ` Preeti U Murthy
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=558D0F74.4050704@arm.com \
--to=sudeep.holla@arm.com \
--cc=Catalin.Marinas@arm.com \
--cc=Lorenzo.Pieralisi@arm.com \
--cc=Suzuki.Poulose@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=preeti@linux.vnet.ibm.com \
--cc=rafael.j.wysocki@intel.com \
--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