mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Frederic Weisbecker <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: efault@gmx.de, hpa@zytor.com, peterz@infradead.org,
	tglx@linutronix.de, mingo@kernel.org, paulmck@linux.vnet.ibm.com,
	lcapitulino@redhat.com, linux-kernel@vger.kernel.org,
	cmetcalf@mellanox.com, torvalds@linux-foundation.org,
	cl@linux.com, frederic@kernel.org, riel@redhat.com,
	kernellwp@gmail.com
Subject: [tip:sched/core] nohz: Allow to check if remote CPU tick is stopped
Date: Wed, 21 Feb 2018 02:36:21 -0800	[thread overview]
Message-ID: <tip-22ab8bc02a5f6e8ffc418759894f7a6b0b632331@git.kernel.org> (raw)
In-Reply-To: <1519186649-3242-4-git-send-email-frederic@kernel.org>

Commit-ID:  22ab8bc02a5f6e8ffc418759894f7a6b0b632331
Gitweb:     https://git.kernel.org/tip/22ab8bc02a5f6e8ffc418759894f7a6b0b632331
Author:     Frederic Weisbecker <frederic@kernel.org>
AuthorDate: Wed, 21 Feb 2018 05:17:25 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 21 Feb 2018 09:49:08 +0100

nohz: Allow to check if remote CPU tick is stopped

This check is racy but provides a good heuristic to determine whether
a CPU may need a remote tick or not.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Chris Metcalf <cmetcalf@mellanox.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Wanpeng Li <kernellwp@gmail.com>
Link: http://lkml.kernel.org/r/1519186649-3242-4-git-send-email-frederic@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 include/linux/tick.h     | 2 ++
 kernel/time/tick-sched.c | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/include/linux/tick.h b/include/linux/tick.h
index 86576d9..7f8c9a1 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -114,6 +114,7 @@ enum tick_dep_bits {
 #ifdef CONFIG_NO_HZ_COMMON
 extern bool tick_nohz_enabled;
 extern bool tick_nohz_tick_stopped(void);
+extern bool tick_nohz_tick_stopped_cpu(int cpu);
 extern void tick_nohz_idle_enter(void);
 extern void tick_nohz_idle_exit(void);
 extern void tick_nohz_irq_exit(void);
@@ -125,6 +126,7 @@ extern u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time);
 #else /* !CONFIG_NO_HZ_COMMON */
 #define tick_nohz_enabled (0)
 static inline int tick_nohz_tick_stopped(void) { return 0; }
+static inline int tick_nohz_tick_stopped_cpu(int cpu) { return 0; }
 static inline void tick_nohz_idle_enter(void) { }
 static inline void tick_nohz_idle_exit(void) { }
 
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 0aba041..d479b21 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -486,6 +486,13 @@ bool tick_nohz_tick_stopped(void)
 	return __this_cpu_read(tick_cpu_sched.tick_stopped);
 }
 
+bool tick_nohz_tick_stopped_cpu(int cpu)
+{
+	struct tick_sched *ts = per_cpu_ptr(&tick_cpu_sched, cpu);
+
+	return ts->tick_stopped;
+}
+
 /**
  * tick_nohz_update_jiffies - update jiffies when idle was interrupted
  *

  reply	other threads:[~2018-02-21 10:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-21  4:17 [PATCH 0/7] isolation: 1Hz residual tick offloading v7 Frederic Weisbecker
2018-02-21  4:17 ` [PATCH 1/7] sched: Rename init_rq_hrtick to hrtick_rq_init Frederic Weisbecker
2018-02-21 10:35   ` [tip:sched/core] sched/core: Rename init_rq_hrtick() to hrtick_rq_init() tip-bot for Frederic Weisbecker
2018-02-21  4:17 ` [PATCH 2/7] nohz: Convert tick_nohz_tick_stopped() to bool Frederic Weisbecker
2018-02-21  8:29   ` Thomas Gleixner
2018-02-21 10:35   ` [tip:sched/core] " tip-bot for Frederic Weisbecker
2018-02-21  4:17 ` [PATCH 3/7] nohz: Allow to check if remote CPU tick is stopped Frederic Weisbecker
2018-02-21 10:36   ` tip-bot for Frederic Weisbecker [this message]
2018-02-21  4:17 ` [PATCH 4/7] sched/isolation: Isolate workqueues when "nohz_full=" is set Frederic Weisbecker
2018-02-21 10:36   ` [tip:sched/core] " tip-bot for Frederic Weisbecker
2018-02-21  4:17 ` [PATCH 5/7] sched/isolation: Offload residual 1Hz scheduler tick Frederic Weisbecker
2018-02-21 10:37   ` [tip:sched/core] " tip-bot for Frederic Weisbecker
2018-02-21  4:17 ` [PATCH 6/7] sched/nohz: Remove the 1 Hz tick code Frederic Weisbecker
2018-02-21 10:37   ` [tip:sched/core] " tip-bot for Frederic Weisbecker
2018-02-21  4:17 ` [PATCH 7/7] sched/isolation: Update nohz documentation to explain tick offload Frederic Weisbecker
2018-02-21  8:30   ` Thomas Gleixner
2018-02-21 10:38   ` [tip:sched/core] " tip-bot for Frederic Weisbecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-22ab8bc02a5f6e8ffc418759894f7a6b0b632331@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=cl@linux.com \
    --cc=cmetcalf@mellanox.com \
    --cc=efault@gmx.de \
    --cc=frederic@kernel.org \
    --cc=hpa@zytor.com \
    --cc=kernellwp@gmail.com \
    --cc=lcapitulino@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=riel@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome