Page MenuHomeFreeBSD

We only want to send the speedup to the lower layers when there's a shortage.

Authored by imp on Jan 15 2020, 1:11 AM.



Only send a speedup when there's a shortage. While this is a little racy, lost
races aren't a big deal for this function. If there's a shorage just popping up
after we check these values, then we'll catch it next time. If there's a
shortage that's just clearing up, we may do some work at the lower layers a
little sooner than we otherwise would have. Sicne shortages are relatively rare
events, both races are acceptable.

Test Plan

Without these, I'm seeing way too many speedups.

I tested this with:
dtrace -n 'fbt::softdep_send_speedup:entry {stack()}'

before the change, I saw it called all the time. After, it wasn't called at all.

Thanks for chuck for noticing the myriad of issues here. Other reviews will fix the other ones.

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.