From: Juergen Gross <jgross@suse.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: x86@kernel.org, jeremy@goop.org, jdelvare@suse.com,
hpa@zytor.com, akataria@vmware.com, linux-kernel@vger.kernel.org,
rusty@rustcorp.com.au, virtualization@lists.linux-foundation.org,
chrisw@sous-sol.org, mingo@redhat.com, david.vrabel@citrix.com,
Douglas_Warzecha@dell.com, pali.rohar@gmail.com,
xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com,
tglx@linutronix.de, linux@roeck-us.net
Subject: Re: [PATCH v4 3/6] smp: add function to execute a function synchronously on a cpu
Date: Tue, 5 Apr 2016 12:05:34 +0200 [thread overview]
Message-ID: <57038DEE.3070201__17839.9553210058$1459850818$gmane$org@suse.com> (raw)
In-Reply-To: <20160405081107.GH3448@twins.programming.kicks-ass.net>
On 05/04/16 10:11, Peter Zijlstra wrote:
> On Tue, Apr 05, 2016 at 07:10:04AM +0200, Juergen Gross wrote:
>> +int smp_call_on_cpu(unsigned int cpu, bool pin, int (*func)(void *), void *par)
>
> Why .pin and not .phys? .pin does not (to me) reflect the
> hypervisor/physical-cpu thing.
I don't mind either way. As you don't like .pin, lets name it .phys.
> Also, as per smp_call_function_single() would it not be more consistent
> to make this the last argument?
Okay, I'll change it.
>
>> +{
>> + struct smp_call_on_cpu_struct sscs = {
>> + .work = __WORK_INITIALIZER(sscs.work, smp_call_on_cpu_callback),
>> + .done = COMPLETION_INITIALIZER_ONSTACK(sscs.done),
>> + .func = func,
>> + .data = par,
>> + .cpu = pin ? cpu : -1,
>> + };
>> +
>> + if (cpu >= nr_cpu_ids)
>
> You might want to also include cpu_online().
>
> if (cpu >= nr_cpu_ids || !cpu_online(cpu))
Indeed, good idea.
>> + return -ENXIO;
>
> Seeing how its fairly hard to schedule work on a cpu that's not actually
> there.
Really? ;-)
Juergen
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-04-05 10:05 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1459833007-11618-1-git-send-email-jgross@suse.com>
2016-04-05 5:10 ` [PATCH v4 1/6] xen: sync xen header Juergen Gross
2016-04-05 5:10 ` [PATCH v4 2/6] virt, sched: add generic vcpu pinning support Juergen Gross
2016-04-05 5:10 ` [PATCH v4 3/6] smp: add function to execute a function synchronously on a cpu Juergen Gross
2016-04-05 5:10 ` [PATCH v4 4/6] xen: add xen_pin_vcpu() to support calling functions on a dedicated pcpu Juergen Gross
2016-04-05 5:10 ` [PATCH v4 5/6] dcdbas: make use of smp_call_on_cpu() Juergen Gross
2016-04-05 5:10 ` [PATCH v4 6/6] hwmon: use smp_call_on_cpu() for dell-smm i8k Juergen Gross
[not found] ` <1459833007-11618-4-git-send-email-jgross@suse.com>
2016-04-05 8:11 ` [PATCH v4 3/6] smp: add function to execute a function synchronously on a cpu Peter Zijlstra
[not found] ` <20160405081107.GH3448@twins.programming.kicks-ass.net>
2016-04-05 10:05 ` Juergen Gross [this message]
[not found] ` <1459833007-11618-2-git-send-email-jgross@suse.com>
2016-04-05 9:34 ` [PATCH v4 1/6] xen: sync xen header David Vrabel
[not found] ` <1459833007-11618-5-git-send-email-jgross@suse.com>
2016-04-05 9:45 ` [PATCH v4 4/6] xen: add xen_pin_vcpu() to support calling functions on a dedicated pcpu David Vrabel
[not found] ` <57038927.1030205@citrix.com>
2016-04-05 10:01 ` Juergen Gross
[not found] ` <57038D0E.1040708@suse.com>
2016-04-05 10:03 ` David Vrabel
[not found] ` <1459833007-11618-7-git-send-email-jgross@suse.com>
2016-04-05 14:54 ` [PATCH v4 6/6] hwmon: use smp_call_on_cpu() for dell-smm i8k Guenter Roeck
[not found] ` <20160405145414.GB27359@roeck-us.net>
2016-04-05 19:31 ` Pali Rohár
[not found] ` <201604052131.52765@pali>
2016-04-21 10:57 ` Pali Rohár
[not found] ` <20160421105724.GK29406@pali>
2016-04-21 13:12 ` Juergen Gross
[not found] ` <5718D1D4.3040309@suse.com>
2016-04-21 13:27 ` Pali Rohár
[not found] ` <20160421132735.GR29406@pali>
2016-05-09 14:37 ` Juergen Gross
[not found] ` <5730A08D.60100@suse.com>
2016-05-12 8:51 ` Pali Rohár
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='57038DEE.3070201__17839.9553210058$1459850818$gmane$org@suse.com' \
--to=jgross@suse.com \
--cc=Douglas_Warzecha@dell.com \
--cc=akataria@vmware.com \
--cc=boris.ostrovsky@oracle.com \
--cc=chrisw@sous-sol.org \
--cc=david.vrabel@citrix.com \
--cc=hpa@zytor.com \
--cc=jdelvare@suse.com \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mingo@redhat.com \
--cc=pali.rohar@gmail.com \
--cc=peterz@infradead.org \
--cc=rusty@rustcorp.com.au \
--cc=tglx@linutronix.de \
--cc=virtualization@lists.linux-foundation.org \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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).