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: <200905311249.08107.rusty@rustcorp.com.au>
Date:	Sun, 31 May 2009 12:49:07 +0930
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	Christoph Lameter <cl@...ux-foundation.org>
Cc:	linux-kernel@...r.kernel.org, Tejun Heo <tj@...nel.org>,
	David Howells <dhowells@...hat.com>,
	Ingo Molnar <mingo@...e.hu>,
	Eric Dumazet <dada1@...mosbay.com>, davem@...emloft.net
Subject: Re: [my_cpu_ptr 1/5] Introduce my_cpu_ptr()

On Sat, 30 May 2009 01:07:48 am Christoph Lameter wrote:
> On Fri, 29 May 2009, Rusty Russell wrote:
> > > Have not seen it but it would be a bit confusing since
> > > we already have get_cpu* which must be paired with put_cpu*
> > > because of the refcount taking (get_cpu_var and get_cpu).
> > > get_cpu_ptr() would not have to be paired.
> >
> > To clarify, get_cpu_ptr() would be paired with put_cpu_ptr(). 
> > __get_cpu_ptr() would be the "raw" one:
> >
> > #define get_cpu_ptr(xx) per_cpu_ptr(xx, get_cpu())
> > #define __get_cpu_ptr(xx) per_cpu_ptr(xx, smp_processor_id())
>
> Hmmm.. That would be a major change in semantics.

It's exactly like get_cpu_var.  For better or worse, let's not invent YA new 
convention.

> How would that look for atomic per cpu ops?
>
> 	get_cpu_ptr_inc(per_cpu_ptr1);
> 	__get_cpu_ptr_inc(per_cpu_ptr2)
> 	put_cpu_ptr()
>
> vs.
>
> 	this_cpu_inc(per_cpu_ptr1)
> 	this_cpu_inc(per_cpu_ptr2)

Well, get_* doesn't really make sense for any function which doesn't return a 
value.  

So that name question doesn't really have a clear convention answer: we could 
re-use cpu_local_inc() since I think we decided to kill local_t.  I slightly 
prefer it over "this_cpu_*" since we're not actually doing anything to the cpu 
itself, but I don't think anyone will get too confused and think that after 
this executes their CPU will be stepping 11. :)

Thanks,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ