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]
Date:	Wed, 30 Apr 2014 13:39:28 -0400 (EDT)
From:	Nicolas Pitre <nicolas.pitre@...aro.org>
To:	Daniel Lezcano <daniel.lezcano@...aro.org>
cc:	peterz@...radead.org, mingo@...e.hu,
	linaro-kernel@...ts.linaro.org, linux-pm@...r.kernel.org,
	rjw@...ysocki.net, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] sched: idle: Encapsulate the code to compile it
 out

On Thu, 24 Apr 2014, Daniel Lezcano wrote:

> Encapsulate the large portion of cpuidle_idle_call inside another
> function so when CONFIG_CPU_IDLE=n, the code will be compiled out.
> Also that is benefitial for the clarity of the code as it removes
> a nested indentation level.

I agree with the nesting level concern.

However I dislike the proliferation of #ifdef's in the main code. Those 
added in this patch are unnecessary. We want as much compilation 
coverage as possible.

With cpuidle_enabled() already hardcoded to return -ENODEV when 
CONFIG_CPU_IDLE=n, the compiler should already be smart enough to 
optimize away all the redundant code in that case.  You may look at the 
assembly output from the compiler if you're not sure.

And if you're still not trusting the compiler then the second best 
option is to use IS_ENABLED(CONFIG_CPU_IDLE) inside some if statement.


Nicolas
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ