Lines Matching +full:per +full:- +full:queue
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
12 #include "blk-cgroup-rwstat.h"
29 * Soft real-time applications are extremely more latency sensitive
30 * than interactive ones. Over-raise the weight of the former to
38 * per-actuator data. The current value is hopefully a good upper
46 * struct bfq_service_tree - per ioprio_class service tree.
48 * Each service tree represents a B-WF2Q+ scheduler on its own. Each
50 * bfq_service_tree. All the fields are protected by the queue lock
71 * struct bfq_sched_data - multi-class scheduler.
73 * bfq_sched_data is the basic scheduler queue. It supports three
74 * ioprio_classes, and can be used either as a toplevel queue or as an
75 * intermediate queue in a hierarchical setup.
81 * queue requests are served according to B-WF2Q+.
86 * before the current in-service entity is expired, 2) the in-service
87 * queue becomes idle when it expires, and 3) if the entity pointed by
88 * in_service_entity is not a queue, then the in-service child entity
95 * in-service entity with those of such best candidate.
102 /* head-of-line entity (see comments above) */
104 /* array of service trees, one per ioprio_class */
112 * struct bfq_weight_counter - counter of the number of all active queues
125 * struct bfq_entity - schedulable entity.
130 * hierarchy. Non-leaf entities have also their own sched_data, stored
144 * "well-behaved" queues (i.e., queues that do not spend too much
148 * guaranteed. All the fields are protected by the queue lock of the
161 /* B-WF2Q+ start and finish timestamps [sectors/weight] */
182 /* device weight, if non-zero, it overrides the default weight of
185 /* weight of the queue */
197 * For non-leaf nodes in the hierarchy, the associated
198 * scheduler queue, %NULL on leaf nodes.
201 /* the scheduler queue this entity belongs to */
212 /* last child queue of entity created (for non-leaf entities) */
219 * struct bfq_ttime - per process thinktime stats.
234 * struct bfq_queue - leaf schedulable entity.
236 * A bfq_queue is a leaf request queue; it can be associated with an
244 * protected by the queue lock of the containing bfqd.
259 /* last total-service-time sample, see bfq_update_inject_limit() */
267 * Shared bfq_queue if queue is cooperating with one or more
271 /* request-position tree member (see bfq_group's @rq_pos_tree) */
273 /* request-position tree root (see bfq_group's @rq_pos_tree) */
287 /* entity representing this queue in the scheduler */
325 * arrival, such that the queue becomes idle after the
327 * time slice; used only if the queue's IO_bound flag has been
332 /* pid of the process owning the queue, used for logging purposes */
337 * if the queue is shared.
341 /* current maximum weight-raising time for this queue */
347 * queue it is deemed as soft real-time (see the comments on
352 * Start time of the current weight-raising period if
353 * the @bfq-queue is being weight-raised, otherwise
354 * finish time of the last weight-raising period.
357 /* factor by which the weight of this queue is multiplied */
371 * last transition to weight-raised state.
382 unsigned long first_IO_time; /* time of first I/O for this queue */
383 unsigned long creation_time; /* when this queue is created */
386 * Pointer to the waker queue for this queue, i.e., to the
387 * queue Q such that this queue happens to get new I/O right
389 * the comments on the choice of the queue for injection in
393 /* pointer to the curr. tentative waker queue, see bfq_check_waker() */
403 * Head of the list of the woken queues for this queue, i.e.,
404 * of the list of the queues for which this queue is a waker
405 * queue. This list is used to reset the waker_bfqq pointer in
406 * the woken queues when this queue exits.
410 /* index of the actuator this queue is associated with */
415 * struct bfq_data - bfqq data unique and persistent for associated bfq_io_cq
420 * to remember its values while the queue is merged, so as to
426 * classification of a queue.
435 * field keeping the queue's belonging to a large burst
439 * True if the queue belonged to a burst list before its merge
440 * with another cooperating queue.
447 * correctly resumed when the queue is recycled,
448 * then the weight of the recycled queue could differ
449 * from the weight of the original queue.
468 /* candidate queue for a stable merge (due to close creation time) */
475 * struct bfq_io_cq - per (request_queue, io_context) structure.
484 * process is inserted into the queue pointed by bfqq[i][j] if
485 * the request is to be served by the j-th actuator of the
487 * is async or sync. So there is a distinct queue for each
491 /* per (request_queue, blkcg) ioprio */
499 * (one queue per actuator, see field bfqq above). In
508 * struct bfq_data - per-device data structure.
513 /* device request queue */
514 struct request_queue *queue; member
515 /* dispatch queue */
526 * weight-raised @bfq_queue (see the comments to the functions
552 * should be decremented when the in-flight request of the
557 * pending-request counter must be added to entities, and must
570 * inactive. Then, when the first queue of the
575 * longer in case a new queue of the entity remains
582 * Per-class (RT, BE, IDLE) number of bfq_queues containing
583 * requests (including the queue in service, even if it is
587 /* number of weight-raised busy @bfq_queues */
617 * the queue in service.
624 /* on-disk position of the last served request */
627 /* position of the last served request for the in-service queue */
639 /* time of last transition from empty to non-empty (ns) */
644 * of a just-arrived first I/O request (see
682 * [(sectors/usec) / 2^BFQ_RATE_SHIFT]. The left-shift by
684 * fixed-point calculations.
694 * per-actuator basis helps implementing per-actuator
713 /* user-configured max budget value (0 for auto-tuning) */
718 * sequential or quasi-sequential ones (this also implies that
722 * without service-domain guarantees).
735 * Last time at which a queue entered the current burst of
743 * Reference time interval used to decide whether a queue has
747 /* number of queues in the current burst of queue activations */
752 /* Maximum burst size above which the current queue-activation
756 /* true if a large queue-activation burst is in progress */
764 /* if set to true, low-latency heuristics are enabled */
767 * Maximum factor by which the weight of a weight-raised queue
772 /* Maximum weight-raising duration for soft real-time processes */
775 * Minimum idle period after which weight-raising may be
776 * reactivated for a queue (in jiffies).
781 * weight-raising may be reactivated for an already busy async
782 * queue (in jiffies).
786 /* Max service-rate for a soft real-time queue, in sectors/sec */
803 * be able to perform the bic lookup, needed by bio-merge
805 * avoid taking the request-queue lock while the scheduler
821 * case of single-actuator drives.
837 * in-service queue does not contain I/O for that actuator,
838 * while (ii) some other queue does contain I/O for that
839 * actuator, then the head I/O request of the latter queue is
841 * currently in-service queue.
846 * few drive-queue slots as possibile to the in-service
847 * queue. This reduces as much as possible the probability
848 * that the service of I/O from the in-service bfq_queue gets
850 * slots of the drive queue are filled with I/O injected from
857 BFQQF_just_created = 0, /* queue just allocated */
865 BFQQF_has_short_ttime, /* queue has a short think time */
866 BFQQF_sync, /* synchronous queue */
868 * bfqq has timed-out at least once
877 * may need softrt-next-start
906 * queue has been idling for
911 BFQQE_NO_MORE_REQUESTS, /* the queue has no more requests */
929 /* total time spent waiting in scheduler queue in ns */
958 * struct bfq_group_data - per-blkcg storage for the blkio subsystem.
971 * struct bfq_group - per (device, cgroup) data structure.
977 * the group, one queue per ioprio value per ioprio_class,
978 * except for the idle class that has only one queue.
979 * @async_idle_bfqq: async queue for the idle class (ioprio is ignored).
994 * there is a set of bfq_groups, each one collecting the lower-level
998 * o @bfqd is protected by the queue lock, RCU is used to access it
1000 * o All the other fields are protected by the @bfqd queue lock.
1039 /* --------------- main algorithm interface ----------------- */
1063 /* ------------ end of main algorithm interface -------------- */
1065 /* ---------------- cgroups-support interface ---------------- */
1100 /* ------------- end of cgroups-support interface ------------- */
1102 /* - interface of the internal hierarchical B-WF2Q+ scheduler - */
1107 for (; entity ; entity = entity->parent)
1116 for (; entity && ({ parent = entity->parent; 1; }); entity = parent)
1162 /* --------------- end of interface of B-WF2Q+ ---------------- */
1169 if (bfqq->pid != -1) in bfq_bfqq_name()
1170 snprintf(str, len, "bfq%d%c", bfqq->pid, type); in bfq_bfqq_name()
1172 snprintf(str, len, "bfqSHARED-%c", type); in bfq_bfqq_name()
1180 if (likely(!blk_trace_note_message_enabled((bfqd)->queue))) \
1183 blk_add_cgroup_trace_msg((bfqd)->queue, \
1184 &bfqg_to_blkg(bfqq_group(bfqq))->blkcg->css, \
1192 if (likely(!blk_trace_note_message_enabled((bfqd)->queue))) \
1195 blk_add_trace_msg((bfqd)->queue, "%s " fmt, pid_str, ##args); \
1201 blk_add_trace_msg((bfqd)->queue, "bfq " fmt, ##args)