[lkml]   [2001]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[RFC][PATCH] vm_swap_full

I my opinion, basing the vm_swap_full test on the size of swap is bogus.
If you have a 512M box with 128M of swap its a good idea to always release
aggressively. If the same box has 2G of swap (has /tmp on tmpfs maybe), it
does not make sense to start the agressive release at 1G. I suggest the
following makes more sense.

--- linux/include/linux/swap.h.orig Sun Nov 4 09:30:14 2001
+++ linux/include/linux/swap.h Sun Nov 4 09:32:46 2001
@@ -80,8 +80,8 @@

extern int nr_swap_pages;

-/* Swap 50% full? Release swapcache more aggressively.. */
-#define vm_swap_full() (nr_swap_pages*2 < total_swap_pages)
+/* Free swap less than inactive pages? Release swapcache more aggressively.. */
+#define vm_swap_full() (nr_swap_pages < nr_inactive_pages)

extern unsigned int nr_free_pages(void);
extern unsigned int nr_free_buffer_pages(void);
This starts aggressive swaping when the ammount of space left in swap is
less than the size of the inactive pages.

Ed Tomlinson
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:12    [W:0.066 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site