From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Deacon Subject: Re: [PATCH v4 02/17] sched_clock: Use seqcount instead of rolling our own Date: Fri, 19 Jul 2013 10:03:28 +0100 Message-ID: <20130719090328.GA18139@mudshark.cambridge.arm.com> References: <1374189690-10810-1-git-send-email-sboyd@codeaurora.org> <1374189690-10810-3-git-send-email-sboyd@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:54007 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750822Ab3GSJEb (ORCPT ); Fri, 19 Jul 2013 05:04:31 -0400 Content-Disposition: inline In-Reply-To: <1374189690-10810-3-git-send-email-sboyd@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Stephen Boyd Cc: John Stultz , "linux-kernel@vger.kernel.org" , "linux-arm-msm@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Thomas Gleixner , Russell King , Catalin Marinas , Christopher Covington On Fri, Jul 19, 2013 at 12:21:15AM +0100, Stephen Boyd wrote: > We're going to increase the cyc value to 64 bits in the near > future. Doing that is going to break the custom seqcount > implementation in the sched_clock code because 64 bit numbers > aren't guaranteed to be atomic. Replace the cyc_copy with a > seqcount to avoid this problem. > > Cc: Russell King > Signed-off-by: Stephen Boyd > --- > kernel/time/sched_clock.c | 27 ++++++++------------------- > 1 file changed, 8 insertions(+), 19 deletions(-) Looks good to me. The current scheme would be very fiddly to extend to 64-bit values on 32-bit architectures without cheap atomic doubleword accesses. Acked-by: Will Deacon Will