From dcdec80d6bb8a786f5d5b24b4af51e0e15c534a9 Mon Sep 17 00:00:00 2001 From: Qais Yousef Date: Wed, 3 Apr 2024 19:26:59 +0000 Subject: [PATCH] ANDROID: Export cpu_busy_with_softirqs() This function used to be called task_may_not_preempt() in older versions and used by modules that have their extension to RT. Export it to allow users to continue to use it. Bug: 332629555 Signed-off-by: Qais Yousef Change-Id: I04affb8e9e6258f9fb36ebab4d7956a265e9e299 --- kernel/sched/rt.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 2e1e83ff4c80..7d9fec642662 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -1636,7 +1636,7 @@ static int find_lowest_rq(struct task_struct *task); * task is likely to block preemptions soon because it is a * ksoftirq thread that is handling softirqs. */ -static bool cpu_busy_with_softirqs(int cpu) +bool cpu_busy_with_softirqs(int cpu) { u32 softirqs = per_cpu(active_softirqs, cpu) | __cpu_softirq_pending(cpu); @@ -1644,11 +1644,12 @@ static bool cpu_busy_with_softirqs(int cpu) return softirqs & LONG_SOFTIRQ_MASK; } #else -static bool cpu_busy_with_softirqs(int cpu) +bool cpu_busy_with_softirqs(int cpu) { return false; } #endif /* CONFIG_RT_SOFTIRQ_AWARE_SCHED */ +EXPORT_SYMBOL_GPL(cpu_busy_with_softirqs); static bool rt_task_fits_cpu(struct task_struct *p, int cpu) { @@ -3168,3 +3169,5 @@ void print_rt_stats(struct seq_file *m, int cpu) rcu_read_unlock(); } #endif /* CONFIG_SCHED_DEBUG */ + +extern bool cpu_busy_with_softirqs(int cpu);