Date: Fri, 1 Dec 2017 01:51:33 +0000 (UTC) From: Jeff Roberson <jeff@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r326418 - user/jeff/numa/sys/vm Message-ID: <201712010151.vB11pXC2054900@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jeff Date: Fri Dec 1 01:51:32 2017 New Revision: 326418 URL: https://svnweb.freebsd.org/changeset/base/326418 Log: Address Markj's review feedback. Modified: user/jeff/numa/sys/vm/vm_kern.c user/jeff/numa/sys/vm/vm_page.c user/jeff/numa/sys/vm/vm_page.h user/jeff/numa/sys/vm/vm_reserv.c Modified: user/jeff/numa/sys/vm/vm_kern.c ============================================================================== --- user/jeff/numa/sys/vm/vm_kern.c Fri Dec 1 01:36:33 2017 (r326417) +++ user/jeff/numa/sys/vm/vm_kern.c Fri Dec 1 01:51:32 2017 (r326418) @@ -192,8 +192,8 @@ retry: if (m == NULL) { VM_OBJECT_WUNLOCK(object); if (tries < ((flags & M_NOWAIT) != 0 ? 1 : 3)) { - if (!vm_page_reclaim_contig_domain(pflags, 1, - domain, low, high, PAGE_SIZE, 0) && + if (!vm_page_reclaim_contig_domain(domain, + pflags, 1, low, high, PAGE_SIZE, 0) && (flags & M_WAITOK) != 0) VM_WAIT; VM_OBJECT_WLOCK(object); @@ -284,8 +284,8 @@ retry: if (m == NULL) { VM_OBJECT_WUNLOCK(object); if (tries < ((flags & M_NOWAIT) != 0 ? 1 : 3)) { - if (!vm_page_reclaim_contig_domain(pflags, npages, - domain, low, high, alignment, boundary) && + if (!vm_page_reclaim_contig_domain(domain, pflags, + npages, low, high, alignment, boundary) && (flags & M_WAITOK) != 0) VM_WAIT; VM_OBJECT_WLOCK(object); @@ -538,7 +538,7 @@ _kmem_unback(vm_object_t object, vm_offset_t addr, vm_ ("kmem_unback: only supports kernel object.")); if (size == 0) - return 0; + return (0); pmap_remove(kernel_pmap, addr, addr + size); offset = addr - VM_MIN_KERNEL_ADDRESS; end = offset + size; @@ -552,7 +552,7 @@ _kmem_unback(vm_object_t object, vm_offset_t addr, vm_ } VM_OBJECT_WUNLOCK(object); - return domain; + return (domain); } void Modified: user/jeff/numa/sys/vm/vm_page.c ============================================================================== --- user/jeff/numa/sys/vm/vm_page.c Fri Dec 1 01:36:33 2017 (r326417) +++ user/jeff/numa/sys/vm/vm_page.c Fri Dec 1 01:51:32 2017 (r326418) @@ -2568,7 +2568,7 @@ CTASSERT(powerof2(NRUNS)); * must be a power of two. */ bool -vm_page_reclaim_contig_domain(int req, u_long npages, int domain, +vm_page_reclaim_contig_domain(int domain, int req, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary) { vm_paddr_t curr_low; @@ -2662,7 +2662,7 @@ vm_page_reclaim_contig(int req, u_long npages, vm_padd ret = false; vm_policy_iterator_init(&vi); while ((vm_domain_iterator_run(&vi, &domain)) == 0) { - ret = vm_page_reclaim_contig_domain(req, npages, domain, low, + ret = vm_page_reclaim_contig_domain(domain, req, npages, low, high, alignment, boundary); if (ret) break; Modified: user/jeff/numa/sys/vm/vm_page.h ============================================================================== --- user/jeff/numa/sys/vm/vm_page.h Fri Dec 1 01:36:33 2017 (r326417) +++ user/jeff/numa/sys/vm/vm_page.h Fri Dec 1 01:51:32 2017 (r326418) @@ -515,7 +515,7 @@ void vm_page_putfake(vm_page_t m); void vm_page_readahead_finish(vm_page_t m); bool vm_page_reclaim_contig(int req, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary); -bool vm_page_reclaim_contig_domain(int req, u_long npages, int domain, +bool vm_page_reclaim_contig_domain(int domain, int req, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary); void vm_page_reference(vm_page_t m); void vm_page_remove (vm_page_t); Modified: user/jeff/numa/sys/vm/vm_reserv.c ============================================================================== --- user/jeff/numa/sys/vm/vm_reserv.c Fri Dec 1 01:36:33 2017 (r326417) +++ user/jeff/numa/sys/vm/vm_reserv.c Fri Dec 1 01:51:32 2017 (r326418) @@ -549,6 +549,8 @@ vm_reserv_alloc_contig(vm_object_t object, vm_pindex_t VM_LEVEL_0_SIZE), boundary > VM_LEVEL_0_SIZE ? boundary : 0); if (m == NULL) return (NULL); + KASSERT(vm_phys_domidx(m) == domain, + ("vm_reserv_alloc_contig: Page domain does not match requested.")); /* * The allocated physical pages always begin at a reservation @@ -568,7 +570,7 @@ vm_reserv_alloc_contig(vm_object_t object, vm_pindex_t LIST_INSERT_HEAD(&object->rvq, rv, objq); rv->object = object; rv->pindex = first; - rv->domain = vm_phys_domidx(m); + rv->domain = domain; KASSERT(rv->popcnt == 0, ("vm_reserv_alloc_contig: reserv %p's popcnt is corrupted", rv));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712010151.vB11pXC2054900>