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]
Message-ID: <1276181030.2077.399.camel@twins>
Date:	Thu, 10 Jun 2010 16:43:50 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Andi Kleen <andi@...stfloor.org>
Cc:	mingo@...e.hu, akpm@...ux-foundation.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [10/23] SCHED: Only allocate per cpu cpu mask buffer
 with offstack cpumasks

On Thu, 2010-06-10 at 13:10 +0200, Andi Kleen wrote:
> This will save a few bytes in the non offstack cpumask case.
> 
> Found by gcc 4.6's new warnings.
> 
> Cc: peterz@...radead.org
> Cc: mingo@...e.hu
> Signed-off-by: Andi Kleen <ak@...ux.intel.com>
> 
> ---
>  kernel/sched.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> Index: linux-2.6.35-rc2-gcc/kernel/sched.c
> ===================================================================
> --- linux-2.6.35-rc2-gcc.orig/kernel/sched.c
> +++ linux-2.6.35-rc2-gcc/kernel/sched.c
> @@ -7482,7 +7482,7 @@ static void init_tg_rt_entry(struct task
>  void __init sched_init(void)
>  {
>  	int i, j;
> -	unsigned long alloc_size = 0, ptr;
> +	unsigned long alloc_size = 0;
>  
>  #ifdef CONFIG_FAIR_GROUP_SCHED
>  	alloc_size += 2 * nr_cpu_ids * sizeof(void **);
> @@ -7494,7 +7494,10 @@ void __init sched_init(void)
>  	alloc_size += num_possible_cpus() * cpumask_size();
>  #endif
>  	if (alloc_size) {
> +#ifdef CONFIG_CPUMASK_OFFSTACK
> +		unsigned long ptr;
>  		ptr = (unsigned long)kzalloc(alloc_size, GFP_NOWAIT);
> +#endif
>  
>  #ifdef CONFIG_FAIR_GROUP_SCHED
>  		init_task_group.se = (struct sched_entity **)ptr;

This patch will actually break things.. please read the code.

I guess we could move the unsigned long into that block, but I really
don't see the point.
--
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