From: Rusty Russell <rusty@rustcorp.com.au>
To: Mike Travis <travis@sgi.com>
Cc: Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>, Jack Steiner <steiner@sgi.com>,
linux-kernel@vger.kernel.org, Dean Nelson <dcn@sgi.com>,
Robert Richter <robert.richter@amd.com>,
oprofile-list@lists.sf.net,
Jeremy Fitzhardinge <jeremy@xensource.com>,
Chris Wright <chrisw@sous-sol.org>,
virtualization@lists.osdl.org, xen-devel@lists.xensource.com,
Ursula Braun <ursula.braun@de.ibm.com>,
linux390@de.ibm.com, linux-s390@vger.kernel.org
Subject: Re: [PATCH 3/5] cpumask: convert misc driver functions
Date: Sat, 10 Jan 2009 21:27:36 +1030 [thread overview]
Message-ID: <200901102127.38503.rusty@rustcorp.com.au> (raw)
In-Reply-To: <20090107195832.733912000@polaris-admin.engr.sgi.com>
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.
next prev parent reply other threads:[~2009-01-10 10:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20090107195832.265117000@polaris-admin.engr.sgi.com>
2009-01-07 19:58 ` [PATCH 1/5] cpumask: update irq_desc to use cpumask_var_t Mike Travis
2009-01-07 20:27 ` Yinghai Lu
2009-01-07 22:32 ` Mike Travis
2009-01-08 3:15 ` Yinghai Lu
2009-01-08 15:45 ` Mike Travis
2009-01-08 19:31 ` Yinghai Lu
2009-01-07 19:58 ` [PATCH 3/5] cpumask: convert misc driver functions Mike Travis
2009-01-10 10:57 ` Rusty Russell [this message]
2009-01-16 18:42 ` Tony Luck
2009-01-16 18:55 ` Mike Travis
2009-01-22 13:11 ` Robert Richter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200901102127.38503.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=chrisw@sous-sol.org \
--cc=dcn@sgi.com \
--cc=hpa@zytor.com \
--cc=jeremy@xensource.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux390@de.ibm.com \
--cc=mingo@redhat.com \
--cc=oprofile-list@lists.sf.net \
--cc=robert.richter@amd.com \
--cc=steiner@sgi.com \
--cc=tglx@linutronix.de \
--cc=travis@sgi.com \
--cc=ursula.braun@de.ibm.com \
--cc=virtualization@lists.osdl.org \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).