lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 2 Oct 2013 13:14:26 -0500
From:	Rob Herring <robherring2@...il.com>
To:	Stephen Boyd <sboyd@...eaurora.org>
Cc:	Santosh Shilimkar <santosh.shilimkar@...com>,
	Russell King <linux@....linux.org.uk>,
	Daniel Lezcano <daniel.lezcano@...aro.org>,
	Will Deacon <will.deacon@....com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"rob.herring@...xeda.com" <rob.herring@...xeda.com>,
	"arm@...nel.org" <arm@...nel.org>,
	John Stultz <john.stultz@...aro.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] sched_clock: fix postinit no sched_clock function check

On Wed, Oct 2, 2013 at 12:42 PM, Stephen Boyd <sboyd@...eaurora.org> wrote:
> On 10/02/13 10:27, Santosh Shilimkar wrote:
>> On Wednesday 02 October 2013 01:22 PM, Stephen Boyd wrote:
>>> On 10/02/13 10:14, Santosh Shilimkar wrote:
>>>> On Wednesday 02 October 2013 01:09 PM, Will Deacon wrote:
>>>>> On Wed, Oct 02, 2013 at 05:55:28PM +0100, Santosh Shilimkar wrote:
>>>>>> The sched_clock code uses 2 levels of function pointers, sched_clock_func()
>>>>>> and read_sched_clock() but the no sched_clock check in postinit() just
>>>>>> checks read_sched_clock().
>>>>>>
>>>>>> This leads to kernel falling back to jiffy based sched clock even in
>>>>>> presence of sched_clock_func() which is not desirable.
>>>>>>
>>>>>> Fix the postinit() check to avoid the issue. Probably the issue is hidden
>>>>>> so far on most of the arm SOCs because of already existing sched_clock
>>>>>> registrations apart from arch_timer sched_clock. One can reproduce the
>>>>>> issue by just have arch_timer as sched_clock
>>>>> Isn't this just an issue with the arch timer driver not calling
>>>>> setup_sched_clock? Instead, we munge around with sched_clock_func directly,
>>>>> which doesn't appear to be the way anybody else deals with this.
>>>>>
>>>> I thought about that option as well but was not sure since even in that case
>>>> the check is not complete. We just ensure that function is popullated.
>>> Yes, nothing is actually broken because sched_clock_func() won't try to
>>> use the jiffy based read_sched_clock() function. I'm not sure we
>>> actually need this patch besides to remove a useless timer that updates
>>> the jiffy epoch. Can we wait until my 64-bit sched_clock patch series
>>> lands in 3.13? It looks like I still need an ack from Will or Catalin on
>>> the architected timer patch before the clocksource folks pick it up.
>>>
>> Really... I have not created patch out of fun.
>> Its broken on my keystone machine at least where the sched_clock is
>> falling back on jiffy based sched_clock even in presence of arch_timer
>> sched_clock.
>
> How is that possible? sched_clock_func is only assigned by
> arch/arm/kernel/arch_timer.c when the architected timer is detected and
> sched_clock() in kernel/time/sched_clock.c calls that function pointer
> unconditionally. The only way I see this happening is if the architected
> timer rate is zero. I agree we will get two lines in the dmesg about
> sched_clock and its not very clear which one is being used.

It does setup a timer to run to handle wrapping which should be
harmless, but isn't needed.

Rob
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists