lkml.org 
[lkml]   [2009]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] x86, smpboot: use zalloc_cpumask_var instead of alloc/clear
On Thu, Aug 06, 2009 at 06:15:52PM +0200, Andreas Herrmann wrote:
> On Thu, Aug 06, 2009 at 06:30:46PM +1000, Stephen Rothwell wrote:
> > Hi Andrea,
> >
> > On Wed, 5 Aug 2009 17:48:11 +0200 Andreas Herrmann <andreas.herrmann3@amd.com> wrote:
> > >
> > > @@ -1061,8 +1070,10 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
> > > for_each_possible_cpu(i) {
> > > alloc_cpumask_var(&per_cpu(cpu_sibling_map, i), GFP_KERNEL);
> > > alloc_cpumask_var(&per_cpu(cpu_core_map, i), GFP_KERNEL);
> > > + alloc_cpumask_var(&per_cpu(cpu_node_map, i), GFP_KERNEL);
> > > alloc_cpumask_var(&cpu_data(i).llc_shared_map, GFP_KERNEL);
> > > cpumask_clear(per_cpu(cpu_core_map, i));
> > > + cpumask_clear(per_cpu(cpu_node_map, i));
> >
> > I noticed this in linux-next ... you can use zalloc_cpumask_var() instead
> > of alloc_cpumask_var() followed by cpumask_clear().
>
> I know, there is a collision with a patch in linux-next that replaced
> alloc_cpumask_var/cpumask_clear with the zalloc version.
>
> (a) Either that patch should be adapted to change also the new allocation.
> (b) I can also change all those allocation to zalloc with my patch.
>
> Make your choice:
>
> [ ] (a)
> [ ] (b)


My choice is
[X] (c) Do this in a separate patch.

See below.

Regards,
Andreas

--
From 5d7e6138d4bc2d8c5191e6bf9cfbe9d5a27d79b0 Mon Sep 17 00:00:00 2001
From: Andreas Herrmann <andreas.herrmann3@amd.com>
Date: Thu, 6 Aug 2009 19:31:58 +0200
Subject: [PATCH] x86, smpboot: use zalloc_cpumask_var instead of alloc/clear

Suggested-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
---
arch/x86/kernel/smpboot.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index f50af56..f797214 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1068,14 +1068,10 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
#endif
current_thread_info()->cpu = 0; /* needed? */
for_each_possible_cpu(i) {
- alloc_cpumask_var(&per_cpu(cpu_sibling_map, i), GFP_KERNEL);
- alloc_cpumask_var(&per_cpu(cpu_core_map, i), GFP_KERNEL);
- alloc_cpumask_var(&per_cpu(cpu_node_map, i), GFP_KERNEL);
- alloc_cpumask_var(&cpu_data(i).llc_shared_map, GFP_KERNEL);
- cpumask_clear(per_cpu(cpu_core_map, i));
- cpumask_clear(per_cpu(cpu_node_map, i));
- cpumask_clear(per_cpu(cpu_sibling_map, i));
- cpumask_clear(cpu_data(i).llc_shared_map);
+ zalloc_cpumask_var(&per_cpu(cpu_sibling_map, i), GFP_KERNEL);
+ zalloc_cpumask_var(&per_cpu(cpu_core_map, i), GFP_KERNEL);
+ zalloc_cpumask_var(&per_cpu(cpu_node_map, i), GFP_KERNEL);
+ zalloc_cpumask_var(&cpu_data(i).llc_shared_map, GFP_KERNEL);
}
set_cpu_sibling_map(0);

--
1.6.3.3




\
 
 \ /
  Last update: 2009-08-06 19:47    [W:0.081 / U:0.072 seconds]
©2003-2014 Jasper Spaans. Advertise on this site