sched: Fix tracepoint called from set_tsk_need_resched() more
PATCH 1/1 sched: Fix tracepoint called from set_tsk_need_resched() more
This raw tracepoint is added to set_tsk_need_resched() which introduces two symbols which were then exported GPL-only. While generally better to add new symbols GPL-only, set_tsk_need_resched() is called from places that are exported without that restriction. This includes things like wake_up_process(). Export these new symbols without the added restriction.
---
This is against tip:sched/core (377521af0341).
kernel/sched/core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
kernel/sched/core.c +4 -2
@@ -121,7 +121,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(sched_update_nr_running_tp);EXPORT_TRACEPOINT_SYMBOL_GPL (sched_compute_energy_tp);EXPORT_TRACEPOINT_SYMBOL_GPL (sched_entry_tp);EXPORT_TRACEPOINT_SYMBOL_GPL (sched_exit_tp); -EXPORT_TRACEPOINT_SYMBOL_GPL (sched_set_need_resched_tp); +/* This needs non-GPL-only. It's called from other non-GPL-only exports (e.g. wake_up_process()) */ +EXPORT_TRACEPOINT_SYMBOL (sched_set_need_resched_tp); DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); DEFINE_PER_CPU(struct rnd_state, sched_rnd_state);
@@ -1139,7 +1140,8 @@ void __trace_set_need_resched(struct task_struct *curr, int tif) {trace_sched_set_need_resched_tp (curr,smp_processor_id (), tif); } -EXPORT_SYMBOL_GPL (__trace_set_need_resched); +/* This needs non-GPL-only. It's called from other non-GPL-only exports (e.g. wake_up_process()) */ +EXPORT_SYMBOL (__trace_set_need_resched);void resched_curr (struct rq *rq) {
Signature · 1 line
2.52.0
Quoted 9 lines · Phil Auld
This raw tracepoint is added to
set_tsk_need_resched()which introduces
two symbols which were then exported GPL-only. While generally better to add new symbols GPL-only,set_tsk_need_resched()is called from places
that are exported without that restriction. This includes things likewake_up_process(). Export these new symbols without the added restriction.
Quoted 5 lines
Fixes 8d737320166b ("sched: Fix build for modules using
set_tsk_need_resched()")Fixes 6c125b85f3c8 ("sched: Export hidden tracepoints to modules")Fixes adcc3bfa8806 ("sched: Adapt sched tracepoints for RV taskmodel")
Looks good to me, thanks!
Quoted 40 lines
Signed-off-by Phil Auld <[email protected]>---
This is against tip:sched/core (
377521af0341).kernel/sched/core.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)kernel/sched/core.c +1
-1@@ -121,7 +121,8 @@EXPORT_TRACEPOINT_SYMBOL_GPL (sched_update_nr_running_tp); EXPORT_TRACEPOINT_SYMBOL_GPL(sched_compute_energy_tp); EXPORT_TRACEPOINT_SYMBOL_GPL(sched_entry_tp); EXPORT_TRACEPOINT_SYMBOL_GPL(sched_exit_tp); -EXPORT_TRACEPOINT_SYMBOL_GPL (sched_set_need_resched_tp); +/* This needs non-GPL-only. It's called from other non-GPL-only exports (e.g.
wake_up_process()) */ +EXPORT_TRACEPOINT_SYMBOL(sched_set_need_resched_tp);
DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);DEFINE_PER_CPU(struct rnd_state, sched_rnd_state);kernel/sched/core.c +1
-1@@ -1139,7 +1140,8 @@ void __trace_set_need_resched(struct task_struct *curr, int tif) { trace_sched_set_need_resched_tp(curr, smp_processor_id(),tif ); } -EXPORT_SYMBOL_GPL (__trace_set_need_resched); +/* This needs non-GPL-only. It's called from other non-GPL-only exports (e.g.
wake_up_process()) */
+EXPORT_SYMBOL(__trace_set_need_resched);
voidresched_curr(struct rq *rq)
{
Hi Peter,
Quoted 16 lines · On Thu, Jan 29, 2026 at 05:09:25PM +0100 [email protected] wrote:
Quoted 9 lines · Phil Auld
This raw tracepoint is added to
set_tsk_need_resched()which introduces
two symbols which were then exported GPL-only. While generally better to add new symbols GPL-only,set_tsk_need_resched()is called from places
that are exported without that restriction. This includes things likewake_up_process(). Export these new symbols without the added restriction.Quoted 5 lines
Fixes 8d737320166b ("sched: Fix build for modules using
set_tsk_need_resched()")Fixes 6c125b85f3c8 ("sched: Export hidden tracepoints to modules")Fixes adcc3bfa8806 ("sched: Adapt sched tracepoints for RV taskmodel")
Quoted 3 lines
Looks good to me, thanks!
Reviewed-by Gabriele Monaco <[email protected]>
Thoughts on this one?
Thanks,
Phil
Quoted 42 lines
Quoted 41 lines
Signed-off-by Phil Auld <[email protected]>---
This is against tip:sched/core (
377521af0341).kernel/sched/core.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)kernel/sched/core.c +1
-1@@ -121,7 +121,8 @@EXPORT_TRACEPOINT_SYMBOL_GPL (sched_update_nr_running_tp); EXPORT_TRACEPOINT_SYMBOL_GPL(sched_compute_energy_tp); EXPORT_TRACEPOINT_SYMBOL_GPL(sched_entry_tp); EXPORT_TRACEPOINT_SYMBOL_GPL(sched_exit_tp); -EXPORT_TRACEPOINT_SYMBOL_GPL (sched_set_need_resched_tp); +/* This needs non-GPL-only. It's called from other non-GPL-only exports (e.g.
wake_up_process()) */ +EXPORT_TRACEPOINT_SYMBOL(sched_set_need_resched_tp);
DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);DEFINE_PER_CPU(struct rnd_state, sched_rnd_state);kernel/sched/core.c +1
-1@@ -1139,7 +1140,8 @@ void __trace_set_need_resched(struct task_struct *curr, int tif) { trace_sched_set_need_resched_tp(curr, smp_processor_id(),tif ); } -EXPORT_SYMBOL_GPL (__trace_set_need_resched); +/* This needs non-GPL-only. It's called from other non-GPL-only exports (e.g.
wake_up_process()) */
+EXPORT_SYMBOL(__trace_set_need_resched);
voidresched_curr(struct rq *rq)
{
Quoted 11 lines · Phil Auld
This raw tracepoint is added to
set_tsk_need_resched()which introduces two symbols which were then exported GPL-only. While generally better to add new symbols GPL-only,set_tsk_need_resched()is called from places that are exported without that restriction. This includes things likewake_up_process(). Export these new symbols without the added restriction.Fixes 8d737320166b ("sched: Fix build for modules using set_tsk_need_resched()")Fixes 6c125b85f3c8 ("sched: Export hidden tracepoints to modules")Fixes adcc3bfa8806 ("sched: Adapt sched tracepoints for RV task model")Signed-off-by Phil Auld <[email protected]>
Apologies for being so late in looking at this, but it sounds good to me.
Best,
Juri