Source-Changes-HG archive

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

[src/trunk]: src/tests/sys/uvm Fixed issues with uvm_page_physunload_delete_e...



details:   https://anonhg.NetBSD.org/src/rev/edbf6f49e1df
branches:  trunk
changeset: 996038:edbf6f49e1df
user:      fox <fox%NetBSD.org@localhost>
date:      Wed Jan 16 13:54:17 2019 +0000

description:
Fixed issues with uvm_page_physunload_delete_end test case.

1. "avail_start" and "start" were different, resulting in unreachable code in
uvm_page_physunload(), where the condition check "avail_start" < "end" fails.
The test has been fixed by setting "avail_start" and "start" to the same value.

2. If "start" is the address with end address being "start + 2", we can
unplug twice, the first paddr_t would be "start" and the second one would be
"start + 1". Modified the ATF_CHECK_EQ() to reflect these changes.

Reviewed by <cherry>

diffstat:

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

diffs (42 lines):

diff -r 1eaa60576dfa -r edbf6f49e1df tests/sys/uvm/t_uvm_physseg.c
--- a/tests/sys/uvm/t_uvm_physseg.c     Wed Jan 16 13:45:29 2019 +0000
+++ b/tests/sys/uvm/t_uvm_physseg.c     Wed Jan 16 13:54:17 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_uvm_physseg.c,v 1.7 2019/01/16 13:45:29 fox Exp $ */
+/* $NetBSD: t_uvm_physseg.c,v 1.8 2019/01/16 13:54:17 fox Exp $ */
 
 /*-
  * Copyright (c) 2015, 2016 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_uvm_physseg.c,v 1.7 2019/01/16 13:45:29 fox Exp $");
+__RCSID("$NetBSD: t_uvm_physseg.c,v 1.8 2019/01/16 13:54:17 fox Exp $");
 
 /*
  * If this line is commented out tests related to uvm_physseg_get_pmseg()
@@ -2155,7 +2155,7 @@
         */
 
        upm = uvm_page_physload(VALID_START_PFN_1, VALID_START_PFN_1 + 2,
-           VALID_AVAIL_START_PFN_1 + 1, VALID_AVAIL_START_PFN_1 + 2,
+           VALID_AVAIL_START_PFN_1, VALID_AVAIL_START_PFN_1 + 2,
            VM_FREELIST_DEFAULT);
 
        ATF_REQUIRE_EQ(1, uvm_physseg_get_entries());
@@ -2177,11 +2177,13 @@
 
        ATF_CHECK_EQ(true, uvm_page_physunload(upm, VM_FREELIST_DEFAULT, &p));
 
+       ATF_CHECK_EQ(VALID_START_PFN_1, atop(p));
+
        p = 0;
 
        ATF_CHECK_EQ(true, uvm_page_physunload(upm, VM_FREELIST_DEFAULT, &p));
 
-       ATF_CHECK_EQ(VALID_START_PFN_1 + 2, atop(p));
+       ATF_CHECK_EQ(VALID_START_PFN_1 + 1, atop(p));
 
        ATF_CHECK_EQ(1, uvm_physseg_get_entries());
 



Home | Main Index | Thread Index | Old Index