Re: [RFC PATCH 3/7] sched/fair: Handle unthrottle path for task based throttle

From: K Prateek Nayak
Date: Fri Mar 14 2025 - 00:07:00 EST


On 3/14/2025 9:23 AM, K Prateek Nayak wrote:

[..snip..]


+    /* Re-enqueue the tasks that have been throttled at this level. */
+    list_for_each_entry_safe(p, tmp, &cfs_rq->throttled_limbo_list,
throttle_node) {
+        list_del_init(&p->throttle_node);
+        /*
+         * FIXME: p may not be allowed to run on this rq anymore
+         * due to affinity change while p is throttled.
+         */

Using dequeue_task_fair() for throttle should ensure that the core now
sees task_on_rq_queued() which should make it go throgh a full dequeue
cycle which will remove the task from the "throttled_limbo_list" and
the enqueue should put it back on the correct runqueue.

Is the above comment inaccurate with your changes or did I miss
something?

Please ignore this, I just reached Patch 5. Sorry for the noise.


+        enqueue_task_fair(rq_of(cfs_rq), p, ENQUEUE_WAKEUP);
+    }
+
+    /* Add cfs_rq with load or one or more already running entities to the list */
+    if (!cfs_rq_is_decayed(cfs_rq))
+        list_add_leaf_cfs_rq(cfs_rq);
+
      return 0;
  }


--
Thanks and Regards,
Prateek