From patchwork Mon Apr 14 16:23:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 28345 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f200.google.com (mail-ig0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7899A20534 for ; Mon, 14 Apr 2014 16:27:49 +0000 (UTC) Received: by mail-ig0-f200.google.com with SMTP id l13sf12793707iga.3 for ; Mon, 14 Apr 2014 09:27:48 -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=0zAh/c1u2W5yewmm9FD17hF1LM8zVY7rhIl/9IbIX1Y=; b=XRINIzzRzRid84mdUpNRF6XRFD2+TzZorcL5oiRk7Qc6mfMcvNXagp2lluZoHlD7Nj Ie2IJkPWSuc0NZr/fdFNYtiB7Uq7cNmyJj71C4qUwUCLOlw3iXZZ4c0Re0QHmXg6b+r2 mRgm+S8dwaacBkUbCYv24QNIVC5gwEeW1N9Q63oqip3+yq2ptdkp6IWGGNLsOPcTDF8L 6i4Df8Sgsx7euCEBT2OGxxTcbcDj/9NzgOkYGlgZ5B56ShMBLCVZTksuRiiT5t2B4OKG hmFBW1QueNM7dULglMJtWKT7BSUVbuskCuAV6iBBoBT5egxHvyTOF2U0YzTvbHsce8+9 owWw== X-Gm-Message-State: ALoCoQkFBRrB1JZS5guY4RWviMu8MXp2wu/Q1HFRkjRAPqN+H5qdO0RT4oFl5rqWxTlxgMDkOq29 X-Received: by 10.182.226.163 with SMTP id rt3mr21210470obc.13.1397492868891; Mon, 14 Apr 2014 09:27:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.84.103 with SMTP id k94ls803327qgd.30.gmail; Mon, 14 Apr 2014 09:27:48 -0700 (PDT) X-Received: by 10.220.59.65 with SMTP id k1mr3684995vch.22.1397492868661; Mon, 14 Apr 2014 09:27:48 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id u5si2830933vdo.94.2014.04.14.09.27.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Apr 2014 09:27:48 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.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.220.178; Received: by mail-vc0-f178.google.com with SMTP id im17so8009505vcb.9 for ; Mon, 14 Apr 2014 09:27:48 -0700 (PDT) X-Received: by 10.52.175.166 with SMTP id cb6mr30995037vdc.1.1397492868573; Mon, 14 Apr 2014 09:27:48 -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 ib8csp162881vcb; Mon, 14 Apr 2014 09:27:48 -0700 (PDT) X-Received: by 10.66.164.201 with SMTP id ys9mr45280381pab.40.1397492867879; Mon, 14 Apr 2014 09:27:47 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yl4si9142538pbc.212.2014.04.14.09.27.47; Mon, 14 Apr 2014 09:27:47 -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 S1755398AbaDNQ1d (ORCPT + 26 others); Mon, 14 Apr 2014 12:27:33 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:38343 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753360AbaDNQ12 (ORCPT ); Mon, 14 Apr 2014 12:27:28 -0400 Received: by mail-pd0-f173.google.com with SMTP id z10so8257927pdj.4 for ; Mon, 14 Apr 2014 09:27:28 -0700 (PDT) X-Received: by 10.66.231.40 with SMTP id td8mr44965776pac.103.1397492848043; Mon, 14 Apr 2014 09:27:28 -0700 (PDT) Received: from localhost ([122.167.126.16]) by mx.google.com with ESMTPSA id v1sm34782523pbl.1.2014.04.14.09.27.24 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 14 Apr 2014 09:27:27 -0700 (PDT) From: Viresh Kumar To: tglx@linutronix.de Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, fweisbec@gmail.com, Arvind.Chauhan@arm.com, linaro-networking@linaro.org, Viresh Kumar Subject: [PATCH 29/38] tick-sched: remove wrapper around __tick_nohz_task_switch() Date: Mon, 14 Apr 2014 21:53:51 +0530 Message-Id: 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.220.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: , __tick_nohz_task_switch() was called only from tick_nohz_task_switch() and there is nothing much in tick_nohz_task_switch() as well. IOW, we don't need unnecessary wrapper over __tick_nohz_task_switch() to be there. Merge all code from __tick_nohz_task_switch() into tick_nohz_task_switch() and move it to tick-sched.c. This also moves check for tick_nohz_tick_stopped() outside of irq_save() context. Signed-off-by: Viresh Kumar --- include/linux/tick.h | 11 ++--------- kernel/time/tick-sched.c | 7 +++++-- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/include/linux/tick.h b/include/linux/tick.h index 1065a51..585be84 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h @@ -201,7 +201,7 @@ extern void tick_nohz_init(void); extern void __tick_nohz_full_check(void); extern void tick_nohz_full_kick(void); extern void tick_nohz_full_kick_all(void); -extern void __tick_nohz_task_switch(void); +extern void tick_nohz_task_switch(void); #else static inline void tick_nohz_init(void) { } static inline bool tick_nohz_full_enabled(void) { return false; } @@ -209,7 +209,7 @@ static inline bool tick_nohz_full_cpu(int cpu) { return false; } static inline void __tick_nohz_full_check(void) { } static inline void tick_nohz_full_kick(void) { } static inline void tick_nohz_full_kick_all(void) { } -static inline void __tick_nohz_task_switch(void) { } +static inline void tick_nohz_task_switch(void) { } #endif static inline void tick_nohz_full_check(void) @@ -218,11 +218,4 @@ static inline void tick_nohz_full_check(void) __tick_nohz_full_check(); } -static inline void tick_nohz_task_switch(void) -{ - if (tick_nohz_full_enabled()) - __tick_nohz_task_switch(); -} - - #endif diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 5f7796d..d8b9a69 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -266,13 +266,16 @@ void tick_nohz_full_kick_all(void) * It might need the tick due to per task/process properties: * perf events, posix cpu timers, ... */ -void __tick_nohz_task_switch(void) +void tick_nohz_task_switch(void) { unsigned long flags; + if (!tick_nohz_full_enabled() || !tick_nohz_tick_stopped()) + return; + local_irq_save(flags); - if (tick_nohz_tick_stopped() && !can_stop_full_tick()) + if (!can_stop_full_tick()) tick_nohz_full_kick(); local_irq_restore(flags);