From patchwork Wed Apr 16 04:20:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 28447 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6E0F52036A for ; Wed, 16 Apr 2014 04:20:54 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id fp1sf35584005pdb.9 for ; Tue, 15 Apr 2014 21:20:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=cIyC7dNYChRrRNb4mnS67COMr3Z3e1f9MqF8dcPhVOA=; b=KqLG9ZpXJ2/a9KrscAvq9L6NykrghMNqURMlhawKjJs6uvT3rdbROojj391cJmmnPq DxXCj/vUl+16UL1LJMYO9ejRVb5Nhg6i/ozREpEPODoPmymdTUWy/aRYiWQk1Cnmbnqb 9YYEFtifow3DE4CPYiC+25YwzGYdamcCIb72pzmDdd8WKCBYEX62qWH03W/ydr5jnUb1 Uf0q2jUdD5AtESl31Z79g4OY9s8W8sBJ+2BWFm1oEe0uYhq1CeYG3D8s4G7SaDtugeUp 6T5sF4oo+dNELE2llesg4QrrK1cSDBVH3KVhomGYxU8mne/E9p4HC2RBnZ2CeYK6GjKQ RXfA== X-Gm-Message-State: ALoCoQlaSNNxU3OMalBNox/xHnxaEAwVrqsl7qAGk/tQEFiP/0Chk4Gi2UYQaY9hbMGVtZqpuhuI X-Received: by 10.66.65.109 with SMTP id w13mr2724230pas.21.1397622053636; Tue, 15 Apr 2014 21:20:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.82.231 with SMTP id h94ls431240qgd.61.gmail; Tue, 15 Apr 2014 21:20:53 -0700 (PDT) X-Received: by 10.58.123.71 with SMTP id ly7mr4071806veb.11.1397622053524; Tue, 15 Apr 2014 21:20:53 -0700 (PDT) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by mx.google.com with ESMTPS id wd2si3702477veb.59.2014.04.15.21.20.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Apr 2014 21:20:53 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.178; Received: by mail-ve0-f178.google.com with SMTP id jw12so9972149veb.23 for ; Tue, 15 Apr 2014 21:20:53 -0700 (PDT) X-Received: by 10.58.225.233 with SMTP id rn9mr40278vec.53.1397622053440; Tue, 15 Apr 2014 21:20:53 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp281661vcb; Tue, 15 Apr 2014 21:20:53 -0700 (PDT) X-Received: by 10.68.231.35 with SMTP id td3mr5940087pbc.137.1397622052570; Tue, 15 Apr 2014 21:20:52 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tv5si11951076pbc.330.2014.04.15.21.20.51; Tue, 15 Apr 2014 21:20:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754423AbaDPEUk (ORCPT + 26 others); Wed, 16 Apr 2014 00:20:40 -0400 Received: from mail-ob0-f182.google.com ([209.85.214.182]:54242 "EHLO mail-ob0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754396AbaDPEUh (ORCPT ); Wed, 16 Apr 2014 00:20:37 -0400 Received: by mail-ob0-f182.google.com with SMTP id uz6so11962251obc.27 for ; Tue, 15 Apr 2014 21:20:36 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.125.161 with SMTP id mr1mr70335obb.47.1397622036730; Tue, 15 Apr 2014 21:20:36 -0700 (PDT) Received: by 10.182.28.168 with HTTP; Tue, 15 Apr 2014 21:20:36 -0700 (PDT) In-Reply-To: References: <80afb18a494b0bd9710975bcc4de134ae323c74f.1397537987.git.viresh.kumar@linaro.org> Date: Wed, 16 Apr 2014 09:50:36 +0530 Message-ID: Subject: Re: [PATCH V1 Resend 4/5] tick-sched: don't call update_wall_time() when delta is lesser than tick_period From: Viresh Kumar To: Thomas Gleixner Cc: Lists linaro-kernel , LKML , Frederic Weisbecker , Arvind Chauhan , Linaro Networking , John Stultz Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On 16 April 2014 00:14, Thomas Gleixner wrote: > On Tue, 15 Apr 2014, Viresh Kumar wrote: > >> In tick_do_update_jiffies64() we are processing ticks only if delta is greater >> than tick_period. This is what we are supposed to do here and it broke a bit >> with this patch: >> >> commit 47a1b796306356f358e515149d86baf0cc6bf007 >> Author: John Stultz >> Date: Thu Dec 12 13:10:55 2013 -0800 >> >> tick/timekeeping: Call update_wall_time outside the jiffies lock > > Please look how I massaged the change log. There is no point in > copying the whole gunk. I see.. Nice. >> With above patch, we might end up calling update_wall_time() even if delta is >> found to be smaller that tick_period. Fix this by reversing the check and >> returning early. > > Well. > >> Cc: # v3.14+ >> Cc: John Stultz >> Signed-off-by: Viresh Kumar >> --- >> kernel/time/tick-sched.c | 32 +++++++++++++++++--------------- >> 1 file changed, 17 insertions(+), 15 deletions(-) > > That's not how we do bug fixes if they can be done with 3 lines of > change. See the commit. I tried that initially but with these changes as well (which must be done now ??), which probably makes it more clear ?: --- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 3cafe7d..0e70b1c 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -84,12 +84,12 @@ static void tick_do_update_jiffies64(ktime_t now) /* Keep the tick_next_period variable up to date */ tick_next_period = ktime_add(last_jiffies_update, tick_period); + + write_sequnlock(&jiffies_lock); + update_wall_time(); } else { write_sequnlock(&jiffies_lock); - return; } - write_sequnlock(&jiffies_lock); - update_wall_time(); } /*