NetBSD-Bugs archive

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

re: kern/56550: swapctl: SWAP_STATS different to SWAP_NSWAP (1 != 3)



The following reply was made to PR bin/56550; it has been noted by GNATS.

From: matthew green <mrg%eterna.com.au@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost, mac%culver.net@localhost
Subject: re: kern/56550: swapctl: SWAP_STATS different to SWAP_NSWAP (1 != 3)
Date: Mon, 27 Dec 2021 18:05:59 +1100

 i really don't see how this can happen without something
 doing swapctl(8) configuration in the middle.  i let a
 system run swapctl -l a few 10,000s of times with one
 device and 2 files configured, no problem.
 
 the code literally just returns "uvmexp.nswapdev", and
 that only changes when swap devices are added or removed,
 so maybe something internal is weird (though the transient
 nature of this is very odd.)
 
 more things you could do:  build a kernel with:
 
    options UVMHIST
 
 and when you observe the failure, run "vmstat -u pdhist",
 and see what these entries show:
 
 ---
 if (SCARG(uap, cmd) == SWAP_NSWAP) {
         const int nswapdev = uvmexp.nswapdev;
         UVMHIST_LOG(pdhist, "<- done SWAP_NSWAP=%jd", nswapdev,
             0, 0, 0);
         *retval = nswapdev;
         return 0;
 ---
 
 you could also patch uvm_swap_stats() to print something if
 it gets to thsi line:
 
         *retval = count;
 
 right before the return, and check that "count == misc",
 printing them both if mismatched.  if this happens, the
 next step would be to look deeper into double-loop in this
 function and see what it is doing wrong.
 
 
 .mrg.
 


Home | Main Index | Thread Index | Old Index