File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -2657,6 +2657,18 @@ static long calc_cfs_shares(struct cfs_rq *cfs_rq, struct task_group *tg)
2657
2657
if (tg_weight )
2658
2658
shares /= tg_weight ;
2659
2659
2660
+ /*
2661
+ * MIN_SHARES has to be unscaled here to support per-CPU partitioning
2662
+ * of a group with small tg->shares value. It is a floor value which is
2663
+ * assigned as a minimum load.weight to the sched_entity representing
2664
+ * the group on a CPU.
2665
+ *
2666
+ * E.g. on 64-bit for a group with tg->shares of scale_load(15)=15*1024
2667
+ * on an 8-core system with 8 tasks each runnable on one CPU shares has
2668
+ * to be 15*1024*1/8=1920 instead of scale_load(MIN_SHARES)=2*1024. In
2669
+ * case no task is runnable on a CPU MIN_SHARES=2 should be returned
2670
+ * instead of 0.
2671
+ */
2660
2672
if (shares < MIN_SHARES )
2661
2673
shares = MIN_SHARES ;
2662
2674
if (shares > tg -> shares )
You can’t perform that action at this time.
0 commit comments