From patchwork Mon Apr 21 09:55:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 28677 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 564952032B for ; Mon, 21 Apr 2014 09:57:05 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id rl12sf26918418iec.6 for ; Mon, 21 Apr 2014 02:57:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=fl+1BcuKmNeoPrx3zpZf7JiyP8i9IfDblTuGw95PHL4=; b=klTSplx7Ypuz7PRJXLy41BpLHovUxkVBnaT2v9eROqsVHy+8AxIhioYtHUr0ph2MX+ 3UgRjkNOFHj7wUpFdz/3w/a4Jo0XI2tJNfzbU9gm0+g90tDw1Pn2tv7C8ID8Kt/UdxXV motRG5oIDjdyGCIqe52mrkKGGW5kNpaz8VmnTW0/RAkrR6XCqaomzrb+h8KhGUhfeIDr +/rSQHftMwdiVkMJszJh4SQ1eOnPVMld5iS3YA26JXxuOIVTYBDzmMsUCtp8BnqunCyR xB7B5f1hDhDhSdhjJFnS0rvzE1v+irAN9RLEc3VN8MaDpLlPE4HJcVEP6fCU3pp6uL1h 2jbQ== X-Gm-Message-State: ALoCoQlZ4yzNEZsMstEB7v7VAvMTKIWJLdeexwzRCwNfkOOZa7yWuKCanp0Ct97DUD/YAAm9f3GS X-Received: by 10.43.126.2 with SMTP id gu2mr15769626icc.0.1398074224738; Mon, 21 Apr 2014 02:57:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.83.115 with SMTP id i106ls2302363qgd.97.gmail; Mon, 21 Apr 2014 02:57:04 -0700 (PDT) X-Received: by 10.58.1.97 with SMTP id 1mr2025804vel.23.1398074224609; Mon, 21 Apr 2014 02:57:04 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id fa16si6181280veb.136.2014.04.21.02.57.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Apr 2014 02:57:04 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.170 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.170; Received: by mail-ve0-f170.google.com with SMTP id pa12so7818464veb.29 for ; Mon, 21 Apr 2014 02:57:04 -0700 (PDT) X-Received: by 10.220.147.16 with SMTP id j16mr30346792vcv.14.1398074224516; Mon, 21 Apr 2014 02:57:04 -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 ib8csp280279vcb; Mon, 21 Apr 2014 02:57:04 -0700 (PDT) X-Received: by 10.69.19.139 with SMTP id gu11mr945850pbd.161.1398074223120; Mon, 21 Apr 2014 02:57:03 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id eg2si20547193pac.387.2014.04.21.02.57.02; Mon, 21 Apr 2014 02:57:02 -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 S1752025AbaDUJ4z (ORCPT + 26 others); Mon, 21 Apr 2014 05:56:55 -0400 Received: from mail-wg0-f45.google.com ([74.125.82.45]:41805 "EHLO mail-wg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751584AbaDUJ4q (ORCPT ); Mon, 21 Apr 2014 05:56:46 -0400 Received: by mail-wg0-f45.google.com with SMTP id l18so2450648wgh.4 for ; Mon, 21 Apr 2014 02:56:45 -0700 (PDT) X-Received: by 10.194.9.8 with SMTP id v8mr1412826wja.53.1398074205516; Mon, 21 Apr 2014 02:56:45 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id g13sm56494372wjn.15.2014.04.21.02.56.42 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 21 Apr 2014 02:56:44 -0700 (PDT) From: Viresh Kumar To: tglx@linutronix.de Cc: linaro-kernel@lists.linaro.org, linaro-networking@linaro.org, linux-kernel@vger.kernel.org, fweisbec@gmail.com, Viresh Kumar Subject: [PATCH V2 14/19] tick-sched: add comment about 'idle_active' in tick_nohz_idle_exit() Date: Mon, 21 Apr 2014 15:25:10 +0530 Message-Id: <387f4713d52595f055620f39dc7a0edad7d4d8bf.1398072824.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: 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.170 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: , The sequence of calls for dynticks CPUs is a bit confusing. Add a comment in tick_nohz_idle_exit() to mention it clearly. All information required is in commit and this conversation with Frederic. https://lkml.org/lkml/2014/4/10/355 Suggested-by: Frederic Weisbecker Signed-off-by: Viresh Kumar --- kernel/time/tick-sched.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 71f64ee..c3aed50 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -922,6 +922,22 @@ void tick_nohz_idle_exit(void) ts->inidle = 0; + /* + * Can idle_active be false here? + * Ideally this would be the sequence of calls: + * - tick_nohz_idle_enter(), i.e. idle_active = true; + * - local_irq_disable() + * - IDLE + * - wake up due to IPI or other interrupt + * - local_irq_enable() + * - tick_nohz_irq_enter(), i.e. idle_active = false; + * - tick_nohz_irq_exit(), i.e. idle_active = true; This is not called + * in case of IPI's as need_resched() will prevent that in + * tick_irq_exit(), as we don't need to account any more for idle time + * or try to enter dyntics mode (We are going to exit idle state). + * + * - tick_nohz_idle_exit() + */ if (ts->idle_active || ts->tick_stopped) now = ktime_get();