Randy observed that 2.5 /proc/meminfo SwapFree holds steady
while SwapTotal goes up and down: wrong way round!
Andrew pointed to wrong conditional in si_swapinfo(): 2.5.4
updated it incorrectly when new flags bit was briefly added.
And pointed out that it also makes si_swapinfo much too slow.
swap_list_lock();
for (i = 0; i < nr_swapfiles; i++) {
unsigned int j;
- if (!(swap_info[i].flags & SWP_USED))
+ if (!(swap_info[i].flags & SWP_USED) ||
+ (swap_info[i].flags & SWP_WRITEOK))
continue;
for (j = 0; j < swap_info[i].max; ++j) {
switch (swap_info[i].swap_map[j]) {