lkml.org 
[lkml]   [2015]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] context_tracking: remove local_irq_save from __acct_update_integrals
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.



\
 
 \ /
  Last update: 2015-04-27 13:41    [W:0.066 / U:0.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site