/** *structbfq_service_tree-perioprio_classservicetree. * *EachservicetreerepresentsaB-WF2Q+scheduleronitsown.Each *ioprio_classhasitsownindependentscheduler,andsoitsown *bfq_service_tree.Allthefieldsareprotectedbythequeuelock *ofthecontainingbfqd.
*/ struct bfq_service_tree { /* tree for active entities (i.e., those backlogged) */ struct rb_root active; /* tree for idle entities (i.e., not backlogged, with V < F_i)*/ struct rb_root idle;
/* idle entity with minimum F_i */ struct bfq_entity *first_idle; /* idle entity with maximum F_i */ struct bfq_entity *last_idle;
/* scheduler virtual time */
u64 vtime; /* scheduler weight sum; active and idle entities contribute to it */ unsignedlong wsum;
};
/** *structbfq_sched_data-multi-classscheduler. * *bfq_sched_dataisthebasicschedulerqueue.Itsupportsthree *ioprio_classes,andcanbeusedeitherasatoplevelqueueorasan *intermediatequeueinahierarchicalsetup. * *Thesupportedioprio_classesarethesameasinCFQ,indescending *priorityorder,IOPRIO_CLASS_RT,IOPRIO_CLASS_BE,IOPRIO_CLASS_IDLE. *Requestsfromhigherpriorityqueuesareservedbeforeallthe *requestsfromlowerpriorityqueues;amongrequestsofthesame *queuerequestsareservedaccordingtoB-WF2Q+. * *Thescheduleisimplementedbytheservicetrees,plusthefield *@next_in_service,whichpointstotheentityontheactivetrees *thatwillbeservednext,if1)nochangesinthescheduleoccurs *beforethecurrentin-serviceentityisexpired,2)thein-service *queuebecomesidlewhenitexpires,and3)iftheentitypointedby *in_service_entityisnotaqueue,thenthein-servicechildentity *oftheentitypointedbyin_service_entitybecomesidleon *expiration.Thispeculiardefinitionallowsforthefollowing *optimization,notyetexploited:whileagivenentityisstillin *service,wealreadyknowwhichisthebestcandidatefornext *serviceamongtheotheractiveentitiesinthesameparent *entity.Wecanthenquicklycomparethetimestampsofthe *in-serviceentitywiththoseofsuchbestcandidate. * *Allfieldsareprotectedbythelockofthecontainingbfqd.
*/ struct bfq_sched_data { /* entity in service */ struct bfq_entity *in_service_entity; /* head-of-line entity (see comments above) */ struct bfq_entity *next_in_service; /* array of service trees, one per ioprio_class */ struct bfq_service_tree service_tree[BFQ_IOPRIO_CLASSES]; /* last time CLASS_IDLE was served */ unsignedlong bfq_class_idle_last_service;
};
/** *structbfq_weight_counter-counterofthenumberofallactivequeues *withagivenweight.
*/ struct bfq_weight_counter { unsignedint weight; /* weight of the queues this counter refers to */ unsignedint num_active; /* nr of active queues with this weight */ /* *Weightstreemember(seebfq_data's@queue_weights_tree)
*/ struct rb_node weights_node;
};
/* amount of service received during the last service slot */ int service;
/* budget, used also to calculate F_i: F_i = S_i + @budget / @weight */ int budget;
/* Number of requests allocated in the subtree of this entity */ int allocated;
/* device weight, if non-zero, it overrides the default weight of
* bfq_group_data */ int dev_weight; /* weight of the queue */ int weight; /* next weight if a change is in progress */ int new_weight;
/* original weight, used to implement weight boosting */ int orig_weight;
/* parent entity, for hierarchical scheduling */ struct bfq_entity *parent;
/* *Fornon-leafnodesinthehierarchy,theassociated *schedulerqueue,%NULLonleafnodes.
*/ struct bfq_sched_data *my_sched_data; /* the scheduler queue this entity belongs to */ struct bfq_sched_data *sched_data;
/* flag, set to request a weight, ioprio or ioprio_class change */ int prio_changed;
#ifdef CONFIG_BFQ_GROUP_IOSCHED /* flag, set if the entity is counted in groups_with_pending_reqs */ bool in_groups_with_pending_reqs; #endif
/* last child queue of entity created (for non-leaf entities) */ struct bfq_queue *last_bfqq_created;
};
struct bfq_group;
/** *structbfq_ttime-perprocessthinktimestats.
*/ struct bfq_ttime { /* completion time of the last request */
u64 last_end_request;
/* total process thinktime */
u64 ttime_total; /* number of thinktime samples */ unsignedlong ttime_samples; /* average process thinktime */
u64 ttime_mean;
};
/** *structbfq_queue-leafschedulableentity. * *Abfq_queueisaleafrequestqueue;itcanbeassociatedwithan *io_contextormore,ifitisasyncorsharedbetweencooperating *processes.Besides,itcontainsI/Orequestsforonlyoneactuator *(anio_contextisassociatedwithadifferentbfq_queueforeach *actuatoritgeneratesI/Ofor).@cgroupholdsareferencetothe *cgroup,tobesurethatitdoesnotdisappearwhileabfqqstill *referencesit(mostlytoavoidracesbetweenrequestissuingand *taskmigrationfollowedbycgroupdestruction).Allthefieldsare *protectedbythequeuelockofthecontainingbfqd.
*/ struct bfq_queue { /* reference counter */ int ref; /* counter of references from other queues for delayed stable merge */ int stable_ref; /* parent bfq_data */ struct bfq_data *bfqd;
/* current ioprio and ioprio class */ unsignedshort ioprio, ioprio_class; /* next ioprio and ioprio class if a change is in progress */ unsignedshort new_ioprio, new_ioprio_class;
/* last total-service-time sample, see bfq_update_inject_limit() */
u64 last_serv_time_ns; /* limit for request injection */ unsignedint inject_limit; /* last time the inject limit has been decreased, in jiffies */ unsignedlong decrease_time_jif;
/* *Sharedbfq_queueifqueueiscooperatingwithoneormore *otherqueues.
*/ struct bfq_queue *new_bfqq; /* request-position tree member (see bfq_group's @rq_pos_tree) */ struct rb_node pos_node; /* request-position tree root (see bfq_group's @rq_pos_tree) */ struct rb_root *pos_root;
/* sorted list of pending requests */ struct rb_root sort_list; /* if fifo isn't expired, next request to serve */ struct request *next_rq; /* number of sync and async requests queued */ int queued[2]; /* number of pending metadata requests */ int meta_pending; /* fifo list of requests in sort_list */ struct list_head fifo;
/* entity representing this queue in the scheduler */ struct bfq_entity entity;
/* pointer to the weight counter associated with this entity */ struct bfq_weight_counter *weight_counter;
/* maximum budget allowed from the feedback mechanism */ int max_budget; /* budget expiration (in jiffies) */ unsignedlong budget_timeout;
/* number of requests on the dispatch list or inside driver */ int dispatched;
/* status flags */ unsignedlong flags;
/* node for active/idle bfqq list inside parent bfqd */ struct list_head bfqq_list;
/* when bfqq started to do I/O within the last observation window */
u64 io_start_time; /* how long bfqq has remained empty during the last observ. window */
u64 tot_idle_time;
/* bit vector: a 1 for each seeky requests in history */
u32 seek_history;
/* node for the device's burst list */ struct hlist_node burst_list_node;
/* position of the last request enqueued */
sector_t last_request_pos;
/* Number of consecutive pairs of request completion and *arrival,suchthatthequeuebecomesidleafterthe *completion,butthenextrequestarriveswithinanidle *timeslice;usedonlyifthequeue'sIO_boundflaghasbeen *cleared.
*/ unsignedint requests_within_timer;
/* pid of the process owning the queue, used for logging purposes */
pid_t pid;
unsignedlong first_IO_time; /* time of first I/O for this queue */ unsignedlong creation_time; /* when this queue is created */
/* *Pointertothewakerqueueforthisqueue,i.e.,tothe *queueQsuchthatthisqueuehappenstogetnewI/Oright *aftersomeI/OrequestofQiscompleted.Fordetails,see *thecommentsonthechoiceofthequeueforinjectionin *bfq_select_queue().
*/ struct bfq_queue *waker_bfqq; /* pointer to the curr. tentative waker queue, see bfq_check_waker() */ struct bfq_queue *tentative_waker_bfqq; /* number of times the same tentative waker has been detected */ unsignedint num_waker_detections; /* time when we started considering this waker */
u64 waker_detection_started;
/* node for woken_list, see below */ struct hlist_node woken_list_node; /* *Headofthelistofthewokenqueuesforthisqueue,i.e., *ofthelistofthequeuesforwhichthisqueueisawaker *queue.Thislistisusedtoresetthewaker_bfqqpointerin *thewokenqueueswhenthisqueueexits.
*/ struct hlist_head woken_list;
/* index of the actuator this queue is associated with */ unsignedint actuator_idx;
};
/* *Per-class(RT,BE,IDLE)numberofbfq_queuescontaining *requests(includingthequeueinservice,evenifitis *idling).
*/ unsignedint busy_queues[3]; /* number of weight-raised busy @bfq_queues */ int wr_busy_queues; /* number of queued requests */ int queued; /* number of requests dispatched and waiting for completion */ int tot_rq_in_driver; /* *numberofrequestsdispatchedandwaitingforcompletion *foreachactuator
*/ int rq_in_driver[BFQ_MAX_ACTUATORS];
/* true if the device is non rotational and performs queueing */ bool nonrot_with_queueing;
/* *Maximumnumberofrequestsindriverinthelast *@hw_tag_samplescompletedrequests.
*/ int max_rq_in_driver; /* number of samples used to calculate hw_tag */ int hw_tag_samples; /* flag set to one if the driver is showing a queueing behavior */ int hw_tag;
/* number of budgets assigned */ int budgets_assigned;
/* time of first rq dispatch in current observation interval (ns) */
u64 first_dispatch; /* time of last rq dispatch in current observation interval (ns) */
u64 last_dispatch;
/* beginning of the last budget */
ktime_t last_budget_start; /* beginning of the last idle slice */
ktime_t last_idling_start; unsignedlong last_idling_start_jiffies;
/* number of samples in current observation interval */ int peak_rate_samples; /* num of samples of seq dispatches in current observation interval */
u32 sequential_samples; /* total num of sectors transferred in current observation interval */
u64 tot_sectors_dispatched; /* max rq size seen during current observation interval (sectors) */
u32 last_rq_max_size; /* time elapsed from first dispatch in current observ. interval (us) */
u64 delta_from_first; /* *Currentestimateofthedevicepeakrate,measuredin *[(sectors/usec)/2^BFQ_RATE_SHIFT].Theleft-shiftby *BFQ_RATE_SHIFTisperformedtoincreaseprecisionin *fixed-pointcalculations.
*/
u32 peak_rate;
/* maximum budget allotted to a bfq_queue before rescheduling */ int bfq_max_budget;
/* *Listofallthebfq_queuesactiveforaspecificactuator *onthedevice.Keepingactivequeuesseparateona *per-actuatorbasishelpsimplementingper-actuator *injectionmoreefficiently.
*/ struct list_head active_list[BFQ_MAX_ACTUATORS]; /* list of all the bfq_queues idle on the device */ struct list_head idle_list;
/* *Timeoutforasync/syncrequests;whenitfires,requests *areservedinfifoorder.
*/
u64 bfq_fifo_expire[2]; /* weight of backward seeks wrt forward ones */ unsignedint bfq_back_penalty; /* maximum allowed backward seek */ unsignedint bfq_back_max; /* maximum idling time */
u32 bfq_slice_idle;
/* user-configured max budget value (0 for auto-tuning) */ int bfq_user_max_budget; /* *Timeoutforbfq_queuestoconsumetheirbudget;usedto *preventseekyqueuesfromimposinglonglatenciesto *sequentialorquasi-sequentialones(thisalsoimpliesthat *seekyqueuescannotreceiveguaranteesintheservice *domain;afteratimeouttheyarechargedforthetimethey *havebeeninservice,topreservefairnessamongthem,but *withoutservice-domainguarantees).
*/ unsignedint bfq_timeout;
/* *Lasttimeatwhichaqueueenteredthecurrentburstof *queuesbeingactivatedshortlyaftereachother;formore *detailsaboutthisandthefollowingparametersrelatedto *aburstofactivations,seethecommentsonthefunction *bfq_handle_burst.
*/ unsignedlong last_ins_in_burst; /* *Referencetimeintervalusedtodecidewhetheraqueuehas *beenactivatedshortlyafter@last_ins_in_burst.
*/ unsignedlong bfq_burst_interval; /* number of queues in the current burst of queue activations */ int burst_size;
/* common parent entity for the queues in the burst */ struct bfq_entity *burst_parent_entity; /* Maximum burst size above which the current queue-activation *burstisdeemedas'large'.
*/ unsignedlong bfq_large_burst_thresh; /* true if a large queue-activation burst is in progress */ bool large_burst; /* *Headoftheburstlist(asfortheabovefields,more *detailsinthecommentsonthefunctionbfq_handle_burst).
*/ struct hlist_head burst_list;
/* if set to true, low-latency heuristics are enabled */ bool low_latency; /* *Maximumfactorbywhichtheweightofaweight-raisedqueue *ismultiplied.
*/ unsignedint bfq_wr_coeff;
/* Max service-rate for a soft real-time queue, in sectors/sec */ unsignedint bfq_wr_max_softrt_rate; /* *Cachedvalueoftheproductref_rate*ref_wr_duration,used *forcomputingthemaximumdurationofweightraising *automatically.
*/
u64 rate_dur_prod;
enum bfqq_state_flags {
BFQQF_just_created = 0, /* queue just allocated */
BFQQF_busy, /* has requests or is in service */
BFQQF_wait_request, /* waiting for a request */
BFQQF_non_blocking_wait_rq, /* *waitingforarequest *withoutidlingthedevice
*/
BFQQF_fifo_expire, /* FIFO checked in this slice */
BFQQF_has_short_ttime, /* queue has a short think time */
BFQQF_sync, /* synchronous queue */
BFQQF_IO_bound, /* *bfqqhastimed-outatleastonce *havingconsumedatmost2/10of *itsbudget
*/
BFQQF_in_large_burst, /* *bfqqactivatedinalargeburst, *seecommentstobfq_handle_burst.
*/
BFQQF_softrt_update, /* *mayneedsoftrt-next-start *update
*/
BFQQF_coop, /* bfqq is shared */
BFQQF_split_coop, /* shared bfqq will be split */
};
/* Expiration reasons. */ enum bfqq_expiration {
BFQQE_TOO_IDLE = 0, /* *queuehasbeenidlingfor *toolong
*/
BFQQE_BUDGET_TIMEOUT, /* budget took too long to be used */
BFQQE_BUDGET_EXHAUSTED, /* budget consumed */
BFQQE_NO_MORE_REQUESTS, /* the queue has no more requests */
BFQQE_PREEMPTED /* preemption in progress */
};
struct bfqg_stats { /* basic stats */ struct blkg_rwstat bytes; struct blkg_rwstat ios; #ifdef CONFIG_BFQ_CGROUP_DEBUG /* number of ios merged */ struct blkg_rwstat merged; /* total time spent on device in ns, may not be accurate w/ queueing */ struct blkg_rwstat service_time; /* total time spent waiting in scheduler queue in ns */ struct blkg_rwstat wait_time; /* number of IOs queued up */ struct blkg_rwstat queued; /* total disk time and nr sectors dispatched by this group */ struct bfq_stat time; /* sum of number of ios queued across all samples */ struct bfq_stat avg_queue_size_sum; /* count of samples taken for average */ struct bfq_stat avg_queue_size_samples; /* how many times this group has been removed from service tree */ struct bfq_stat dequeue; /* total time spent waiting for it to be assigned a timeslice. */ struct bfq_stat group_wait_time; /* time spent idling for this blkcg_gq */ struct bfq_stat idle_time; /* total time with empty current active q with other requests queued */ struct bfq_stat empty_time; /* fields after this shouldn't be cleared on stat reset */
u64 start_group_wait_time;
u64 start_idle_time;
u64 start_empty_time;
uint16_t flags; #endif/* CONFIG_BFQ_CGROUP_DEBUG */
};
#ifdef CONFIG_BFQ_GROUP_IOSCHED
/* *structbfq_group_data-per-blkcgstoragefortheblkiosubsystem. * *@ps:@blkcg_policy_storagethatthisstructureinherits *@weight:weightofthebfq_group
*/ struct bfq_group_data { /* must be the first member */ struct blkcg_policy_data pd;
unsignedint weight;
};
/** *structbfq_group-per(device,cgroup)datastructure. *@entity:schedulableentitytoinsertintotheparentgroupsched_data. *@sched_data:ownsched_data,tocontainchildentities(theymaybe *bothbfq_queuesandbfq_groups). *@bfqd:thebfq_dataforthedevicethisgroupactsupon. *@async_bfqq:arrayofasyncqueuesforallthetasksbelongingto *thegroup,onequeueperiopriovalueperioprio_class, *exceptfortheidleclassthathasonlyonequeue. *@async_idle_bfqq:asyncqueuefortheidleclass(ioprioisignored). *@my_entity:pointerto@entity,%NULLforthetoplevelgroup;used *toavoidtoomanyspecialcasesduringgroupcreation/ *migration. *@stats:statsforthisbfqg. *@active_entities:numberofactiveentitiesbelongingtothegroup; *unusedfortherootgroup.Usedtoknowwhetherthere *aregroupswithmorethanoneactive@bfq_entity *(seethecommentstothefunction *bfq_bfqq_may_idle()). *@rq_pos_tree:rbtreesortedbynext_requestposition,usedwhen *determiningiftwoormorequeueshaveinterleaving *requests(seebfq_find_close_cooperator()). * *Each(device,cgroup)pairhasitsownbfq_group,i.e.,foreachcgroup *thereisasetofbfq_groups,eachonecollectingthelower-level *entitiesbelongingtothegroupthatareactingonthesamedevice. * *Lockingworksasfollows: *o@bfqdisprotectedbythequeuelock,RCUisusedtoaccessit *fromthereaders. *oAlltheotherfieldsareprotectedbythe@bfqdqueuelock.
*/ struct bfq_group { /* must be the first member */ struct blkg_policy_data pd;
/* reference counter (see comments in bfq_bic_update_cgroup) */
refcount_t ref;
/* ------------- end of cgroups-support interface ------------- */
/* - interface of the internal hierarchical B-WF2Q+ scheduler - */
#ifdef CONFIG_BFQ_GROUP_IOSCHED /* both next loops stop at one of the child entities of the root group */ #define for_each_entity(entity) \ for (; entity ; entity = entity->parent)
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.26Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-09-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.