From patchwork Wed Apr 16 05:43: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: 28450 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 318832036A for ; Wed, 16 Apr 2014 05:43:47 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id oz11sf38062569veb.9 for ; Tue, 15 Apr 2014 22:43:47 -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=oGfgQkMu/oohr4fkuFxRrOk7biDtaIrTv7xrgCyPMqA=; b=Veo+yV6a5Zg1sqnZmAoNr+d84xiJXF2BKbNyv7Gz1oUw5OwgxLoTKtld8qsK0vvaMl /EL0rnKUj+pvNgUvW6dKL/utT6hrARPmLflK1nqgevV4SQ7TXMK7iJTx960q75uQAbJK YhXsgvX4kZoSHP0YInNZxFdyrmlAdwz3UWHdU7TWvrsQ7/vfReyfmgZ/epHMbsNYKumo 8crrxy/u5nQZWqUGhdKA/zzPLOAQxDRG492GsOmArz6rzl4nOKBRzuoCxr4Vm5xeMz3v /hTeoZEEZms1D5zhPiniEkiSXOYEDg4277KqG8q1Pt1s4gJ1q3LTbFydIngXCW4LAJrw m7Bg== X-Gm-Message-State: ALoCoQldd3BjJbUxQGT4hUNAJGPeuSd/+Cf2zA09M+uiqhRJa28yCcZBAYD6axNfw1NyQn204hUf X-Received: by 10.224.13.12 with SMTP id z12mr1351516qaz.7.1397627027649; Tue, 15 Apr 2014 22:43:47 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.101.21 with SMTP id t21ls460528qge.1.gmail; Tue, 15 Apr 2014 22:43:47 -0700 (PDT) X-Received: by 10.58.23.6 with SMTP id i6mr4322252vef.12.1397627027563; Tue, 15 Apr 2014 22:43:47 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id tm8si3719891vdc.8.2014.04.15.22.43.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Apr 2014 22:43:47 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 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.172; Received: by mail-vc0-f172.google.com with SMTP id la4so10184328vcb.17 for ; Tue, 15 Apr 2014 22:43:47 -0700 (PDT) X-Received: by 10.52.142.10 with SMTP id rs10mr980826vdb.3.1397627027478; Tue, 15 Apr 2014 22:43:47 -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 ib8csp285620vcb; Tue, 15 Apr 2014 22:43:47 -0700 (PDT) X-Received: by 10.66.216.137 with SMTP id oq9mr6245025pac.97.1397627026567; Tue, 15 Apr 2014 22:43:46 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cz5si9255120pbb.278.2014.04.15.22.43.24; Tue, 15 Apr 2014 22:43:24 -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 S1754571AbaDPFnO (ORCPT + 26 others); Wed, 16 Apr 2014 01:43:14 -0400 Received: from mail-oa0-f44.google.com ([209.85.219.44]:39974 "EHLO mail-oa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752014AbaDPFnL (ORCPT ); Wed, 16 Apr 2014 01:43:11 -0400 Received: by mail-oa0-f44.google.com with SMTP id n16so11929592oag.17 for ; Tue, 15 Apr 2014 22:43:10 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.165.3 with SMTP id yu3mr4934024obb.14.1397626990701; Tue, 15 Apr 2014 22:43:10 -0700 (PDT) Received: by 10.182.28.168 with HTTP; Tue, 15 Apr 2014 22:43:10 -0700 (PDT) In-Reply-To: <20140415124438.GB2438@localhost.localdomain> References: <20140414232218.GE1877@localhost.localdomain> <20140415091323.GK1877@localhost.localdomain> <20140415124438.GB2438@localhost.localdomain> Date: Wed, 16 Apr 2014 11:13:10 +0530 Message-ID: Subject: Re: [PATCH 29/38] tick-sched: remove wrapper around __tick_nohz_task_switch() From: Viresh Kumar To: Frederic Weisbecker Cc: Thomas Gleixner , Lists linaro-kernel , Linux Kernel Mailing List , Arvind Chauhan , Linaro Networking 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.172 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 15 April 2014 18:14, Frederic Weisbecker wrote: > Sure but check out the static_key_false() in the implementation of tick_nohz_full_enabled(). > That's where the magic hides. > No problem, the jump label/static key code is quite tricky. And its use > can be easily missed, as in here. > > Also its unfamous API naming (static_key_true/static_key_true) that is > anything but intuitive. That was tricky enough to be missed on first look :) Okay here is the answer to what you asked earlier: >> In this case probably we can move !can_stop_full_tick() as well to the wrapper ? > > Do you mean moving all the code of __tick_nohz_task_switch() to tick_nohz_task_switch()? > I much prefer we don't do that. This is going to make can_stop_full_tick() a publicly > visible nohz internal. And it may uglify tick.h as well. I probably asked the wrong question, I meant tick_nohz_tick_stopped() instead of !can_stop_full_tick(). Or, can we make the code more efficient by avoiding a branch by doing this: --- 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/include/linux/tick.h b/include/linux/tick.h index 1065a51..12632cc 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h @@ -220,7 +220,7 @@ static inline void tick_nohz_full_check(void) static inline void tick_nohz_task_switch(void) { - if (tick_nohz_full_enabled()) + if (tick_nohz_full_enabled() && tick_nohz_tick_stopped()) __tick_nohz_task_switch(); } diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 45037c4..904e09b 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -273,7 +273,7 @@ void __tick_nohz_task_switch(void) 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);