Received: by 10.223.176.46 with SMTP id f43csp194660wra; Thu, 18 Jan 2018 16:05:28 -0800 (PST) X-Google-Smtp-Source: ACJfBovVVZZY8xfMWhj6xqSYmfePO8Z++brUyvvnLAD/QQbvQWWrHTTWxRCqZVCKBt+mop79z4Sq X-Received: by 2002:a17:902:5a1:: with SMTP id f30-v6mr627213plf.124.1516320328414; Thu, 18 Jan 2018 16:05:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516320328; cv=none; d=google.com; s=arc-20160816; b=VOV/OTJXuF/XutnkELRKti4cdL6akMdLR1PVpQxjME6bikfZqpLlUNJhUkL40Ch0hY MVE6cJ2ttN49nsaX5bxDVTO3TKexci5qM0OCHumETRl9Kszb2/pNXLCq0Uar607CO02z 2OG39gB0X5YPiHgapU/WZWYTu5CVpcW58qK3+j0PdJCAuijLo+hj1w+38WI0dxLYqkSb 2i8g9G4umjqsv8upN5hEIdenyMLNgN/6y7+/9SOezW7FQu0Cf5dMkysnyz2NKd3FfONM upzbmbW/LliOX9oa9hOVklBLWo2ErDRc8hu27sojsITAEhaALVndZxYBm0zOWGNVWVjB cukQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:arc-authentication-results; bh=pZf5nHoQnSSrcu5F+gT6C52ZXmadivYqxJ4UJE6G258=; b=X9YwamrOaBK50Fddh7GJOOGJc26cnU9Qehgl/GC5ZA1GBCZzAstTa4jJdyjF9xxu81 5dSTxpYUU0g7w5t9nFzPdHvwMjPBRnD+DFfpByUKMpz5jPKpmzVF70yUFfSzUtYJuX6y zA0uz2UrHUbXjlsY4E0ocqK0nGblCZcZxqdO2X1rxgqpLCqFQvuRgpuvWXCfytfhvDy4 iLV4thkrKmsAKFTLepRrDNpaGoqXzdEYOsLI/oPCklsgCosoUqmOOQmgfIsdwkVAtBMF pcLnUn/rKiPfqSo5xYkcq0vMvG+Rq2t91fD1gHMo4l8iQSnQ977HQABryibE4S5KBcD5 cC3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si7186452pgb.461.2018.01.18.16.05.14; Thu, 18 Jan 2018 16:05:28 -0800 (PST) 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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755343AbeASADz (ORCPT + 99 others); Thu, 18 Jan 2018 19:03:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:39210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755012AbeASAC7 (ORCPT ); Thu, 18 Jan 2018 19:02:59 -0500 Received: from localhost.localdomain (i16-les03-th2-31-37-47-191.sfr.lns.abo.bbox.fr [31.37.47.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 98CF12176E; Fri, 19 Jan 2018 00:02:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 98CF12176E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=frederic@kernel.org From: Frederic Weisbecker To: Ingo Molnar Cc: LKML , Frederic Weisbecker , Peter Zijlstra , Chris Metcalf , Thomas Gleixner , Luiz Capitulino , Christoph Lameter , "Paul E . McKenney" , Wanpeng Li , Mike Galbraith , Rik van Riel Subject: [PATCH 5/6] sched/nohz: Remove the 1 Hz tick code Date: Fri, 19 Jan 2018 01:02:19 +0100 Message-Id: <1516320140-13189-6-git-send-email-frederic@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516320140-13189-1-git-send-email-frederic@kernel.org> References: <1516320140-13189-1-git-send-email-frederic@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that the 1Hz tick is offloaded to workqueues, we can safely remove the residual code that used to handle it locally. Signed-off-by: Frederic Weisbecker Cc: Chris Metcalf Cc: Christoph Lameter Cc: Luiz Capitulino Cc: Mike Galbraith Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Cc: Wanpeng Li Cc: Ingo Molnar --- include/linux/sched/nohz.h | 4 ---- kernel/sched/core.c | 29 ----------------------------- kernel/sched/idle_task.c | 1 - kernel/sched/sched.h | 11 +---------- kernel/time/tick-sched.c | 6 ------ 5 files changed, 1 insertion(+), 50 deletions(-) diff --git a/include/linux/sched/nohz.h b/include/linux/sched/nohz.h index 3d3a97d..0942172 100644 --- a/include/linux/sched/nohz.h +++ b/include/linux/sched/nohz.h @@ -37,8 +37,4 @@ extern void wake_up_nohz_cpu(int cpu); static inline void wake_up_nohz_cpu(int cpu) { } #endif -#ifdef CONFIG_NO_HZ_FULL -extern u64 scheduler_tick_max_deferment(void); -#endif - #endif /* _LINUX_SCHED_NOHZ_H */ diff --git a/kernel/sched/core.c b/kernel/sched/core.c index c79500c..cbc3001 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3033,35 +3033,9 @@ void scheduler_tick(void) rq->idle_balance = idle_cpu(cpu); trigger_load_balance(rq); #endif - rq_last_tick_reset(rq); } #ifdef CONFIG_NO_HZ_FULL -/** - * scheduler_tick_max_deferment - * - * Keep at least one tick per second when a single - * active task is running because the scheduler doesn't - * yet completely support full dynticks environment. - * - * This makes sure that uptime, CFS vruntime, load - * balancing, etc... continue to move forward, even - * with a very low granularity. - * - * Return: Maximum deferment in nanoseconds. - */ -u64 scheduler_tick_max_deferment(void) -{ - struct rq *rq = this_rq(); - unsigned long next, now = READ_ONCE(jiffies); - - next = rq->last_sched_tick + HZ; - - if (time_before_eq(next, now)) - return 0; - - return jiffies_to_nsecs(next - now); -} struct tick_work { int cpu; @@ -6028,9 +6002,6 @@ void __init sched_init(void) rq->last_load_update_tick = jiffies; rq->nohz_flags = 0; #endif -#ifdef CONFIG_NO_HZ_FULL - rq->last_sched_tick = 0; -#endif #endif /* CONFIG_SMP */ hrtick_rq_init(rq); atomic_set(&rq->nr_iowait, 0); diff --git a/kernel/sched/idle_task.c b/kernel/sched/idle_task.c index d518664..a64fc92 100644 --- a/kernel/sched/idle_task.c +++ b/kernel/sched/idle_task.c @@ -48,7 +48,6 @@ dequeue_task_idle(struct rq *rq, struct task_struct *p, int flags) static void put_prev_task_idle(struct rq *rq, struct task_struct *prev) { - rq_last_tick_reset(rq); } static void task_tick_idle(struct rq *rq, struct task_struct *curr, int queued) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 5a3b82c..9a25047 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -699,9 +699,7 @@ struct rq { #endif /* CONFIG_SMP */ unsigned long nohz_flags; #endif /* CONFIG_NO_HZ_COMMON */ -#ifdef CONFIG_NO_HZ_FULL - unsigned long last_sched_tick; -#endif + /* capture load from *all* tasks on this cpu: */ struct load_weight load; unsigned long nr_load_updates; @@ -1639,13 +1637,6 @@ static inline void sub_nr_running(struct rq *rq, unsigned count) sched_update_tick_dependency(rq); } -static inline void rq_last_tick_reset(struct rq *rq) -{ -#ifdef CONFIG_NO_HZ_FULL - rq->last_sched_tick = jiffies; -#endif -} - extern void update_rq_clock(struct rq *rq); extern void activate_task(struct rq *rq, struct task_struct *p, int flags); diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 97c4317..03ebe89 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -748,12 +748,6 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts, delta = KTIME_MAX; } -#ifdef CONFIG_NO_HZ_FULL - /* Limit the tick delta to the maximum scheduler deferment */ - if (!ts->inidle) - delta = min(delta, scheduler_tick_max_deferment()); -#endif - /* Calculate the next expiry time */ if (delta < (KTIME_MAX - basemono)) expires = basemono + delta; -- 2.7.4