Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-iolatency.c Create Date:2022-07-28 17:45:33
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:iolatency_check_latencies

Proto:static void iolatency_check_latencies(struct iolatency_grp *iolat, u64 now)

Type:void

Parameter:

TypeParameterName
struct iolatency_grp *iolat
u64now
522  blkg = lat_to_blkg(iolat)
529  latency_stat_init(iolat, & stat)
530  Even if we don't have any preemption, we need preempt disable/enable* to be barriers, so that we don't have things like get_user/put_user* that can cause faults and scheduling migrate into our preempt-protected* region.()
531  for_each_online_cpu(cpu)
533  s = per_cpu_ptr(stats, cpu)
534  latency_stat_sum(iolat, & stat, s)
535  latency_stat_init(iolat, s)
537  preempt_enable()
539  parent = blkg_to_lat( all non-root blkcg_gq's are guaranteed to have access to parent )
540  If Not parent Then Return
543  lat_info = child_lat
545  iolat_update_total_lat_avg(iolat, & stat)
548  If latency_sum_ok(iolat, & stat) && atomic_read( & Cookie to tell if we need to scale up or down. ) == DEFAULT_SCALE_COOKIE Then Return
553  spin_lock_irqsave( & lock, flags)
555  latency_stat_sum(iolat, & cur_stat, & stat)
556  Total io's from all of our children for the last summation. -= Our current number of IO's for the last summation.
557  Total io's from all of our children for the last summation. += latency_stat_samples(iolat, & cur_stat)
558  Our current number of IO's for the last summation. = latency_stat_samples(iolat, & cur_stat)
560  If Last time we adjusted the scale of everybody. >= now || now - Last time we adjusted the scale of everybody. < BLKIOLATENCY_MIN_ADJUST_TIME Then Go to out
564  If latency_sum_ok(iolat, & cur_stat) && latency_sum_ok(iolat, & stat) Then
566  If latency_stat_samples(iolat, & cur_stat) < BLKIOLATENCY_MIN_GOOD_SAMPLES Then Go to out
573  Else if The latency that we missed. == 0 || The latency that we missed. >= min_lat_nsec Then
575  Last time we adjusted the scale of everybody. = now
581  We scale the qd down faster than we scale up, so we need to use this helper* to adjust the scale_cookie accordingly so we don't prematurely get* scale_cookie at DEFAULT_SCALE_COOKIE and unthrottle too much
583  latency_stat_init(iolat, & cur_stat)
584  out :
585  spin_unlock_irqrestore( & lock, flags)
Caller
NameDescribe
blkcg_iolatency_done_bio