Lines Matching +full:1 +full:- +full:1024
1 .. SPDX-License-Identifier: GPL-2.0
7 1. Introduction
57 foreground, top-app, etc. Util clamp can be used to constrain how much
60 the ones belonging to the currently active app (top-app group). Beside this
65 1. The big cores are free to run top-app tasks immediately. top-app
73 CPUs with capacity < 1024
76 CPUs with capacity = 1024
90 UCLAMP_MIN=1024 will ensure such tasks will always see the highest performance
106 Note that by design RT tasks don't have per-task PELT signal and must always
114 See :ref:`section 3.4 <uclamp-default-values>` for default values and
115 :ref:`3.4.1 <sched-util-clamp-min-rt-default>` on how to change RT tasks
150 task on the rq to only a subset of tasks on the top-most bucket.
157 uclamp value of the rq. See :ref:`section 2.1 <uclamp-buckets>` for details on
182 .. _uclamp-buckets:
185 ------------
193 0 1024
195 +-----------+-----------+-----------+---- ----+-----------+
196 | Bucket 0 | Bucket 1 | Bucket 2 | ... | Bucket N |
197 +-----------+-----------+-----------+---- ----+-----------+
199 +- p0 +- p3 +- p4
201 +- p1 +- p5
203 +- p2
217 The range of each bucket is 1024/N. For example, for the default value of
222 DELTA = round_closest(1024/5) = 204.8 = 205
225 Bucket 1: [205:409]
228 Bucket 4: [820:1024]
234 p->uclamp[UCLAMP_MIN] = 300
235 p->uclamp[UCLAMP_MAX] = 1024
237 is enqueued into the rq, bucket 1 will be incremented for UCLAMP_MIN and bucket
249 rq->uclamp[UCLAMP_MIN] = max(rq->uclamp[UCLAMP_MIN], p->uclamp[UCLAMP_MIN])
257 rq->uclamp[UCLAMP_MIN] = search_top_bucket_for_highest_value()
261 See :ref:`section 3.4 <uclamp-default-values>` for details on default values.
265 --------------------
279 p0->uclamp[UCLAMP_MIN] = 300
280 p0->uclamp[UCLAMP_MAX] = 900
282 p1->uclamp[UCLAMP_MIN] = 500
283 p1->uclamp[UCLAMP_MAX] = 500
290 rq->uclamp[UCLAMP_MIN] = max(300, 500) = 500
291 rq->uclamp[UCLAMP_MAX] = max(900, 500) = 900
293 As we shall see in :ref:`section 5.1 <uclamp-capping-fail>`, this max
298 -----------------------------
306 1. By the uclamp settings defined by the cgroup CPU controller it is attached
308 2. The restricted value in (1) is then further restricted by the system wide
311 :ref:`Section 3 <uclamp-interfaces>` discusses the interfaces and will expand
328 ----------
330 Uclamp performance request has the range of 0 to 1024 inclusive.
335 .. _uclamp-interfaces:
341 -----------------------
354 attr->sched_util_min = 40% * 1024;
355 attr->sched_util_max = 80% * 1024;
362 The special value -1 is used to reset the uclamp settings to the system
365 Note that resetting the uclamp value to system default using -1 is not the same
372 ---------------------
382 * cpu.uclamp.min is a protection as described in :ref:`section 3-3 of cgroup
383 v2 documentation <cgroupv2-protections-distributor>`.
391 * cpu.uclamp.max is a limit as described in :ref:`section 3-2 of cgroup v2
392 documentation <cgroupv2-limits-distributor>`.
404 p0->uclamp[UCLAMP_MIN] = // system default;
405 p0->uclamp[UCLAMP_MAX] = // system default;
407 p1->uclamp[UCLAMP_MIN] = 40% * 1024;
408 p1->uclamp[UCLAMP_MAX] = 50% * 1024;
410 cgroup0->cpu.uclamp.min = 20% * 1024;
411 cgroup0->cpu.uclamp.max = 60% * 1024;
413 cgroup1->cpu.uclamp.min = 60% * 1024;
414 cgroup1->cpu.uclamp.max = 100% * 1024;
420 p0->uclamp[UCLAMP_MIN] = cgroup0->cpu.uclamp.min = 20% * 1024;
421 p0->uclamp[UCLAMP_MAX] = cgroup0->cpu.uclamp.max = 60% * 1024;
423 p1->uclamp[UCLAMP_MIN] = 40% * 1024; // intact
424 p1->uclamp[UCLAMP_MAX] = 50% * 1024; // intact
430 p0->uclamp[UCLAMP_MIN] = cgroup1->cpu.uclamp.min = 60% * 1024;
431 p0->uclamp[UCLAMP_MAX] = cgroup1->cpu.uclamp.max = 100% * 1024;
433 p1->uclamp[UCLAMP_MIN] = cgroup1->cpu.uclamp.min = 60% * 1024;
434 p1->uclamp[UCLAMP_MAX] = 50% * 1024; // intact
440 ---------------------
442 3.3.1 sched_util_clamp_min
443 --------------------------
445 System wide limit of allowed UCLAMP_MIN range. By default it is set to 1024,
446 which means that permitted effective UCLAMP_MIN range for tasks is [0:1024].
451 they won't be satisfied until it is more than p->uclamp[UCLAMP_MIN].
456 --------------------------
458 System wide limit of allowed UCLAMP_MAX range. By default it is set to 1024,
459 which means that permitted effective UCLAMP_MAX range for tasks is [0:1024].
472 won't be satisfied until it is more than p->uclamp[UCLAMP_MAX].
476 .. _uclamp-default-values:
479 -------------------
485 p_fair->uclamp[UCLAMP_MIN] = 0
486 p_fair->uclamp[UCLAMP_MAX] = 1024
496 p_rt->uclamp[UCLAMP_MIN] = 1024
497 p_rt->uclamp[UCLAMP_MAX] = 1024
505 .. _sched-util-clamp-min-rt-default:
507 3.4.1 sched_util_clamp_min_rt_default
508 -------------------------------------
537 200 or 1024 is different for each system. Unless there's a specific target
543 4.1. Boost important and DVFS-latency-sensitive tasks
544 -----------------------------------------------------
564 -------------------------
571 -------------------
581 4.4. Per-app performance restriction
582 ------------------------------------
597 .. _uclamp-capping-fail:
600 ---------------------------------------------------------------------
606 p0->uclamp[UCLAMP_MAX] = 512
612 p1->uclamp[UCLAMP_MAX] = 1024
619 rq->uclamp[UCLAMP_MAX] = max(512, 1024) = 1024
630 ------------------------------------------------
636 which would result in util_avg being 1024.
645 p0->util_avg = 300
646 p0->uclamp[UCLAMP_MAX] = 0
655 rq->uclamp[UCLAMP_MAX] = 0
663 which indicates the CPU will still see idle time since 900 is < 1024. The
665 long as there's idle time, p->util_avg updates will be off by a some margin,
670 p0->util_avg = 300 + small_error
678 which is higher than 1024 and indicates that the CPU has no idle time. When
683 p0->util_avg = 1024
689 p1->util_avg = 200
690 p1->uclamp[UCLAMP_MAX] = 1024
692 then the effective UCLAMP_MAX for the CPU will be 1024 according to max
694 severely, then the rq->util_avg will be:
698 p0->util_avg = 1024
699 p1->util_avg = 200
701 rq->util_avg = 1024
702 rq->uclamp[UCLAMP_MAX] = 1024
708 p0->util_avg = 300
709 p1->util_avg = 200
711 rq->util_avg = 500
716 -----------------------------------
720 1. Hardware takes non-zero time to respond to any frequency change
722 2. Non fast-switch systems require a worker deadline thread to wake up
741 to be done for 1 or 2. They are considered hard limitations of the system.