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] [day] [month] [year] [list]
Message-ID: <56FEB70C.6030703@linaro.org>
Date:	Fri, 1 Apr 2016 19:59:40 +0200
From:	Daniel Lezcano <daniel.lezcano@...aro.org>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Ingo Molnar <mingo@...hat.com>,
	"open list:SCHEDULER" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] sched/clock: Remove pointless test in
 cpu_clock/local_clock

On 04/01/2016 05:10 PM, Peter Zijlstra wrote:
> On Fri, Apr 01, 2016 at 03:46:48PM +0200, Daniel Lezcano wrote:
>
>> Remove the duplicate test by directly calling sched_clock_cpu() and let the
>> static key act in this function instead. We can assume gcc is smart enough to
>> inline cpu_clock()/local_clock() to sched_clock_cpu().
>
> Why assume if you can easily check; so does it indeed inline?

Actually, no. They are not inlined.

With this patch we end up with one line functions:

#ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK

u64 cpu_clock(int cpu)
{
	return sched_clock_cpu(cpu);
}

u64 local_clock(void)
{
	return sched_clock_cpu(raw_smp_processor_id());
}

#else

u64 cpu_clock(int cpu)
{
	return sched_clock();
}

u64 local_clock(void)
{
	return sched_clock();
}

#endif

is it worth to convert them to static inline function ?

(static inline does effectively inline those functions).

-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ