linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Rik van Riel <riel@surriel.com>
Cc: linux-kernel@vger.kernel.org,
	Andy Lutomirsky <amluto@amacapital.com>,
	Frederic Weisbecker <fweisbec@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	williams@redhat.com
Subject: Re: [PATCH v2] context_tracking: remove local_irq_save from __acct_update_integrals
Date: Mon, 27 Apr 2015 13:18:42 +0200	[thread overview]
Message-ID: <20150427111842.GA4491@osiris> (raw)
In-Reply-To: <553B8DA9.3060600@surriel.com>

On Sat, Apr 25, 2015 at 08:50:49AM -0400, Rik van Riel wrote:
> On 04/25/2015 05:43 AM, Heiko Carstens wrote:
> > ...the READ_ONCE() doesn't give you any guarantees about reading
> > tsk->acct_timexpd in an atomic way.
> > Well, actually you don't need atomic semantics, but only to make sure that
> > the read access happens with a single instruction, since you want to protect
> > against interrupts.
> > But still: if the size of acct_timexpd is 64 bit READ_ONCE() may still result
> > in two instructions on 32 bit architectures.
> > (or isn't there currently no 32 bit architecture with 64 bit cputime_t left?)
> 
> Even if there is (maybe some ARM system?), can we even guarantee
> that a single instruction to read 64 bits exists on such a system?

I wouldn't bet on it. I can only talk for s390 and there is an instruction
available which would do that. But since s390 is now a 64 bit only architecture
it doesn't matter anyway.
For other architectures I'd say: no, you can't rely on that.


  reply	other threads:[~2015-04-27 11:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-24 15:16 [PATCH v2] context_tracking: remove local_irq_save from __acct_update_integrals Rik van Riel
2015-04-25  9:43 ` Heiko Carstens
2015-04-25 12:50   ` Rik van Riel
2015-04-27 11:18     ` Heiko Carstens [this message]
2015-04-28 12:53       ` Rik van Riel
2015-04-28 13:57         ` Peter Zijlstra

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=20150427111842.GA4491@osiris \
    --to=heiko.carstens@de.ibm.com \
    --cc=amluto@amacapital.com \
    --cc=fweisbec@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=riel@surriel.com \
    --cc=williams@redhat.com \
    /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).