Skip to contentSkip to conversation

A question regarding TG load tracking functions in fair.c

DISCUSSION Matthew Leach 2 participants 2 messages Feb 28, 2014

lore
Share & tools
lore
#0 lore raw

Hi Paul,

I have a question regarding two lines of code in the functions __update_cfs_rq_tg_load_contrib and __update_tg_runnable_avg. AFAICS these functions update a load-tracking signal for the local RQ and an aggregated signal in the TG for all RQs that belong to this TG. The update is surrounded by conditions:

  if (abs(contrib) > cfs_rq->tg_runnable_contrib / 64) {

for __update_tg_runnable_avg and

  if (force_update || abs(tg_contrib) > cfs_rq->tg_load_contrib / 8) {

for __update_cfs_rq_tg_load_contrib. Is this an optimisation to prevent the signals being updated for small variations? Also, could you please shed some light on the specific numbers used?

Thanks,

Signature · 1 line
Matt
#1 lore raw
Quoted 10 lines · Matthew Leach

Hi Paul,

I have a question regarding two lines of code in the functions __update_cfs_rq_tg_load_contrib and __update_tg_runnable_avg. AFAICS these functions update a load-tracking signal for the local RQ and an aggregated signal in the TG for all RQs that belong to this TG. The update is surrounded by conditions:

  if (abs(contrib) > cfs_rq->tg_runnable_contrib / 64) {
Quoted 7 lines

for __update_tg_runnable_avg and

  if (force_update || abs(tg_contrib) > cfs_rq->tg_load_contrib / 8) {

for __update_cfs_rq_tg_load_contrib. Is this an optimisation to prevent the signals being updated for small variations? Also, could you please shed some light on the specific numbers used?

Yes, its an optimization; updating global state is expensive. I'll let Paul explain the specific numbers.