Page MenuHomeFreeBSD

gnop: change the count until fail option
ClosedPublic

Authored by oshogbo on Dec 2 2019, 2:42 PM.

Details

Summary

Change the "count_until_fail" option to gnop, know it's enables the
failing rating instead of setting them to 100%.

The original patch introduced the new flag, which sets the fail/rate to 100% after N requests.
In some cases, I don't want to have 100% of failure probabilities, I just want to start failing at some point.
For example on the early stage, I would like to allow some read/writes requests before having some requests delayed.
For example when I try to mount partition, or when I'm trying to import pool.
Other case maybe to check how scrub in ZFS will behave, on different stages.
This is allows us to cover more cases.
The previous behavior still maybe configured.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Isn't this the reverse of the intent of the option ?

Yes. I mess it up while refactoring it.

I think you need to explain the purpose of the patch better.

Also regardless of that, I dislike it, you recalculate each of prob/delay vars several times. If I understand what you are trying to do, I would suggest to make the copy from sc to local vars conditional on sc_count_until_fail inside the switch.

@kib I introduced a helper function.

The original patch introduced the new flag, which sets the fail/rate to 100% after N requests.

In some cases, I don't want to have 100% of failure probabilities, I just want to start failing at some point.
For example on the early stage, I would like to allow some read/writes requests before having some requests delayed.
For example when I try to mount partition, or when I'm trying to import pool.
Other case maybe to check how scrub in ZFS will behave, on different stages.
This is allows us to cover more cases.
The previous behavior still maybe configured.

sys/geom/nop/g_nop.c
208 ↗(On Diff #65144)

But for BIO_WRITE we use sc_w*prob ?

sys/geom/nop/g_nop.c
208 ↗(On Diff #65144)

It's embarrassing. I'm not touching keyboard tonight anymore.

I suggest you to put the explanation of the change you did in response to my question, to the review summary and the commit message.

This revision is now accepted and ready to land.Dec 3 2019, 2:46 PM
This revision was automatically updated to reflect the committed changes.