Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2521345pxv; Sun, 27 Jun 2021 00:30:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoiSicYyvByPWRW97yLG+nBk0ZTpHdjawbGZkmHlga7eKmL0USpbSnJsdiD8kB0KJ9pT3F X-Received: by 2002:a02:641:: with SMTP id 62mr17102450jav.125.1624779031134; Sun, 27 Jun 2021 00:30:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624779031; cv=none; d=google.com; s=arc-20160816; b=mzfu9ZCW5+lX4XNBG05R9uCS0K+W3go3OPTXBmKnnYPw913JuiGR7vouR6gy428iLg bQh6BBO2LbwYGKmciSuvq2+ArO9NIkHR8vuNlIYgnU9YyVlVMYCfaMv1toO7GGkPghHO 64j4Lg0lY9cAWesrNyBta9lPcYkf/le8dutDxv5ofkN5hhEmX7GOomyvks1Z6tiymmU0 lTgoG3drSIUbQoxbTLDcJISQJtBC1yCumqFXUalEXetjhx7YcjSwFb628ceMx0Egoay2 hrPwkpANftf1OfLHLxU1D8aqZUNiYjP6r+0PnH4LOhmhg+QbDNwrI4Kdk48OnrbZr4cU UCaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=90yc8ERBtTGvPRz+l3K+T9KPtKwKwwOE79jyoGwACLc=; b=W/9xMb5U8ycYokmtMcyHXL9d+CAJG2ydMIdihPmmiWGHTeRDeSErda9SEpbqvshYIL FpAZ7dDk6xw6WTX5FieoH4/YWwz9/T3Ezi8fsfyZXf6JsbqaQqMhkqJH2YFcSh1E3O0m vbcjUBztrLMBKjavVgmTpW1l6N52XynSw0W+Wh+gvlGA6DJiGYyLemLKTxK342aBEdPK 4oLF+3iOh8rbAj0k6K5Bw0g6fBslLEBAXm8/VwHLuYuvK+exMSRVA4aMHvDtgd95Ejon 3QWtic2nBjM3r/r76Gr6FUNpSE0UqbVhMdxIGxS8v3BCBQIZiaZWcZfcbcQ7G+oKxxCm 0wUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@anisinha-ca.20150623.gappssmtp.com header.s=20150623 header.b=qhQwcD0j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p31si14535131jac.95.2021.06.27.00.30.19; Sun, 27 Jun 2021 00:30:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@anisinha-ca.20150623.gappssmtp.com header.s=20150623 header.b=qhQwcD0j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230013AbhF0HbG (ORCPT + 99 others); Sun, 27 Jun 2021 03:31:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229924AbhF0HbF (ORCPT ); Sun, 27 Jun 2021 03:31:05 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BE22C061574 for ; Sun, 27 Jun 2021 00:28:42 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id bb20so8029099pjb.3 for ; Sun, 27 Jun 2021 00:28:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anisinha-ca.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=90yc8ERBtTGvPRz+l3K+T9KPtKwKwwOE79jyoGwACLc=; b=qhQwcD0jq6KPfdwgNsS3f8raiI8bp5JiBC4OeCk3auMe7COx6IJCMaCXEZV2pxFh6M 7uH1SbWP6tmn1l7i3m+mmyaTEjhM/007qFf/KuoUTu5TnBahTPNwceeZu+jqV4iKCxjF zvnUWdX/1TdBwx+lWx0Bbkz8kj7ZjDjVcuRG9qHhJTEWcOqrwxDHbqFsK9mFniRqTcWf FBB1LRukgK+S3393eoFO9VFnT8YBHTwYIXUv9KLX4n/RphwzywowAPNrq3EF9WdcdZYK R4gScqKnxwnLn5oqc/AzFFuGzLDBvhueCjcHlhwvD+FiN7BV6kIeoJXRgC3JA4ya0p1b SAow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=90yc8ERBtTGvPRz+l3K+T9KPtKwKwwOE79jyoGwACLc=; b=YOjYLg8OguYbQB92JC3oqnmlMHhDHnSkusYQjRxH43JqwapBeBVWxbY9SSToAXJIgR EK9AaBXyO+YMVzPt/7O7Xspg2TJthe085BfoqfsfMzaXufNPYKADkBcFtWE8Vi3QFGUe qnPUn4g+3JRcYlBWa7b0fnRlWDPjxOwNZEiy0Gw/ua95alnheYDzMLXi4CMHyUFcLPpW V70wWe7QNRZuGvAHwn5wMU/UHIh8MxVfTYifg54w1i2fAgCPwXpY+0qw/oXt6j39CtNE qONQa+E/pyOCtRRYnNlwMWbi5a3+iB5z9m0AtgVp3+iZu8pgebBtgeG99zsn67eRD+3+ dMcA== X-Gm-Message-State: AOAM532GtXcsTAiykY5rsf6mOwm8DEa8K5vlM5qxo43poWw61p8hkYD/ YSq0KARfasVCff96nw6lyEidxOsBOnrv3w== X-Received: by 2002:a17:90a:2f41:: with SMTP id s59mr21260336pjd.19.1624778921142; Sun, 27 Jun 2021 00:28:41 -0700 (PDT) Received: from anisinha-lenovo.ba.nuagenetworks.net ([115.96.154.39]) by smtp.googlemail.com with ESMTPSA id l10sm15678496pjg.26.2021.06.27.00.28.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Jun 2021 00:28:40 -0700 (PDT) From: Ani Sinha To: linux-kernel@vger.kernel.org Cc: anirban.sinha@nokia.com, tglx@linutronix.de, Ani Sinha , Frederic Weisbecker , Ingo Molnar Subject: [PATCH v1] Add info log when user enables NOHZ in commandline but NOHZ is not possible Date: Sun, 27 Jun 2021 12:58:33 +0530 Message-Id: <20210627072833.2199463-1-ani@anisinha.ca> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 4f49b90abb4aca ("sched-clock: Migrate to use new tick dependency mask model") had also removed the kernel warning message informing the user that it was not possible to turn on NO_HZ_FULL. This warning was added in commit e12d0271774fe ("nohz: Warn if the machine can not perform nohz_full") in order to warn users when they enabled NOHZ using the kernel commandline but kernel could not enable NOHZ. Removal of this log defeats this purpose because we still do not want users thinking that they are getting the benefit of nohz when their machine can not support it. Hence this patch brings back the information log. If at some point the conditions that prevented NOHZ from being enabled goes away and the previous info log was printed, we print another log informing the user that NOHZ was again possible. Signed-off-by: Ani Sinha --- kernel/time/tick-sched.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) See also thread: https://lkml.org/lkml/2021/6/20/32 diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 828b091501ca..fbef95b57b1d 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -930,6 +930,7 @@ static void tick_nohz_full_update_tick(struct tick_sched *ts) { #ifdef CONFIG_NO_HZ_FULL int cpu = smp_processor_id(); + static bool no_tick_warned; if (!tick_nohz_full_cpu(cpu)) return; @@ -937,10 +938,24 @@ static void tick_nohz_full_update_tick(struct tick_sched *ts) if (!ts->tick_stopped && ts->nohz_mode == NOHZ_MODE_INACTIVE) return; - if (can_stop_full_tick(cpu, ts)) + if (can_stop_full_tick(cpu, ts)) { tick_nohz_stop_sched_tick(ts, cpu); - else if (ts->tick_stopped) - tick_nohz_restart_sched_tick(ts, ktime_get()); + if (no_tick_warned) { + pr_info("NO_HZ_FULL is now enabled in the system.\n"); + no_tick_warned = false; + } + } else { + /* + * Don't allow the user to think they can get + * full NO_HZ with this machine. + */ + if (!no_tick_warned && tick_nohz_full_running) { + pr_info("NO_HZ_FULL has been disabled in the system."); + no_tick_warned = true; + } + if (ts->tick_stopped) + tick_nohz_restart_sched_tick(ts, ktime_get()); + } #endif } -- 2.25.1