From 8d67b8c86313c2296f1bb4667a189a767e8a605b Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Wed, 20 Jul 2016 17:20:22 +0000 Subject: [PATCH] Add a comment describing the 'fast path' that was introduced in r270011. Reviewed by: kib MFC after: 3 days Sponsored by: EMC / Isilon Storage Division --- sys/vm/vm_fault.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index b60e4ec54c1..050ddddaa68 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -354,6 +354,15 @@ RetryFault:; KASSERT((fault_flags & VM_FAULT_WIRE) == 0, ("!wired && VM_FAULT_WIRE")); + /* + * Try to avoid lock contention on the top-level object through + * special-case handling of some types of page faults, specifically, + * those that are both (1) mapping an existing page from the top- + * level object and (2) not having to mark that object as containing + * dirty pages. Under these conditions, a read lock on the top-level + * object suffices, allowing multiple page faults of a similar type to + * run in parallel on the same top-level object. + */ if (fs.vp == NULL /* avoid locked vnode leak */ && (fault_flags & (VM_FAULT_WIRE | VM_FAULT_DIRTY)) == 0 && /* avoid calling vm_object_set_writeable_dirty() */