lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <57038DEE.3070201@suse.com>
Date:	Tue, 5 Apr 2016 12:05:34 +0200
From:	Juergen Gross <jgross@...e.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	linux-kernel@...r.kernel.org, xen-devel@...ts.xenproject.org,
	boris.ostrovsky@...cle.com, david.vrabel@...rix.com,
	mingo@...hat.com, Douglas_Warzecha@...l.com, pali.rohar@...il.com,
	jdelvare@...e.com, linux@...ck-us.net, tglx@...utronix.de,
	hpa@...or.com, jeremy@...p.org, chrisw@...s-sol.org,
	akataria@...are.com, rusty@...tcorp.com.au,
	virtualization@...ts.linux-foundation.org, x86@...nel.org
Subject: Re: [PATCH v4 3/6] smp: add function to execute a function
 synchronously on a cpu

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ