Re: Fix (sort of) for OOM swap deadlock.

George (greerga@nidhogg.ham.muohio.edu)
Mon, 22 Jun 1998 00:53:41 -0400 (EDT)


On Mon, 22 Jun 1998, George wrote:

>@@ -564,6 +586,13 @@ int kswapd(void *unused)
> * woken up more often and the rate will be even
> * higher).
> */
>+ if (out_of_swap()) {
>+#ifdef DEBUG
>+ printk("kswapd: No swap left, not paging.\n");
>+#endif
>+ continue;
>+ }

There's always the obvious method that just slips by... :)

I haven't tested this one, but it compiles. It should work so long as
show_mem() is accurate, and my previous one doing the same concept worked
ok.

--- 2.1.106/linux/mm/vmscan.c Mon Jun 22 00:01:49 1998
+++ linux/mm/vmscan.c Mon Jun 22 00:44:47 1998
@@ -564,6 +564,13 @@ int kswapd(void *unused)
* woken up more often and the rate will be even
* higher).
*/
+ if (nr_swap_pages == 0) {
+#ifdef DEBUG
+ printk("kswapd: No swap left, not paging.\n");
+#endif
+ continue;
+ }
+
tries = pager_daemon.tries_base >> free_memory_available(3);

while (tries--) {

-George

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu