From: Rusty Russell <rusty@rustcorp.com.au>
To: Christoph Lameter <cl@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Tejun Heo <tj@kernel.org>,
David Howells <dhowells@redhat.com>, Ingo Molnar <mingo@elte.hu>,
Eric Dumazet <dada1@cosmosbay.com>,
davem@davemloft.net
Subject: Re: [my_cpu_ptr 1/5] Introduce my_cpu_ptr()
Date: Sun, 31 May 2009 12:49:07 +0930 [thread overview]
Message-ID: <200905311249.08107.rusty@rustcorp.com.au> (raw)
In-Reply-To: <alpine.DEB.1.10.0905291023570.30695@gentwo.org>
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.
next prev parent reply other threads:[~2009-05-31 3:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-27 17:46 [my_cpu_ptr 0/5] Introduce my_cpu_ptr/__my_cpu_ptr cl
2009-05-27 17:46 ` [my_cpu_ptr 1/5] Introduce my_cpu_ptr() cl
2009-05-28 3:46 ` Rusty Russell
2009-05-28 15:59 ` Christoph Lameter
2009-05-29 1:27 ` Rusty Russell
2009-05-29 15:37 ` Christoph Lameter
2009-05-31 3:19 ` Rusty Russell [this message]
2009-06-03 14:08 ` Christoph Lameter
2009-05-28 16:10 ` Christoph Hellwig
2009-05-28 16:37 ` Christoph Lameter
2009-05-29 9:46 ` Tejun Heo
2009-05-27 17:47 ` [my_cpu_ptr 2/5] Straight transformations cl
2009-05-27 17:47 ` [my_cpu_ptr 3/5] Elimninate get/put_cpu cl
2009-05-27 19:33 ` Christoph Lameter
2009-05-27 17:47 ` [my_cpu_ptr 4/5] sda_icsb_modify_counters() does not need a "cpu" variable cl
2009-05-28 13:45 ` Olaf Weber
2009-05-27 17:47 ` [my_cpu_ptr 5/5] Use my_cpu_ptr in crypto subsystem cl
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=200905311249.08107.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=cl@linux-foundation.org \
--cc=dada1@cosmosbay.com \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tj@kernel.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.