Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched/fair: Get rid of throttled_lb_pair()

Now that throttled tasks are dequeued and can not stay on rq's cfs_tasks
list, there is no need to take special care of these throttled tasks
anymore in load balance.

Suggested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Signed-off-by: Aaron Lu <ziqianlu@bytedance.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Valentin Schneider <vschneid@redhat.com>
Tested-by: Matteo Martelli <matteo.martelli@codethink.co.uk>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Link: https://lore.kernel.org/r/20250829081120.806-6-ziqianlu@bytedance.com

authored by

Aaron Lu and committed by
Peter Zijlstra
5b726e9b eb962f25

+4 -31
+4 -31
kernel/sched/fair.c
··· 5735 5735 return cfs_bandwidth_used() && cfs_rq->throttle_count; 5736 5736 } 5737 5737 5738 - /* 5739 - * Ensure that neither of the group entities corresponding to src_cpu or 5740 - * dest_cpu are members of a throttled hierarchy when performing group 5741 - * load-balance operations. 5742 - */ 5743 - static inline int throttled_lb_pair(struct task_group *tg, 5744 - int src_cpu, int dest_cpu) 5745 - { 5746 - struct cfs_rq *src_cfs_rq, *dest_cfs_rq; 5747 - 5748 - src_cfs_rq = tg->cfs_rq[src_cpu]; 5749 - dest_cfs_rq = tg->cfs_rq[dest_cpu]; 5750 - 5751 - return throttled_hierarchy(src_cfs_rq) || 5752 - throttled_hierarchy(dest_cfs_rq); 5753 - } 5754 - 5755 5738 static inline bool task_is_throttled(struct task_struct *p) 5756 5739 { 5757 5740 return cfs_bandwidth_used() && p->throttled; ··· 6722 6739 } 6723 6740 6724 6741 static inline int throttled_hierarchy(struct cfs_rq *cfs_rq) 6725 - { 6726 - return 0; 6727 - } 6728 - 6729 - static inline int throttled_lb_pair(struct task_group *tg, 6730 - int src_cpu, int dest_cpu) 6731 6742 { 6732 6743 return 0; 6733 6744 } ··· 9362 9385 /* 9363 9386 * We do not migrate tasks that are: 9364 9387 * 1) delayed dequeued unless we migrate load, or 9365 - * 2) throttled_lb_pair, or 9366 - * 3) cannot be migrated to this CPU due to cpus_ptr, or 9367 - * 4) running (obviously), or 9368 - * 5) are cache-hot on their current CPU, or 9369 - * 6) are blocked on mutexes (if SCHED_PROXY_EXEC is enabled) 9388 + * 2) cannot be migrated to this CPU due to cpus_ptr, or 9389 + * 3) running (obviously), or 9390 + * 4) are cache-hot on their current CPU, or 9391 + * 5) are blocked on mutexes (if SCHED_PROXY_EXEC is enabled) 9370 9392 */ 9371 9393 if ((p->se.sched_delayed) && (env->migration_type != migrate_load)) 9372 - return 0; 9373 - 9374 - if (throttled_lb_pair(task_group(p), env->src_cpu, env->dst_cpu)) 9375 9394 return 0; 9376 9395 9377 9396 /*