[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1566281669-48212-3-git-send-email-longli@linuxonhyperv.com>
Date: Mon, 19 Aug 2019 23:14:28 -0700
From: longli@...uxonhyperv.com
To: Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Keith Busch <keith.busch@...el.com>, Jens Axboe <axboe@...com>,
Christoph Hellwig <hch@....de>,
Sagi Grimberg <sagi@...mberg.me>,
linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: Long Li <longli@...rosoft.com>
Subject: [PATCH 2/3] sched: export idle_cpu()
From: Long Li <longli@...rosoft.com>
This function is useful for device drivers to check if this CPU has work to
do in process context.
Signed-off-by: Long Li <longli@...rosoft.com>
---
include/linux/sched.h | 1 +
kernel/sched/core.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 575f1ef7b159..a209941c1770 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1501,6 +1501,7 @@ current_restore_flags(unsigned long orig_flags, unsigned long flags)
extern int cpuset_cpumask_can_shrink(const struct cpumask *cur, const struct cpumask *trial);
extern int task_can_attach(struct task_struct *p, const struct cpumask *cs_cpus_allowed);
extern u64 get_cpu_rq_switches(int cpu);
+extern int idle_cpu(int cpu);
#ifdef CONFIG_SMP
extern void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask);
extern int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask);
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 1a76f0e97c2d..d1cedfb38174 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4023,6 +4023,7 @@ int idle_cpu(int cpu)
return 1;
}
+EXPORT_SYMBOL_GPL(idle_cpu);
/**
* available_idle_cpu - is a given CPU idle for enqueuing work.
--
2.17.1
Powered by blists - more mailing lists