Merge branch 'for-6.14-fixes' into for-6.15
authorTejun Heo <tj@kernel.org>
Sun, 9 Feb 2025 06:34:43 +0000 (20:34 -1000)
committerTejun Heo <tj@kernel.org>
Sun, 9 Feb 2025 06:34:43 +0000 (20:34 -1000)
Pull to receive:

2fa0fbeb69ed ("sched_ext: Implement auto local dispatching of migration disabled tasks")
32966821574c ("sched_ext: Fix migration disabled handling in targeted dispatches")

as planned for-6.15 changes depend on them (e.g. adding event counter for
implicit migration disabled task handling).

1  2 
kernel/sched/ext.c
tools/sched_ext/include/scx/common.bpf.h

index 5ef90d9bcdd2dad524b69a2d64e3e9a186d80403,e01144340d679f4bbaec8a5da7daa27fe62365e0..5dfcba6adcdafa0fa5c7f9daf055c0dca08db2ca
@@@ -885,7 -896,14 +899,8 @@@ static bool scx_warned_zero_slice
  
  static DEFINE_STATIC_KEY_FALSE(scx_ops_enq_last);
  static DEFINE_STATIC_KEY_FALSE(scx_ops_enq_exiting);
+ static DEFINE_STATIC_KEY_FALSE(scx_ops_enq_migration_disabled);
  static DEFINE_STATIC_KEY_FALSE(scx_ops_cpu_preempt);
 -static DEFINE_STATIC_KEY_FALSE(scx_builtin_idle_enabled);
 -
 -#ifdef CONFIG_SMP
 -static DEFINE_STATIC_KEY_FALSE(scx_selcpu_topo_llc);
 -static DEFINE_STATIC_KEY_FALSE(scx_selcpu_topo_numa);
 -#endif
  
  static struct static_key_false scx_has_op[SCX_OPI_END] =
        { [0 ... SCX_OPI_END-1] = STATIC_KEY_FALSE_INIT };
@@@ -2097,11 -2026,14 +2112,16 @@@ static void do_enqueue_task(struct rq *
  
        /* see %SCX_OPS_ENQ_EXITING */
        if (!static_branch_unlikely(&scx_ops_enq_exiting) &&
 -          unlikely(p->flags & PF_EXITING))
 +          unlikely(p->flags & PF_EXITING)) {
 +              __scx_add_event(SCX_EV_ENQ_SKIP_EXITING, 1);
                goto local;
 +      }
  
+       /* see %SCX_OPS_ENQ_MIGRATION_DISABLED */
+       if (!static_branch_unlikely(&scx_ops_enq_migration_disabled) &&
+           is_migration_disabled(p))
+               goto local;
        if (!SCX_HAS_OP(enqueue))
                goto global;
  
@@@ -2685,10 -2619,10 +2713,11 @@@ static void dispatch_to_local_dsq(struc
        }
  
  #ifdef CONFIG_SMP
-       if (unlikely(!task_can_run_on_remote_rq(p, dst_rq, true))) {
+       if (src_rq != dst_rq &&
+           unlikely(!task_can_run_on_remote_rq(p, dst_rq, true))) {
                dispatch_enqueue(find_global_dsq(p), p,
                                 enq_flags | SCX_ENQ_CLEAR_OPSS);
 +              __scx_add_event(SCX_EV_DISPATCH_LOCAL_DSQ_OFFLINE, 1);
                return;
        }