public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hrtimer:Add get_hrtimer_cpu_base()
@ 2024-03-13  5:30 Enlin Mu
  2024-03-14 10:22 ` Thomas Gleixner
  0 siblings, 1 reply; 8+ messages in thread
From: Enlin Mu @ 2024-03-13  5:30 UTC (permalink / raw)
  To: tglx, linux-kernel, enlin.mu, enlinmu; +Cc: linux-hardening

From: Enlin Mu <enlin.mu@unisoc.com>

On the Arm platform,arch_timer may occur irq strom,
By using the next_timer of hrtimer_cpu_base, it is
possible to quickly locate abnormal timers.
As it is an out of tree modules,the function needs
to be exproted.

Signed-off-by: Enlin Mu <enlin.mu@unisoc.com>
---
 include/linux/hrtimer.h | 1 +
 kernel/time/hrtimer.c   | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index aa1e65ccb615..2a37d2a8e808 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -277,6 +277,7 @@ static inline void hrtimer_start(struct hrtimer *timer, ktime_t tim,
 
 extern int hrtimer_cancel(struct hrtimer *timer);
 extern int hrtimer_try_to_cancel(struct hrtimer *timer);
+extern struct hrtimer_cpu_base *get_hrtimer_cpu_base(int cpu);
 
 static inline void hrtimer_start_expires(struct hrtimer *timer,
 					 enum hrtimer_mode mode)
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 70625dff62ce..f7cf7d48b91d 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1309,6 +1309,12 @@ void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
 }
 EXPORT_SYMBOL_GPL(hrtimer_start_range_ns);
 
+struct hrtimer_cpu_base *get_hrtimer_cpu_base(int cpu)
+{
+	return &per_cpu(hrtimer_bases, cpu);
+}
+EXPORT_SYMBOL_GPL(get_hrtimer_cpu_base);
+
 /**
  * hrtimer_try_to_cancel - try to deactivate a timer
  * @timer:	hrtimer to stop
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-03-15  3:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-13  5:30 [PATCH] hrtimer:Add get_hrtimer_cpu_base() Enlin Mu
2024-03-14 10:22 ` Thomas Gleixner
2024-03-14 10:45   ` Enlin Mu
2024-03-14 11:59     ` Thomas Gleixner
2024-03-15  2:07       ` Enlin Mu
2024-03-15  2:20         ` Enlin Mu
2024-03-15  3:12       ` Enlin Mu
2024-03-15  3:41         ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox