Re: Odd swap behavior in 2.1.60

Bill Hawes (whawes@star.net)
Sat, 01 Nov 1997 12:39:52 -0500


This is a multi-part message in MIME format.
--------------D11BACA9F119EFF03BF771EA
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

tenthumbs@cybernex.net wrote:
> No good. Now I get large numbers of
> try_to_unuse: entry %08lx not in use messages.
> from your patch.
>
> It's still true that the appearance of the "d_alloc: ... pruning dcache"
> messages is a prerequisite as well as swapping into the second partition.

I'm interested in tracking this down, as it seems to indicate that the
system is losing track of what pages are swapped out. I've attached a
very small patch (against 2.1.61) that will give some additional
information about the "not in use" swap pages. The experiment I'd like
you to try is as follows.

Apply the patch, then do whatever normally starts swapping into your
second swapfile. When this happens, do a swapoff on your _first_
swapfile. This should generate lots of additional swapping, and will
show which pages weren't found in the first swapfile. (And you'll be
able to capture the messages in your syslog.)

Now turn swapping on for the first file, and try a swapoff on the
second.

After this, just snip the messages from your log so we can see how many
and what entries aren't being found.

Regards,
Bill
--------------D11BACA9F119EFF03BF771EA
Content-Type: text/plain; charset=us-ascii; name="swap_61-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="swap_61-patch"

--- mm/swapfile.c.old Fri Oct 31 00:26:08 1997
+++ mm/swapfile.c Fri Oct 31 14:24:53 1997
@@ -350,8 +350,9 @@
*/
if (si->swap_map[i] != 0) {
if (si->swap_map[i] != 127)
- printk("try_to_unuse: entry %08lx "
- "not in use\n", entry);
+ printk("try_to_unuse: %d not used, "
+ "count=%d, entry=%lx\n",
+ i, si->swap_map[i], entry);
si->swap_map[i] = 0;
nr_swap_pages++;
}

--------------D11BACA9F119EFF03BF771EA--