From: Andrew Morton <akpm@digeo.com>
To: Zwane Mwaikambo <zwane@holomorphy.com>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, rml@tech9.net
Subject: Re: [PATCH][2.5] smp_call_function_mask
Date: Thu, 16 Jan 2003 21:44:24 -0800 [thread overview]
Message-ID: <20030116214424.037f57aa.akpm@digeo.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0301170014230.24250-100000@montezuma.mastecende.com>
Zwane Mwaikambo <zwane@holomorphy.com> wrote:
>
> This patch adds a smp_call_function which also accepts a cpu mask which is
> needed for targetting specific or groups of cpus.
What is it needed for?
> Index: linux-2.5.58-cpu_hotplug/arch/i386/kernel/smp.c
ia32 only?
>
> +int smp_call_function_mask (void (*func) (void *info), void *info, int nonatomic,
> + int wait, unsigned long mask)
> +/*
> + * [SUMMARY] Run a function on specific CPUs, save self.
> + * <func> The function to run. This must be fast and non-blocking.
> + * <info> An arbitrary pointer to pass to the function.
> + * <nonatomic> currently unused.
> + * <wait> If true, wait (atomically) until function has completed on other CPUs.
> + * <mask> The bitmask of CPUs to call the function
> + * [RETURNS] 0 on success, else a negative status code. Does not return until
> + * remote CPUs are nearly ready to execute <<func>> or are or have executed.
> + *
> + * You must not call this function with disabled interrupts or from a
> + * hardware interrupt handler or from a bottom half handler.
> + */
Please don't invent new coding styles. The comment block goes outside the
function. Nice comment block though.
> +{
> + struct call_data_struct data;
> + int num_cpus = hweight32(mask);
> +
> + if (num_cpus == 0)
> + return -EINVAL;
> +
> + if ((1UL << smp_processor_id()) & mask)
> + return -EINVAL;
Preempt safety?
next prev parent reply other threads:[~2003-01-17 5:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-17 5:18 [PATCH][2.5] smp_call_function_mask Zwane Mwaikambo
2003-01-17 5:44 ` Andrew Morton [this message]
2003-01-17 5:56 ` Zwane Mwaikambo
2003-01-20 23:19 ` Alan
2003-01-21 7:16 ` Zwane Mwaikambo
-- strict thread matches above, loose matches on Subject: below --
2003-01-21 7:13 Manfred Spraul
2003-01-21 8:07 ` Zwane Mwaikambo
2003-01-21 9:21 ` Zwane Mwaikambo
2003-01-21 17:13 ` Manfred Spraul
2003-01-21 17:49 ` Zwane Mwaikambo
2003-01-21 23:14 ` Alan Cox
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=20030116214424.037f57aa.akpm@digeo.com \
--to=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rml@tech9.net \
--cc=zwane@holomorphy.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.