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: <4FAC7733.1050100@linux.vnet.ibm.com>
Date:	Fri, 11 May 2012 10:19:31 +0800
From:	Michael Wang <wangyun@...ux.vnet.ibm.com>
To:	Peter Zijlstra <peterz@...radead.org>
CC:	Diwakar Tundlam <dtundlam@...dia.com>,
	"'Ingo Molnar'" <mingo@...nel.org>,
	"'David Rientjes'" <rientjes@...gle.com>,
	"'linux-kernel@...r.kernel.org'" <linux-kernel@...r.kernel.org>,
	Peter De Schrijver <pdeschrijver@...dia.com>
Subject: Re: [PATCH] sched: Make nr_uninterruptible count a signed value

On 05/10/2012 05:46 PM, Peter Zijlstra wrote:

> Or something like the below.. I recently changed nr_running to int (see
> c82513e51) so P(nr_running) would also benefit.
> 
> ---
>  kernel/sched/debug.c |   10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
> index 31e4f61..954fabf 100644
> --- a/kernel/sched/debug.c
> +++ b/kernel/sched/debug.c
> @@ -260,8 +260,14 @@ static void print_cpu(struct seq_file *m, int cpu)
>  	SEQ_printf(m, "\ncpu#%d\n", cpu);
>  #endif
> 
> -#define P(x) \
> -	SEQ_printf(m, "  .%-30s: %Ld\n", #x, (long long)(rq->x))
> +#define P(x)								\
> +do {									\
> +	if (sizeof(rq->x) == 4)						\
> +		SEQ_printf(m, "  .%-30s: %ld\n", #x, (long)(rq->x));	\


Oh, yes, I haven't noticed that sizeof could also be a check point.
So now we can use P(x) freely and don't need to worry about anything.

Regards,
Michael Wang

> +	else								\
> +		SEQ_printf(m, "  .%-30s: %Ld\n", #x, (long long)(rq->x));\
> +} while (0)
> +		
>  #define PN(x) \
>  	SEQ_printf(m, "  .%-30s: %Ld.%06ld\n", #x, SPLIT_NS(rq->x))
> 
> 
> --
> 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/
> 


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