Re: kernel swap accounting...
Hi! AFAIK, shared pages usually get in swap cache first and stay there till page reference count reaches limit. As soon as it is reached page is swapped out on disk. P.S. Sorry for posting reply over original message. E-mail client on my handheld device isn't configurable enough :-( ------Original Message------ From: Mulyadi Santosa Sender: kernelnewbies-bounces@kernelnewbies.org To: kernelnewbies Subject: kernel swap accounting... Sent: 31 Jan 2012 18:02 Hi all Recently I dig out my old script that count the total number of swapped out pages. Basically, the script looks like this (sorry for any obvious typo): for a in /proc/[0-9]* do strings $a/cmdline; echo ; grep Swap $a/smaps | awk '{ SUM += $2 } END { print SUM }'; echo ----------------; done the problem is: the total number of swapped out pages (in kilobytes) doesn't match the output of "free" (swap used column). The difference is not really big, it ranges around 1-2 megabytes in my measurements. Anybody knows why? -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies Best wishes, Vladimir Murzin
hi :) On Tue, Jan 31, 2012 at 22:38, Vladimir Murzin <murzin.v@gmail.com> wrote:
Hi!
AFAIK, shared pages usually get in swap cache first and stay there till page reference count reaches limit. As soon as it is reached page is swapped out on disk.
So, what you're trying to say is that: the difference makes sense due to some pages that end up in swap cache? AFAIK too, swap cache is pages that once swapout, then brought back to RAM but still sits in swap too. This is done to save I/O once there's successive swap out that follows. -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
participants (2)
-
Mulyadi Santosa -
Vladimir Murzin