Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/uvm do not wait for memory in pgo_fault methods, just re...
details: https://anonhg.NetBSD.org/src/rev/9ca3277502c8
branches: trunk
changeset: 969515:9ca3277502c8
user: chs <chs%NetBSD.org@localhost>
date: Sat Feb 22 19:46:48 2020 +0000
description:
do not wait for memory in pgo_fault methods, just return ENOMEM
and let the uvm_fault code wait if it is appropriate.
diffstat:
sys/arch/xen/xen/privcmd.c | 9 ++-------
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c | 13 +++++--------
sys/external/bsd/drm2/drm/drm_gem_cma_helper.c | 7 +++----
sys/uvm/uvm_device.c | 7 +++----
4 files changed, 13 insertions(+), 23 deletions(-)
diffs (152 lines):
diff -r 768fe34b93fd -r 9ca3277502c8 sys/arch/xen/xen/privcmd.c
--- a/sys/arch/xen/xen/privcmd.c Sat Feb 22 19:44:07 2020 +0000
+++ b/sys/arch/xen/xen/privcmd.c Sat Feb 22 19:46:48 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: privcmd.c,v 1.51 2017/06/22 22:36:50 chs Exp $ */
+/* $NetBSD: privcmd.c,v 1.52 2020/02/22 19:46:48 chs Exp $ */
/*-
* Copyright (c) 2004 Christian Limpach.
@@ -27,7 +27,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: privcmd.c,v 1.51 2017/06/22 22:36:50 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: privcmd.c,v 1.52 2020/02/22 19:46:48 chs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -502,7 +502,6 @@
PMAP_CANFAIL | ufi->entry->protection,
pobj->domid);
if (error == ENOMEM) {
- error = ERESTART;
break;
}
if (error) {
@@ -513,10 +512,6 @@
}
pmap_update(ufi->orig_map->pmap);
uvmfault_unlockall(ufi, ufi->entry->aref.ar_amap, uobj);
-
- if (error == ERESTART) {
- uvm_wait("privpgop_fault");
- }
return error;
}
diff -r 768fe34b93fd -r 9ca3277502c8 sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c Sat Feb 22 19:44:07 2020 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c Sat Feb 22 19:46:48 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i915_gem.c,v 1.59 2020/02/14 14:34:58 maya Exp $ */
+/* $NetBSD: i915_gem.c,v 1.60 2020/02/22 19:46:48 chs Exp $ */
/*
* Copyright © 2008-2015 Intel Corporation
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem.c,v 1.59 2020/02/14 14:34:58 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem.c,v 1.60 2020/02/22 19:46:48 chs Exp $");
#ifdef __NetBSD__
#if 0 /* XXX uvmhist option? */
@@ -2052,8 +2052,6 @@
out:
mutex_enter(uobj->vmobjlock);
uvmfault_unlockall(ufi, ufi->entry->aref.ar_amap, uobj);
- if (ret == -ERESTART)
- uvm_wait("i915flt");
/*
* Remap EINTR to success, so that we return to userland.
@@ -2087,7 +2085,7 @@
off_t curr_offset;
paddr_t paddr;
u_int mmapflags;
- int lcv, retval;
+ int lcv;
vm_prot_t mapprot;
UVMHIST_FUNC("i915_udv_fault"); UVMHIST_CALLED(maphist);
UVMHIST_LOG(maphist," flags=%jd", flags,0,0,0);
@@ -2119,7 +2117,6 @@
* loop over the page range entering in as needed
*/
- retval = 0;
for (lcv = 0 ; lcv < npages ; lcv++, curr_offset += PAGE_SIZE,
curr_va += PAGE_SIZE) {
if ((flags & PGO_ALLPAGES) == 0 && lcv != centeridx)
@@ -2147,12 +2144,12 @@
* XXX case.
*/
pmap_update(ufi->orig_map->pmap); /* sync what we have so far */
- return (ERESTART);
+ return ENOMEM;
}
}
pmap_update(ufi->orig_map->pmap);
- return (retval);
+ return 0;
}
#else
/**
diff -r 768fe34b93fd -r 9ca3277502c8 sys/external/bsd/drm2/drm/drm_gem_cma_helper.c
--- a/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c Sat Feb 22 19:44:07 2020 +0000
+++ b/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c Sat Feb 22 19:46:48 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: drm_gem_cma_helper.c,v 1.9 2019/11/05 23:29:28 jmcneill Exp $ */
+/* $NetBSD: drm_gem_cma_helper.c,v 1.10 2020/02/22 19:46:48 chs Exp $ */
/*-
* Copyright (c) 2015-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_gem_cma_helper.c,v 1.9 2019/11/05 23:29:28 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_gem_cma_helper.c,v 1.10 2020/02/22 19:46:48 chs Exp $");
#include <drm/drmP.h>
#include <drm/drm_gem_cma_helper.h>
@@ -246,8 +246,7 @@
PMAP_CANFAIL | mapprot | mmapflags) != 0) {
pmap_update(ufi->orig_map->pmap);
uvmfault_unlockall(ufi, ufi->entry->aref.ar_amap, uobj);
- uvm_wait("drm_gem_cma_fault");
- return ERESTART;
+ return ENOMEM;
}
}
diff -r 768fe34b93fd -r 9ca3277502c8 sys/uvm/uvm_device.c
--- a/sys/uvm/uvm_device.c Sat Feb 22 19:44:07 2020 +0000
+++ b/sys/uvm/uvm_device.c Sat Feb 22 19:46:48 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_device.c,v 1.67 2019/12/01 16:44:11 ad Exp $ */
+/* $NetBSD: uvm_device.c,v 1.68 2020/02/22 19:46:49 chs Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_device.c,v 1.67 2019/12/01 16:44:11 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_device.c,v 1.68 2020/02/22 19:46:49 chs Exp $");
#include "opt_uvmhist.h"
@@ -441,8 +441,7 @@
pmap_update(ufi->orig_map->pmap); /* sync what we have so far */
uvmfault_unlockall(ufi, ufi->entry->aref.ar_amap,
uobj);
- uvm_wait("udv_fault");
- return (ERESTART);
+ return ENOMEM;
}
}
Home |
Main Index |
Thread Index |
Old Index