From 6957cc2e13f76f9f4db494d96ceab9face3eff1e Mon Sep 17 00:00:00 2001 From: yamt Date: Wed, 3 May 2006 15:57:35 +0000 Subject: [PATCH] ubc_fault: use PMAP_CANFAIL. pointed by Jed Davis on tech-kern@. --- sys/uvm/uvm_bio.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sys/uvm/uvm_bio.c b/sys/uvm/uvm_bio.c index e332c21391ea..050778f45804 100644 --- a/sys/uvm/uvm_bio.c +++ b/sys/uvm/uvm_bio.c @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_bio.c,v 1.45 2006/04/13 02:17:42 yamt Exp $ */ +/* $NetBSD: uvm_bio.c,v 1.46 2006/05/03 15:57:35 yamt Exp $ */ /* * Copyright (c) 1998 Chuck Silvers. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.45 2006/04/13 02:17:42 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.46 2006/05/03 15:57:35 yamt Exp $"); #include "opt_uvmhist.h" @@ -359,14 +359,20 @@ again: pg->offset < umap->writeoff || pg->offset + PAGE_SIZE > umap->writeoff + umap->writelen); mask = rdonly ? ~VM_PROT_WRITE : VM_PROT_ALL; - pmap_enter(ufi->orig_map->pmap, va, VM_PAGE_TO_PHYS(pg), - prot & mask, access_type & mask); + error = pmap_enter(ufi->orig_map->pmap, va, VM_PAGE_TO_PHYS(pg), + prot & mask, PMAP_CANFAIL | (access_type & mask)); uvm_lock_pageq(); uvm_pageactivate(pg); uvm_unlock_pageq(); pg->flags &= ~(PG_BUSY|PG_WANTED); UVM_PAGE_OWN(pg, NULL); simple_unlock(&uobj->vmobjlock); + if (error) { + UVMHIST_LOG(ubchist, "pmap_enter fail %d", + error, 0, 0, 0); + uvm_wait("ubc_pmfail"); + /* will refault */ + } } pmap_update(ufi->orig_map->pmap); return 0;