From fc5ec5883eb8c0e5bc9aa53c1be86091234b01b7 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Fri, 28 Sep 2012 10:19:42 +1000 Subject: [PATCH] swap-add-a-simple-detector-for-inappropriate-swapin-readahead-fix tweak code comment Cc: Hugh Dickins Cc: Konstantin Khlebnikov Cc: Minchan Kim Cc: Rik van Riel Cc: Shaohua Li Cc: Shaohua Li Cc: Wu Fengguang Signed-off-by: Andrew Morton --- mm/internal.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index e4a205bdd8c0..299aa10d6390 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -374,15 +374,12 @@ unsigned long reclaim_clean_pages_from_list(struct zone *zone, #define ALLOC_CMA 0x80 /* allow allocations from CMA areas */ /* - * Unnecessary readahead harms performance. 1. for SSD, big size read is more - * expensive than small size read, so extra unnecessary read only has overhead. - * For harddisk, this overhead doesn't exist. 2. unnecessary readahead will - * allocate extra memroy, which further tights memory pressure, so more - * swapout/swapin. - * These adds a simple swap random access detection. In swap page fault, if - * page is found in swap cache, decrease an account of vma, otherwise we need - * do sync swapin and the account is increased. Optionally swapin will do - * readahead if the counter is below a threshold. + * Unnecessary readahead harms performance, especially for SSD devices, where + * large reads are significantly more expensive than small ones. + * These implements simple swap random access detection. In swap page fault: if + * the page is found in swapcache, decrease a counter in the vma, otherwise we + * need to perform sync swapin and the counter is increased. Optionally swapin + * will perform readahead if the counter is below a threshold. */ #ifdef CONFIG_SWAP #define SWAPRA_MISS_THRESHOLD (100) -- 2.39.2