Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/uvm/uvm_fault.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/uvm/uvm_fault.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.224 retrieving revision 1.225 diff -u -p -r1.224 -r1.225 --- src/sys/uvm/uvm_fault.c 2020/03/23 10:35:56 1.224 +++ src/sys/uvm/uvm_fault.c 2020/04/13 22:22:19 1.225 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_fault.c,v 1.224 2020/03/23 10:35:56 skrll Exp $ */ +/* $NetBSD: uvm_fault.c,v 1.225 2020/04/13 22:22:19 ad Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.224 2020/03/23 10:35:56 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.225 2020/04/13 22:22:19 ad Exp $"); #include "opt_uvmhist.h" @@ -1184,10 +1184,15 @@ uvm_fault_check( if (amap) uvmfault_anonflush(*ranons, nback); - /* flush object? */ + /* + * flush object? change lock type to RW_WRITER, to avoid + * excessive competition between read/write locks if many + * threads doing "sequential access". + */ if (uobj) { voff_t uoff; + flt->lower_lock_type = RW_WRITER; uoff = ufi->entry->offset + eoff; rw_enter(uobj->vmobjlock, RW_WRITER); (void) (uobj->pgops->pgo_put)(uobj, uoff, uoff +