Comment out Kirks io-request priority hack until we can do this in a
civilized way which doesn't cause grief. The problem is that it is not generally safe to cast a "struct bio *" to a "struct buf *". Things like ccd, vinum, ata-raid and GEOM constructs bio's which are not entrails of a struct buf. Also, curthread may or may not have anything to do with the I/O request at hand. The correct solution can either be to tag struct bio's with a priority derived from the requesting threads nice and have disksort act on this field, this wouldn't address the "silly-seek syndrome" where two equal processes bang the diskheads from one edge to the other of the disk repeatedly. Alternatively, and probably better: a sleep should be introduced either at the time the I/O is requested or at the time it is completed where we can be sure to sleep in the right thread. The sleep also needs to be in constant timeunits, 1/hz can be practicaly any sub-second size, at high HZ the current code practically doesn't do anything.
This commit is contained in:
parent
d435ac4e91
commit
29f88f470e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=95246
@ -50,6 +50,7 @@
|
||||
#include <sys/syslog.h>
|
||||
#include <machine/atomic.h>
|
||||
|
||||
#ifdef notquite
|
||||
/*
|
||||
* Mutex to use when delaying niced I/O bound processes in bioqdisksort().
|
||||
*/
|
||||
@ -61,6 +62,7 @@ dksort_init(void)
|
||||
mtx_init(&dksort_mtx, "dksort", NULL, MTX_DEF);
|
||||
}
|
||||
SYSINIT(dksort, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, dksort_init, NULL)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Seek sort for disks.
|
||||
@ -85,6 +87,8 @@ bioqdisksort(bioq, bp)
|
||||
struct bio *bq;
|
||||
struct bio *bn;
|
||||
struct bio *be;
|
||||
|
||||
#ifdef notquite
|
||||
struct thread *td = curthread;
|
||||
|
||||
if (td && td->td_ksegrp->kg_nice > 0) {
|
||||
@ -98,6 +102,7 @@ bioqdisksort(bioq, bp)
|
||||
td->td_ksegrp->kg_nice);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (!atomic_cmpset_int(&bioq->busy, 0, 1))
|
||||
panic("Recursing in bioqdisksort()");
|
||||
be = TAILQ_LAST(&bioq->queue, bio_queue);
|
||||
|
Loading…
Reference in New Issue
Block a user