All of lore.kernel.org
 help / color / mirror / Atom feed
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,
	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@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

WARNING: multiple messages have this Message-ID (diff)
From: Juergen Gross <jgross@suse.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org,
	boris.ostrovsky@oracle.com, david.vrabel@citrix.com,
	mingo@redhat.com, Douglas_Warzecha@dell.com,
	pali.rohar@gmail.com, jdelvare@suse.com, linux@roeck-us.net,
	tglx@linutronix.de, hpa@zytor.com, jeremy@goop.org,
	chrisw@sous-sol.org, akataria@vmware.com, rusty@rustcorp.com.au,
	virtualization@lists.linux-foundation.org, x86@kernel.org
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@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

  parent reply	other threads:[~2016-04-05 10:05 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-05  5:10 [PATCH v4 0/6] Support calling functions on dedicated physical cpu Juergen Gross
2016-04-05  5:10 ` Juergen Gross
2016-04-05  5:10 ` [PATCH v4 1/6] xen: sync xen header Juergen Gross
2016-04-05  5:10 ` Juergen Gross
2016-04-05  5:10   ` Juergen Gross
2016-04-05  9:34   ` David Vrabel
2016-04-05  9:34   ` [Xen-devel] " David Vrabel
2016-04-05  9:34     ` David Vrabel
2016-04-05  5:10 ` [PATCH v4 2/6] virt, sched: add generic vcpu pinning support Juergen Gross
2016-04-05  5:10 ` Juergen Gross
2016-04-05  5:10 ` 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 ` Juergen Gross
2016-04-05  5:10   ` Juergen Gross
2016-04-05  8:11   ` Peter Zijlstra
2016-04-05  8:11   ` Peter Zijlstra
2016-04-05  8:11     ` Peter Zijlstra
2016-04-05 10:05     ` Juergen Gross
2016-04-05 10:05     ` Juergen Gross [this message]
2016-04-05 10:05       ` 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 ` Juergen Gross
2016-04-05  5:10 ` Juergen Gross
2016-04-05  9:45   ` [Xen-devel] " David Vrabel
2016-04-05  9:45     ` David Vrabel
2016-04-05 10:01     ` Juergen Gross
2016-04-05 10:01     ` [Xen-devel] " Juergen Gross
2016-04-05 10:01       ` Juergen Gross
2016-04-05 10:03       ` David Vrabel
2016-04-05 10:03         ` David Vrabel
2016-04-05 10:03       ` David Vrabel
2016-04-05  9:45   ` David Vrabel
2016-04-05  5:10 ` [PATCH v4 5/6] dcdbas: make use of smp_call_on_cpu() Juergen Gross
2016-04-05  5:10   ` Juergen Gross
2016-04-05  5:10 ` Juergen Gross
2016-04-05  5:10 ` [PATCH v4 6/6] hwmon: use smp_call_on_cpu() for dell-smm i8k Juergen Gross
2016-04-05  5:10   ` Juergen Gross
2016-04-05 14:54   ` Guenter Roeck
2016-04-05 14:54   ` Guenter Roeck
2016-04-05 19:31     ` Pali Rohár
2016-04-05 19:31     ` Pali Rohár
2016-04-05 19:31     ` Pali Rohár
2016-04-21 10:57       ` Pali Rohár
2016-04-21 10:57       ` Pali Rohár
2016-04-21 10:57         ` Pali Rohár
2016-04-21 13:12         ` Juergen Gross
2016-04-21 13:12           ` Juergen Gross
2016-04-21 13:27           ` Pali Rohár
2016-04-21 13:27           ` Pali Rohár
2016-04-21 13:27             ` Pali Rohár
2016-05-09 14:37             ` Juergen Gross
2016-05-09 14:37             ` Juergen Gross
2016-05-12  8:51               ` Pali Rohár
2016-05-12  8:51                 ` Pali Rohár
2016-05-12  8:51               ` Pali Rohár
2016-05-09 14:37             ` Juergen Gross
2016-04-21 13:12         ` Juergen Gross
2016-04-05 14:54   ` Guenter Roeck
2016-04-05  5:10 ` Juergen Gross

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@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=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 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.