For the dynamic I/O scheduler, make the TRIM stuff also count against
read bias so we do reads in preference to TRIMs. This helps a lot when many trims are delivered at once from the upper layers as they tend to delay READs due to priority inversion in the code today. The non iosched case will be fixed when the trim comibing changes needed for nvme come in later this year. Sponsored by: Netflix
This commit is contained in:
parent
3196b50827
commit
62c94a0551
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=336752
@ -1307,7 +1307,23 @@ cam_iosched_get_trim(struct cam_iosched_softc *isc)
|
||||
|
||||
if (!cam_iosched_has_more_trim(isc))
|
||||
return NULL;
|
||||
|
||||
#ifdef CAM_IOSCHED_DYNAMIC
|
||||
if (do_dynamic_iosched) {
|
||||
/*
|
||||
* If pending read, prefer that based on current read bias
|
||||
* setting.
|
||||
*/
|
||||
if (bioq_first(&isc->bio_queue) && isc->current_read_bias) {
|
||||
isc->current_read_bias--;
|
||||
/* We're not limiting TRIMS, per se, just doing reads first */
|
||||
return NULL;
|
||||
}
|
||||
/*
|
||||
* We're going to do a trim, so reset the bias.
|
||||
*/
|
||||
isc->current_read_bias = isc->read_bias;
|
||||
}
|
||||
#endif
|
||||
return cam_iosched_next_trim(isc);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user