From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965923AbbD1Mxy (ORCPT ); Tue, 28 Apr 2015 08:53:54 -0400 Received: from shelob.surriel.com ([74.92.59.67]:35606 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030193AbbD1Mx3 (ORCPT ); Tue, 28 Apr 2015 08:53:29 -0400 Message-ID: <553F82BE.7050808@surriel.com> Date: Tue, 28 Apr 2015 08:53:18 -0400 From: Rik van Riel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Heiko Carstens CC: linux-kernel@vger.kernel.org, Andy Lutomirsky , Frederic Weisbecker , Peter Zijlstra , williams@redhat.com Subject: Re: [PATCH v2] context_tracking: remove local_irq_save from __acct_update_integrals References: <20150424111653.2a87a103@annuminas.surriel.com> <20150425094346.GA5897@osiris> <553B8DA9.3060600@surriel.com> <20150427111842.GA4491@osiris> In-Reply-To: <20150427111842.GA4491@osiris> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/27/2015 07:18 AM, Heiko Carstens wrote: > 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. So what can I do to move forward with this patch? It speeds up syscall entry / exit by 7% when nohz_full is enabled on a CPU... Should I have the irq block compiled in only when sizeof(cputime_t) > sizeof(long) ? -- All rights reversed.