Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Check our parent and see if the scale cookie has changed.

Proto:static void check_scale_change(struct iolatency_grp *iolat)

Type:void

Parameter:

TypeParameterName
struct iolatency_grp *iolat
396  our_cookie = atomic_read( & scale_cookie)
399  direction = 0
401  If ( all non-root blkcg_gq's are guaranteed to have access to parent == NULL) Then Return
404  parent = blkg_to_lat( all non-root blkcg_gq's are guaranteed to have access to parent )
405  If Not parent Then Return
408  lat_info = child_lat
409  cur_cookie = atomic_read( & Cookie to tell if we need to scale up or down. )
410  scale_lat = READ_ONCE( The latency that we missed. )
412  If cur_cookie < our_cookie Then direction = -1
414  Else if cur_cookie > our_cookie Then direction = 1
416  Else Return
419  old = atomic_cmpxchg( & scale_cookie, our_cookie, cur_cookie)
422  If old != our_cookie Then Return
425  If direction < 0 && min_lat_nsec Then
428  If Not scale_lat || min_lat_nsec <= scale_lat Then Return
437  samples_thresh = Total io's from all of our children for the last summation. * 5
438  samples_thresh = max - return maximum of two values of the same or compatible types*@x: first value*@y: second value(1ULL, div64_u64 - unsigned 64bit divide with 64bit divisor*@dividend: 64bit dividend*@divisor: 64bit divisor* This implementation is a modified version of the algorithm proposed* by the book 'Hacker's Delight'. The original source and full proof)
439  If Our current number of IO's for the last summation. <= samples_thresh Then Return
444  If max_depth == 1 && direction < 0 Then
445  blkcg_use_delay(lat_to_blkg(iolat))
446  Return
450  If cur_cookie == DEFAULT_SCALE_COOKIE Then
451  blkcg_clear_delay(lat_to_blkg(iolat))
452  max_depth = UINT_MAX
453  wake_up_all( & wait)
454  Return
457  Change the queue depth of the iolatency_grp. We add/subtract 1/16th of the* queue depth at a time so we don't get wild swings and hopefully dial in to* fairer distribution of the overall queue depth.
Caller
NameDescribe
blkcg_iolatency_throttle