summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_physio.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1994-08-06 09:15:42 +0000
committerdg <dg@FreeBSD.org>1994-08-06 09:15:42 +0000
commit8b20309268255f6f6fbc908e5af8c9cde9a1a1c2 (patch)
tree67aa5e71ca8f826b24875a0de9a602849d2b2573 /sys/kern/kern_physio.c
parentedb74877fe59af8008b23d2137302c9ad64c15d2 (diff)
downloadFreeBSD-src-8b20309268255f6f6fbc908e5af8c9cde9a1a1c2.zip
FreeBSD-src-8b20309268255f6f6fbc908e5af8c9cde9a1a1c2.tar.gz
Incorporated post 1.1.5 work from John Dyson. This includes performance
improvements via the new routines pmap_qenter/pmap_qremove and pmap_kenter/ pmap_kremove. These routine allow fast mapping of pages for those architectures that have "normal" MMUs. Also included is a fix to the pageout daemon to properly check a queue end condition. Submitted by: John Dyson
Diffstat (limited to 'sys/kern/kern_physio.c')
-rw-r--r--sys/kern/kern_physio.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c
index 21a3c38..487e38e 100644
--- a/sys/kern/kern_physio.c
+++ b/sys/kern/kern_physio.c
@@ -16,7 +16,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id$
+ * $Id: kern_physio.c,v 1.3 1994/08/02 07:42:05 davidg Exp $
*/
#include <sys/param.h>
@@ -38,10 +38,12 @@ physio(strategy, bp, dev, rw, minp, uio)
struct uio *uio;
{
int i;
- int bp_alloc = (bp == 0);
int bufflags = rw?B_READ:0;
int error;
int spl;
+ caddr_t sa;
+ int bp_alloc = (bp == 0);
+ struct buf *bpa;
/*
* keep the process from being swapped
@@ -49,10 +51,8 @@ physio(strategy, bp, dev, rw, minp, uio)
curproc->p_flag |= P_PHYSIO;
/* create and build a buffer header for a transfer */
-
- if (bp_alloc) {
- bp = (struct buf *)getpbuf();
- } else {
+ bpa = (struct buf *)getpbuf();
+ if (!bp_alloc) {
spl = splbio();
while (bp->b_flags & B_BUSY) {
bp->b_flags |= B_WANTED;
@@ -60,8 +60,14 @@ physio(strategy, bp, dev, rw, minp, uio)
}
bp->b_flags |= B_BUSY;
splx(spl);
+ } else {
+ bp = bpa;
}
+ /*
+ * get a copy of the kva from the physical buffer
+ */
+ sa = bpa->b_data;
bp->b_proc = curproc;
bp->b_dev = dev;
error = bp->b_error = 0;
@@ -76,6 +82,11 @@ physio(strategy, bp, dev, rw, minp, uio)
bp->b_flags = B_BUSY | B_PHYS | B_CALL | bufflags;
bp->b_iodone = physwakeup;
bp->b_data = uio->uio_iov[i].iov_base;
+ /*
+ * pass in the kva from the physical buffer
+ * for the temporary kernel mapping.
+ */
+ bp->b_saveaddr = sa;
bp->b_blkno = btodb(uio->uio_offset);
@@ -123,9 +134,8 @@ physio(strategy, bp, dev, rw, minp, uio)
doerror:
- if (bp_alloc) {
- relpbuf(bp);
- } else {
+ relpbuf(bpa);
+ if (!bp_alloc) {
bp->b_flags &= ~(B_BUSY|B_PHYS);
if( bp->b_flags & B_WANTED) {
bp->b_flags &= ~B_WANTED;
OpenPOWER on IntegriCloud