Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\flex_proportions.c Create Date:2022-07-28 06:14:06
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:fprop_reflect_period_percpu

Proto:static void fprop_reflect_period_percpu(struct fprop_global *p, struct fprop_local_percpu *pl)

Type:void

Parameter:

TypeParameterName
struct fprop_global *p
struct fprop_local_percpu *pl
192  period = Current period
196  If Period in which we last updated events == period Then Return
198  raw_spin_lock_irqsave( & Protect period and numerator , flags)
200  If Period in which we last updated events >= period Then
201  raw_spin_unlock_irqrestore( & Protect period and numerator , flags)
202  Return
205  If period - Period in which we last updated events < BITS_PER_LONG Then
206  val = percpu_counter_read( & he local events counter )
208  If val < nr_cpu_ids * ---- PERCPU ---- Then val = percpu_counter_sum( & he local events counter )
211  percpu_counter_add_batch( & he local events counter , - val + (val >> (period - Period in which we last updated events )), ---- PERCPU ----)
213  Else percpu_counter_set( & he local events counter , 0)
215  Period in which we last updated events = period
216  raw_spin_unlock_irqrestore( & Protect period and numerator , flags)
Caller
NameDescribe
__fprop_inc_percpuEvent of type pl happened
fprop_fraction_percpu
__fprop_inc_percpu_maxLike __fprop_inc_percpu() except that event is counted only if the given* type has fraction smaller than @max_frac/FPROP_FRAC_BASE