Current-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: swapctl: SWAP_STATS different to SWAP_NSWAP (2 != 3)
Date: Thu, 12 Feb 2026 11:20:44 +0100
From: Thomas Klausner <wiz%netbsd.org@localhost>
Message-ID: <aY2pPkPdTMcndDhR%exadelic.gatalith.at@localhost>
| I think that might have made it worse:
Yes, I can see how that would happen, if the user process needed to
be paged in (and something else out) in order to allow a copyout()
to copy into memory that is residing in RAM (which it obviously needs
to be). There are other ways that can be handled, with the lock not
covering the copyout, or not locking at all, and simply detecting that
the list of swap devices changed, and start the whole process over.
The latter is easy to do in the easy cases, but hard in the difficult
one - it would be easy to fix things so the right number of stats records
are returned, difficult to avoid getting the same one twice and missing one.
(Eg: if while copying out the middle entry, the 1st and 3rd swapped places,
the sys call would return the same data in the 1st and 3rd slots - it might
already be doing that sometimes, with no error messages, and you're just
not noticing).
I have an idea, which I will test ... For now I will revert mrg@'s
change, which while I agree is addressing the right issue, not in quite
the right way.
kre
Home |
Main Index |
Thread Index |
Old Index