From: Hugh Dickins Stop vm_enough_memory double counting total_swapcache_pages: it dates from the days when we didn't free swap when freeing swapcache page. 25-akpm/mm/mmap.c | 8 -------- 1 files changed, 8 deletions(-) diff -puN mm/mmap.c~hugh-12-vm_enough_memory-double-counts mm/mmap.c --- 25/mm/mmap.c~hugh-12-vm_enough_memory-double-counts Tue Mar 25 18:35:02 2003 +++ 25-akpm/mm/mmap.c Tue Mar 25 18:35:02 2003 @@ -82,14 +82,6 @@ int vm_enough_memory(long pages) free += nr_swap_pages; /* - * This double-counts: the nrpages are both in the - * page-cache and in the swapper space. At the same time, - * this compensates for the swap-space over-allocation - * (ie "nr_swap_pages" being too small). - */ - free += total_swapcache_pages; - - /* * The code below doesn't account for free space in the * inode and dentry slab cache, slab cache fragmentation, * inodes and dentries which will become freeable under _