MCPcopy Create free account
hub / github.com/F-Stack/f-stack / racct_decay_callback

Function racct_decay_callback

freebsd/kern/kern_racct.c:1193–1216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1191}
1192
1193static void
1194racct_decay_callback(struct racct *racct, void *dummy1, void *dummy2)
1195{
1196 int64_t r_old, r_new;
1197
1198 ASSERT_RACCT_ENABLED();
1199 RACCT_LOCK_ASSERT();
1200
1201#ifdef RCTL
1202 rctl_throttle_decay(racct, RACCT_READBPS);
1203 rctl_throttle_decay(racct, RACCT_WRITEBPS);
1204 rctl_throttle_decay(racct, RACCT_READIOPS);
1205 rctl_throttle_decay(racct, RACCT_WRITEIOPS);
1206#endif
1207
1208 r_old = racct->r_resources[RACCT_PCTCPU];
1209
1210 /* If there is nothing to decay, just exit. */
1211 if (r_old <= 0)
1212 return;
1213
1214 r_new = r_old * RACCT_DECAY_FACTOR / FSCALE;
1215 racct->r_resources[RACCT_PCTCPU] = r_new;
1216}
1217
1218static void
1219racct_decay_pre(void)

Callers

nothing calls this directly

Calls 1

rctl_throttle_decayFunction · 0.85

Tested by

no test coverage detected