diff options
author | ian <ian@FreeBSD.org> | 2014-12-22 20:42:36 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2014-12-22 20:42:36 +0000 |
commit | e44e2ac96cf31d43feaa3799d037451905c08d4e (patch) | |
tree | e71cd82bb70c1f4965b2df19e17871824730d8f2 /lib/libstand/nfs.c | |
parent | 29ef6caa33e03d08ca726f6ae8f66e62cd2f661f (diff) | |
download | FreeBSD-src-e44e2ac96cf31d43feaa3799d037451905c08d4e.zip FreeBSD-src-e44e2ac96cf31d43feaa3799d037451905c08d4e.tar.gz |
Add a divisor parameter to twiddle() so that callers can request that output
only happen on every Nth call. Update the existing twiddle() calls done in
various IO loops to roughly reflect the relative IO sizes. That is, tftp
and nfs call twiddle() on every 1K block, ufs on every filesystem block,
so the network calls now use a much larger divisor than disk IO calls.
Also add a new twiddle_divisor() function that allows an application to set
a global divisor that is applied on top of the per-call divisors. Nothing
calls this yet, but loader(8) will be using it to further throttle the
cursor for slow serial consoles.
Diffstat (limited to 'lib/libstand/nfs.c')
-rw-r--r-- | lib/libstand/nfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libstand/nfs.c b/lib/libstand/nfs.c index adb0a11..a0b726c 100644 --- a/lib/libstand/nfs.c +++ b/lib/libstand/nfs.c @@ -662,7 +662,7 @@ nfs_read(struct open_file *f, void *buf, size_t size, size_t *resid) (int)fp->off); #endif while ((int)size > 0) { - twiddle(); + twiddle(16); cc = nfs_readdata(fp, fp->off, (void *)addr, size); /* XXX maybe should retry on certain errors */ if (cc == -1) { @@ -1311,7 +1311,7 @@ nfs_read(struct open_file *f, void *buf, size_t size, size_t *resid) (int)fp->off); #endif while ((int)size > 0) { - twiddle(); + twiddle(16); cc = nfs_readdata(fp, fp->off, (void *)addr, size); /* XXX maybe should retry on certain errors */ if (cc == -1) { |