Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1371307

Re: [PATCH v4 3/6] smp: add function to execute a function synchronously on a cpu

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH v4 3/6] smp: add function to execute a function synchronously on a cpu
Date 2016-04-05 10:20 +0200
Message-ID <rkuno-df-3@gated-at.bofh.it> (permalink)
References <rkrzc-6vm-1@gated-at.bofh.it> <rkrzc-6vm-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Also, as per smp_call_function_single() would it not be more consistent
to make this the last argument?

> +{
> +	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))
> +		return -ENXIO;

Seeing how its fairly hard to schedule work on a cpu that's not actually
there.

> +
> +	queue_work_on(cpu, system_wq, &sscs.work);
> +	wait_for_completion(&sscs.done);
> +
> +	return sscs.ret;
> +}

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 0/6] Support calling functions on dedicated physical cpu Juergen Gross <jgross@suse.com> - 2016-04-05 07:20 +0200
  [PATCH v4 1/6] xen: sync xen header Juergen Gross <jgross@suse.com> - 2016-04-05 07:20 +0200
    Re: [Xen-devel] [PATCH v4 1/6] xen: sync xen header David Vrabel <david.vrabel@citrix.com> - 2016-04-05 11:40 +0200
  [PATCH v4 4/6] xen: add xen_pin_vcpu() to support calling functions on a dedicated pcpu Juergen Gross <jgross@suse.com> - 2016-04-05 07:20 +0200
    Re: [Xen-devel] [PATCH v4 4/6] xen: add xen_pin_vcpu() to support  calling functions on a dedicated pcpu David Vrabel <david.vrabel@citrix.com> - 2016-04-05 11:50 +0200
      Re: [Xen-devel] [PATCH v4 4/6] xen: add xen_pin_vcpu() to support  calling functions on a dedicated pcpu David Vrabel <david.vrabel@citrix.com> - 2016-04-05 12:10 +0200
      Re: [Xen-devel] [PATCH v4 4/6] xen: add xen_pin_vcpu() to support  calling functions on a dedicated pcpu Juergen Gross <jgross@suse.com> - 2016-04-05 12:10 +0200
  [PATCH v4 3/6] smp: add function to execute a function synchronously on a cpu Juergen Gross <jgross@suse.com> - 2016-04-05 07:20 +0200
    Re: [PATCH v4 3/6] smp: add function to execute a function  synchronously on a cpu Peter Zijlstra <peterz@infradead.org> - 2016-04-05 10:20 +0200
      Re: [PATCH v4 3/6] smp: add function to execute a function  synchronously on a cpu Juergen Gross <jgross@suse.com> - 2016-04-05 12:10 +0200
  [PATCH v4 6/6] hwmon: use smp_call_on_cpu() for dell-smm i8k Juergen Gross <jgross@suse.com> - 2016-04-05 07:20 +0200
    Re: [PATCH v4 6/6] hwmon: use smp_call_on_cpu() for dell-smm i8k Guenter Roeck <linux@roeck-us.net> - 2016-04-05 17:00 +0200
      Re: [PATCH v4 6/6] hwmon: use smp_call_on_cpu() for dell-smm i8k Pali Rohár <pali.rohar@gmail.com> - 2016-04-05 21:40 +0200
  [PATCH v4 2/6] virt, sched: add generic vcpu pinning support Juergen Gross <jgross@suse.com> - 2016-04-05 07:20 +0200
  [PATCH v4 5/6] dcdbas: make use of smp_call_on_cpu() Juergen Gross <jgross@suse.com> - 2016-04-05 07:20 +0200

csiph-web