svn commit: r329894 - user/jeff/numa/sys/vm
Mark Johnston
markj at FreeBSD.org
Fri Mar 9 16:42:34 UTC 2018
On Sat, Feb 24, 2018 at 02:52:40AM +0000, Jeff Roberson wrote:
> Author: jeff
> Date: Sat Feb 24 02:52:39 2018
> New Revision: 329894
> URL: https://svnweb.freebsd.org/changeset/base/329894
>
> Log:
> Fine grain lock reservations. This permits us to free to a reservation
> without the domain free lock held. It further reduces the scope of the free
> lock so that it now only protects the queues and allocation from the free count.
>
> Modified: user/jeff/numa/sys/vm/vm_page.c
> ==============================================================================
> --- user/jeff/numa/sys/vm/vm_page.c Sat Feb 24 02:08:18 2018 (r329893)
> +++ user/jeff/numa/sys/vm/vm_page.c Sat Feb 24 02:52:39 2018 (r329894)
> [...]
> @@ -2595,15 +2577,18 @@ retry:
> KASSERT(m->dirty == 0,
> ("page %p is dirty", m));
> }
> - SLIST_INSERT_HEAD(&free, m, plinks.s.ss);
> +#if VM_NRESERVLEVEL > 0
> + if (!vm_reserv_free_page(m))
> +#endif
> + SLIST_INSERT_HEAD(&free, m,
> + plinks.s.ss);
> } else
> error = EBUSY;
> unlock:
> VM_OBJECT_WUNLOCK(object);
> } else {
> MPASS(vm_phys_domain(m) == domain);
> - vmd = VM_DOMAIN(domain);
> - vm_domain_free_lock(vmd);
> + vm_page_lock(m);
> order = m->order;
> if (order < VM_NFREEORDER) {
> /*
> @@ -2620,7 +2605,7 @@ unlock:
> else if (vm_reserv_is_page_free(m))
> order = 0;
> #endif
> - vm_domain_free_unlock(vmd);
> + vm_page_unlock(m);
> if (order == VM_NFREEORDER)
> error = EINVAL;
> }
I think this part of the change is not quite right. The free lock
synchronizes access to the "order" field in addition to the reservation
structures.
More information about the svn-src-user
mailing list