lkml.org 
[lkml]   [2009]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 3/5] cpumask: convert misc driver functions
Date
On Thursday 08 January 2009 06:28:35 Mike Travis wrote:
> From: Rusty Russell <rusty@rustcorp.com.au>
>
> Impact: use new cpumask API.
>
> Convert misc driver functions to use struct cpumask.
...
> @@ -593,15 +592,20 @@ static int __cpuinit iucv_cpu_notify(str
> break;
> case CPU_DOWN_PREPARE:
> case CPU_DOWN_PREPARE_FROZEN:
> - cpumask = iucv_buffer_cpumask;
> - cpu_clear(cpu, cpumask);
> - if (cpus_empty(cpumask))
> + if (!alloc_cpumask_var(&cpumask, GFP_KERNEL))
> + return NOTIFY_BAD;
> + cpumask_copy(cpumask, &iucv_buffer_cpumask);
> + cpumask_clear_cpu(cpu, cpumask);
> + if (cpumask_empty(cpumask)) {
> /* Can't offline last IUCV enabled cpu. */
> + free_cpumask_var(cpumask);
> return NOTIFY_BAD;
> + }
> smp_call_function_single(cpu, iucv_retrieve_cpu, NULL, 1);
> if (cpus_empty(iucv_irq_cpumask))
> smp_call_function_single(first_cpu(iucv_buffer_cpumask),
> iucv_allow_cpu, NULL, 1);
> + free_cpumask_var(cpumask);
> break;

Minor nit: this can be done better, actually:

@@ -596,9 +594,7 @@ static int __cpuinit iucv_cpu_notify(str
case CPU_DOWN_PREPARE_FROZEN:
if (!iucv_path_table)
break;
- cpumask = iucv_buffer_cpumask;
- cpu_clear(cpu, cpumask);
- if (cpus_empty(cpumask))
+ if (cpumask_any_but(&iucv_buffer_cpumask, cpu) >= nr_cpu_ids)
/* Can't offline last IUCV enabled cpu. */
return NOTIFY_BAD;
smp_call_function_single(cpu, iucv_retrieve_cpu, NULL, 1);

Cheers,
Rusty.


\
 
 \ /
  Last update: 2009-01-10 12:01    [W:0.234 / U:0.796 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site