linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: percpu: Make this_cpu accessors pre-empt safe
Date: Fri, 20 Mar 2015 18:02:29 +0000	[thread overview]
Message-ID: <20150320180228.GI1474@arm.com> (raw)
In-Reply-To: <20150319163955.GG25967@leverpostej>

On Thu, Mar 19, 2015 at 04:39:55PM +0000, Mark Rutland wrote:
> On Thu, Mar 19, 2015 at 04:27:53PM +0000, Will Deacon wrote:
> >   (3) Preemption isn't actually an issue here -- CPU migration is. I'd
> >       expect that to be a lot rarer.
> 
> That's not true: in a read-modify-cmpxchg loop (even on a UP system) if
> you get preempted at the end of the read and another thread modifies
> your datastructure, then your subsequent cmpxchg will fail. So any
> preemption could cause you to have to retry, so you want to miminise
> potential preemptions.
> 
> Note that this is a performance argument rather than a correctness
> argument.

My argument is more that a migration will always break the cmpxchg, whereas
preemption doesn't necessarily.

Steve -- can you respin this using preempt_enable everywhere please?

Will

  reply	other threads:[~2015-03-20 18:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 14:52 [PATCH] arm64: percpu: Make this_cpu accessors pre-empt safe Steve Capper
2015-03-19 15:44 ` Mark Rutland
2015-03-19 15:55   ` Steve Capper
2015-03-19 16:23     ` Mark Rutland
2015-03-19 16:00   ` Will Deacon
2015-03-19 16:11     ` Mark Rutland
2015-03-19 16:27       ` Will Deacon
2015-03-19 16:39         ` Mark Rutland
2015-03-20 18:02           ` Will Deacon [this message]
2015-03-22 14:51             ` [PATCH V2] " Steve Capper
2015-03-23 10:17               ` Will Deacon

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=20150320180228.GI1474@arm.com \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).