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)



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