Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/uvm Part of PR kern/54994:



details:   https://anonhg.NetBSD.org/src/rev/7adf568f0991
branches:  trunk
changeset: 1007948:7adf568f0991
user:      rin <rin%NetBSD.org@localhost>
date:      Thu Mar 05 12:21:00 2020 +0000

description:
Part of PR kern/54994:

Memory allocated in the fast path of uarea_poolpage_alloc() is
a page itself. Therefore, it is obviously page-aligned.

Pointed out by skrll.

diffstat:

 sys/uvm/uvm_glue.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r c3e13427338a -r 7adf568f0991 sys/uvm/uvm_glue.c
--- a/sys/uvm/uvm_glue.c        Thu Mar 05 11:44:54 2020 +0000
+++ b/sys/uvm/uvm_glue.c        Thu Mar 05 12:21:00 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_glue.c,v 1.176 2020/01/12 12:55:03 ad Exp $        */
+/*     $NetBSD: uvm_glue.c,v 1.177 2020/03/05 12:21:00 rin Exp $       */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_glue.c,v 1.176 2020/01/12 12:55:03 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_glue.c,v 1.177 2020/03/05 12:21:00 rin Exp $");
 
 #include "opt_kgdb.h"
 #include "opt_kstack.h"
@@ -244,7 +244,8 @@
        KASSERT((flags & PR_WAITOK) != 0);
 
 #if defined(PMAP_MAP_POOLPAGE)
-       while (USPACE == PAGE_SIZE && USPACE_ALIGN == 0) {
+       while (USPACE == PAGE_SIZE &&
+           (USPACE_ALIGN == 0 || USPACE_ALIGN == PAGE_SIZE)) {
                struct vm_page *pg;
                vaddr_t va;
 #if defined(PMAP_ALLOC_POOLPAGE)
@@ -274,7 +275,8 @@
 uarea_poolpage_free(struct pool *pp, void *addr)
 {
 #if defined(PMAP_MAP_POOLPAGE)
-       if (USPACE == PAGE_SIZE && USPACE_ALIGN == 0) {
+       if (USPACE == PAGE_SIZE &&
+           (USPACE_ALIGN == 0 || USPACE_ALIGN == PAGE_SIZE)) {
                paddr_t pa;
 
                pa = PMAP_UNMAP_POOLPAGE((vaddr_t) addr);



Home | Main Index | Thread Index | Old Index