All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pranith Kumar <bobby.prani@gmail.com>
To: Christoph Lameter <cl@gentwo.org>
Cc: rdunlap@infradead.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/1] doc: Add remote CPU access details and others to this_cpu_ops.txt
Date: Thu, 17 Jul 2014 11:03:36 -0400	[thread overview]
Message-ID: <53C7E5C8.9070400@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1407170953070.28248@gentwo.org>

On 07/17/2014 10:55 AM, Christoph Lameter wrote:
> On Thu, 17 Jul 2014, Pranith Kumar wrote:
> 
>>> The RCU code has .... ummmm... some issues with percpu usage and should
>>> not be taken as a good example. If you look at the RCU code it looks
>>> horrible with numerous barriers around remote percpu read/wrirte
>>> accesses and one wonders if that code is actually ok.
>>
>> Well, it is running in all our kernels with not many reported issues, isn't it ;)
>> And yes, that is one of the extra-ordinary situations where we use per-cpu data.
>> Once you've extracted a pointer to the per-cpu area -and- ensure that concurrent
>> accesses do not happen(or happen with enough guarantees using barriers), what is
>> the case against remote accesses? I am asking from a correctness and a
>> performance point of view, not style/aesthetics.
> 
> Could be working but I do not want it to be mentioned in the
> documentation given the problems it causes. IPI is preferable.

I can mention that IPI is preferable. What is that you don't want mentioned? atomic_t?

> 
>>>> If data needs to be modified from multiple cpus only very rarely, doesn't it
>>>> make sense to use per-cpu areas?
>>>
>>> I would suggest that this should not occur. You can always "modify" remote
>>> percpu areas by generating an IPI on that cpu to make that processor
>>> update its own per cpu data.
>>>
>>
>> The case against doing that is not to wake up CPUs which are in idle/sleep
>> states. I think mentioning it here that remote accesses are strongly discouraged
>> with a reasonable explanation of the implications should be enough. There might
>> always be rare situations where remote accesses might be necessary.
> 
> Remote percpu updates are extremely rare events. If the cpu is idle/asleep
> then usually no updates are needed because no activity is occurring on
> that cpu.
> 

Yes, -usually- that is the case. But we are talking about the extreme rare event
where we need to update some remote CPU`s per-cpu data without waking it up from
sleep/idle. How do you suggest we handle this? I don't think suggesting not to
use per-cpu areas because of this is a good idea, since we lose a lot of
performance in the most common cases.

Thoughts?

--
Pranith

  reply	other threads:[~2014-07-17 15:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-16 23:09 [PATCH v2 1/1] doc: Add remote CPU access details and others to this_cpu_ops.txt Pranith Kumar
2014-07-17 13:50 ` Christoph Lameter
     [not found]   ` <53C7D93B.4090006@gmail.com>
2014-07-17 14:39     ` Christoph Lameter
2014-07-17 14:48       ` Pranith Kumar
2014-07-17 14:55         ` Christoph Lameter
2014-07-17 15:03           ` Pranith Kumar [this message]
2014-07-17 15:26             ` Christoph Lameter
2014-07-17 23:44               ` Pranith Kumar
2014-07-17 15:19         ` Christoph Lameter
2014-07-17 23:44           ` Pranith Kumar
2014-07-18 14:23             ` Christoph Lameter
     [not found] ` <53C709DD.5060506@gmail.com>
2014-07-17 13:52   ` Christoph Lameter

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=53C7E5C8.9070400@gmail.com \
    --to=bobby.prani@gmail.com \
    --cc=cl@gentwo.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.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.