* [PATCH][mmotm] don't attempt to reclaim anon page in lumpy reclaim when no swap space is available
@ 2009-07-04 5:18 Minchan Kim
2009-07-04 13:46 ` Rik van Riel
2009-07-04 17:36 ` KOSAKI Motohiro
0 siblings, 2 replies; 3+ messages in thread
From: Minchan Kim @ 2009-07-04 5:18 UTC (permalink / raw)
To: Andrew Morton, LKML, Linux MM
Cc: Mel Gorman, KOSAKI Motohiro, Rik van Riel, KAMEZAWA Hiroyuki
This patch is based on mmotm 2009-07-02-19-57 reverted
'vmscan: don't attempt to reclaim anon page in lumpy reclaim when no swap space is available.'
This verssion is better than old one.
That's because enough swap space check is done in case of only lumpy reclaim.
so it can't degrade performance in normal case.
== CUT HERE ==
VM already avoids attempting to reclaim anon pages in various places, But
it doesn't avoid it for lumpy reclaim.
It shuffles lru list unnecessary so that it is pointless.
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
mm/vmscan.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 27558aa..977af15 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -930,6 +930,13 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
/* Check that we have not crossed a zone boundary. */
if (unlikely(page_zone_id(cursor_page) != zone_id))
continue;
+ /*
+ * If we don't have enough swap space, reclaiming of anon page
+ * which don't already have a swap slot is pointless.
+ */
+ if (nr_swap_pages <= 0 && (PageAnon(cursor_page) &&
+ !PageSwapCache(cursor_page)))
+ continue;
if (__isolate_lru_page(cursor_page, mode, file) == 0) {
list_move(&cursor_page->lru, dst);
mem_cgroup_del_lru(cursor_page);
--
1.5.4.3
--
Kind regards,
Minchan Kim
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][mmotm] don't attempt to reclaim anon page in lumpy reclaim when no swap space is available
2009-07-04 5:18 [PATCH][mmotm] don't attempt to reclaim anon page in lumpy reclaim when no swap space is available Minchan Kim
@ 2009-07-04 13:46 ` Rik van Riel
2009-07-04 17:36 ` KOSAKI Motohiro
1 sibling, 0 replies; 3+ messages in thread
From: Rik van Riel @ 2009-07-04 13:46 UTC (permalink / raw)
To: Minchan Kim
Cc: Andrew Morton, LKML, Linux MM, Mel Gorman, KOSAKI Motohiro,
KAMEZAWA Hiroyuki
Minchan Kim wrote:
> VM already avoids attempting to reclaim anon pages in various places, But
> it doesn't avoid it for lumpy reclaim.
>
> It shuffles lru list unnecessary so that it is pointless.
>
> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
> Cc: Mel Gorman <mel@csn.ul.ie>
> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> Cc: Rik van Riel <riel@redhat.com>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
--
All rights reversed.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][mmotm] don't attempt to reclaim anon page in lumpy reclaim when no swap space is available
2009-07-04 5:18 [PATCH][mmotm] don't attempt to reclaim anon page in lumpy reclaim when no swap space is available Minchan Kim
2009-07-04 13:46 ` Rik van Riel
@ 2009-07-04 17:36 ` KOSAKI Motohiro
1 sibling, 0 replies; 3+ messages in thread
From: KOSAKI Motohiro @ 2009-07-04 17:36 UTC (permalink / raw)
To: Minchan Kim
Cc: Andrew Morton, LKML, Linux MM, Mel Gorman, Rik van Riel,
KAMEZAWA Hiroyuki
2009/7/4 Minchan Kim <minchan.kim@gmail.com>:
>
> This patch is based on mmotm 2009-07-02-19-57 reverted
> 'vmscan: don't attempt to reclaim anon page in lumpy reclaim when no swap space is available.'
>
> This verssion is better than old one.
> That's because enough swap space check is done in case of only lumpy reclaim.
> so it can't degrade performance in normal case.
>
> == CUT HERE ==
>
> VM already avoids attempting to reclaim anon pages in various places, But
> it doesn't avoid it for lumpy reclaim.
>
> It shuffles lru list unnecessary so that it is pointless.
>
> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
> Cc: Mel Gorman <mel@csn.ul.ie>
> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> Cc: Rik van Riel <riel@redhat.com>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> ---
> mm/vmscan.c | 7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 27558aa..977af15 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -930,6 +930,13 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
> /* Check that we have not crossed a zone boundary. */
> if (unlikely(page_zone_id(cursor_page) != zone_id))
> continue;
> + /*
> + * If we don't have enough swap space, reclaiming of anon page
> + * which don't already have a swap slot is pointless.
> + */
> + if (nr_swap_pages <= 0 && (PageAnon(cursor_page) &&
> + !PageSwapCache(cursor_page)))
> + continue;
> if (__isolate_lru_page(cursor_page, mode, file) == 0) {
> list_move(&cursor_page->lru, dst);
> mem_cgroup_del_lru(cursor_page);
okey. this is definitely better. thanks.
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-07-04 17:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-04 5:18 [PATCH][mmotm] don't attempt to reclaim anon page in lumpy reclaim when no swap space is available Minchan Kim
2009-07-04 13:46 ` Rik van Riel
2009-07-04 17:36 ` KOSAKI Motohiro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox