lkml.org 
[lkml]   [2012]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 4/4] mm: use swap readahead at swapoff
From
Date
try_to_unuse() iterates over swap-entries sequentially,
thus readahead here will not hurt.

Test results:
Virtual machine: without patch 7 seconds, with patch 4 seconds.
Real hardware: without patch 100 seconds, with patch 70 seconds.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
---
mm/swapfile.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/mm/swapfile.c b/mm/swapfile.c
index d999f09..4c99689 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1106,8 +1106,7 @@ static int try_to_unuse(unsigned int type)
*/
swap_map = &si->swap_map[i];
entry = swp_entry(type, i);
- page = read_swap_cache_async(entry,
- GFP_HIGHUSER_MOVABLE, NULL, 0);
+ page = swapin_readahead(entry, GFP_HIGHUSER_MOVABLE, NULL, 0);
if (!page) {
/*
* Either swap_duplicate() failed because entry


\
 
 \ /
  Last update: 2012-02-10 20:45    [W:0.039 / U:12.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site