Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751196AbaAENWA (ORCPT ); Sun, 5 Jan 2014 08:22:00 -0500 Received: from mail-wi0-f174.google.com ([209.85.212.174]:61253 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751115AbaAENV6 (ORCPT ); Sun, 5 Jan 2014 08:21:58 -0500 Date: Sun, 5 Jan 2014 14:21:55 +0100 From: Frederic Weisbecker To: Kevin Hilman Cc: Thomas Gleixner , linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, Ingo Molnar , Peter Zijlstra Subject: Re: [PATCH 1/2] sched/nohz: add debugfs control over sched_tick_max_deferment Message-ID: <20140105132153.GA25212@localhost.localdomain> References: <1387315388-31676-1-git-send-email-khilman@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1387315388-31676-1-git-send-email-khilman@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 17, 2013 at 01:23:07PM -0800, Kevin Hilman wrote: > Allow debugfs override of sched_tick_max_deferment in order to ease > finding/fixing the remaining issues with full nohz. > > The value to be written is in jiffies, and -1 means the max deferment > is disabled (scheduler_tick_max_deferment() returns KTIME_MAX.) > > Cc: Frederic Weisbecker > Signed-off-by: Kevin Hilman > --- > kernel/sched/core.c | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index 5ac63c9a995a..4b1fe3e69fe4 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -2175,6 +2175,8 @@ void scheduler_tick(void) > } > > #ifdef CONFIG_NO_HZ_FULL > +static u32 sched_tick_max_deferment = HZ; > + > /** > * scheduler_tick_max_deferment > * > @@ -2193,13 +2195,25 @@ u64 scheduler_tick_max_deferment(void) > struct rq *rq = this_rq(); > unsigned long next, now = ACCESS_ONCE(jiffies); > > - next = rq->last_sched_tick + HZ; > + if (sched_tick_max_deferment == -1) > + return KTIME_MAX; > + > + next = rq->last_sched_tick + sched_tick_max_deferment; > > if (time_before_eq(next, now)) > return 0; > > return jiffies_to_usecs(next - now) * NSEC_PER_USEC; > } > + > +static __init int sched_nohz_full_init_debug(void) > +{ > + debugfs_create_u32("sched_tick_max_deferment", 0644, NULL, > + &sched_tick_max_deferment); > + > + return 0; > +} > +late_initcall(sched_nohz_full_init_debug); If the goal is mostly to turn off sched_tick_max_deferment (set to -1), we should perhaps make it a boolean sched feature (see kernel/sched/features.h) as it's a pretty well consolidated interface. > #endif > > notrace unsigned long get_parent_ip(unsigned long addr) > -- > 1.8.3 > -- 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/