Messages in this thread Patch in this message |  | | From | Ed Tomlinson <> | Subject | [RFC][PATCH] vm_swap_full | Date | Sun, 4 Nov 2001 10:23:41 -0500 |
| |
Hi,
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.
Comments? Ed Tomlinson - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|  |