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, 17 Dec 2008 17:42:54 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Vaidyanathan Srinivasan <svaidy@...ux.vnet.ibm.com>
Cc:	linux-kernel@...r.kernel.org, suresh.b.siddha@...el.com,
	venkatesh.pallipadi@...el.com, a.p.zijlstra@...llo.nl,
	mingo@...e.hu, dipankar@...ibm.com, balbir@...ux.vnet.ibm.com,
	vatsa@...ux.vnet.ibm.com, ego@...ibm.com, andi@...stfloor.org,
	davecb@....com, tconnors@...ro.swin.edu.au, maxk@...lcomm.com,
	gregory.haskins@...il.com, pavel@...e.cz, svaidy@...ux.vnet.ibm.com
Subject: Re: [PATCH v6 6/7] sched: add SD_BALANCE_NEWIDLE at MC and CPU
 level for sched_mc>0

On Wed, 17 Dec 2008 22:57:38 +0530
Vaidyanathan Srinivasan <svaidy@...ux.vnet.ibm.com> wrote:

> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -782,6 +782,16 @@ enum powersavings_balance_level {
>  	((sched_mc_power_savings || sched_smt_power_savings) ?	\
>  	 SD_POWERSAVINGS_BALANCE : 0)

What's with all the crappy macros in here?

> +/*
> + * Optimise SD flags for power savings:
> + * SD_BALANCE_NEWIDLE helps agressive task consolidation and power savings.
> + * Keep default SD flags if sched_{smt,mc}_power_saving=0
> + */
> +
> +#define POWERSAVING_SD_FLAGS	\
> +	((sched_mc_power_savings || sched_smt_power_savings) ?	\
> +	  SD_BALANCE_NEWIDLE : 0)

This one purports to be a constant, but it isn't - it's code.

It would be cleaner, clearer and more idiomatic to do

static inline int powersaving_sd_flags(void)
{
	...
}

Also, doing (sched_mc_power_savings | sched_smt_power_saving) might
save a branch.

>  #define test_sd_parent(sd, flag)	((sd->parent &&		\
>  					 (sd->parent->flags & flag)) ? 1 : 0)

buggy when passed an expression with side-effects.  Doesn't need to be
implemented as a macro.


Sigh.


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