Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-04-18 Thread Johannes Weiner
On Thu, Apr 11, 2013 at 08:57:51PM +0100, Mel Gorman wrote: > kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX > pages have been reclaimed or the pgdat is considered balanced. It then > rechecks if it needs to restart at DEF_PRIORITY and whether high-order > reclaim needs

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-04-18 Thread Johannes Weiner
On Thu, Apr 11, 2013 at 08:57:51PM +0100, Mel Gorman wrote: kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX pages have been reclaimed or the pgdat is considered balanced. It then rechecks if it needs to restart at DEF_PRIORITY and whether high-order reclaim needs to

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-04-11 Thread Rik van Riel
On 04/09/2013 07:06 AM, Mel Gorman wrote: kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX pages have been reclaimed or the pgdat is considered balanced. It then rechecks if it needs to restart at DEF_PRIORITY and whether high-order reclaim needs to be reset. This is not

[PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-04-11 Thread Mel Gorman
kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX pages have been reclaimed or the pgdat is considered balanced. It then rechecks if it needs to restart at DEF_PRIORITY and whether high-order reclaim needs to be reset. This is not wrong per-se but it is confusing to follow

[PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-04-11 Thread Mel Gorman
kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX pages have been reclaimed or the pgdat is considered balanced. It then rechecks if it needs to restart at DEF_PRIORITY and whether high-order reclaim needs to be reset. This is not wrong per-se but it is confusing to follow

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-04-11 Thread Rik van Riel
On 04/09/2013 07:06 AM, Mel Gorman wrote: kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX pages have been reclaimed or the pgdat is considered balanced. It then rechecks if it needs to restart at DEF_PRIORITY and whether high-order reclaim needs to be reset. This is not

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-04-10 Thread Mel Gorman
On Wed, Apr 10, 2013 at 04:47:31PM +0900, Kamezawa Hiroyuki wrote: > > @@ -2811,8 +2814,16 @@ loop_again: > > > > if ((buffer_heads_over_limit && is_highmem_idx(i)) || > > !zone_balanced(zone, testorder, > > -

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-04-10 Thread Kamezawa Hiroyuki
(2013/04/09 20:06), Mel Gorman wrote: > kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX > pages have been reclaimed or the pgdat is considered balanced. It then > rechecks if it needs to restart at DEF_PRIORITY and whether high-order > reclaim needs to be reset. This is

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-04-10 Thread Kamezawa Hiroyuki
(2013/04/09 20:06), Mel Gorman wrote: kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX pages have been reclaimed or the pgdat is considered balanced. It then rechecks if it needs to restart at DEF_PRIORITY and whether high-order reclaim needs to be reset. This is not

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-04-10 Thread Mel Gorman
On Wed, Apr 10, 2013 at 04:47:31PM +0900, Kamezawa Hiroyuki wrote: @@ -2811,8 +2814,16 @@ loop_again: if ((buffer_heads_over_limit is_highmem_idx(i)) || !zone_balanced(zone, testorder, - balance_gap,

[PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-04-09 Thread Mel Gorman
kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX pages have been reclaimed or the pgdat is considered balanced. It then rechecks if it needs to restart at DEF_PRIORITY and whether high-order reclaim needs to be reset. This is not wrong per-se but it is confusing to follow

[PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-04-09 Thread Mel Gorman
kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX pages have been reclaimed or the pgdat is considered balanced. It then rechecks if it needs to restart at DEF_PRIORITY and whether high-order reclaim needs to be reset. This is not wrong per-se but it is confusing to follow

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-21 Thread Michal Hocko
On Thu 21-03-13 15:26:02, Mel Gorman wrote: > On Thu, Mar 21, 2013 at 03:54:58PM +0100, Michal Hocko wrote: > > > Signed-off-by: Mel Gorman > > > --- > > > mm/vmscan.c | 86 > > > ++--- > > > 1 file changed, 42 insertions(+), 44

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-21 Thread Mel Gorman
On Thu, Mar 21, 2013 at 03:54:58PM +0100, Michal Hocko wrote: > > Signed-off-by: Mel Gorman > > --- > > mm/vmscan.c | 86 > > ++--- > > 1 file changed, 42 insertions(+), 44 deletions(-) > > > > diff --git a/mm/vmscan.c b/mm/vmscan.c > >

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-21 Thread Michal Hocko
On Sun 17-03-13 13:04:09, Mel Gorman wrote: > kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX > pages have been reclaimed or the pgdat is considered balanced. It then > rechecks if it needs to restart at DEF_PRIORITY and whether high-order > reclaim needs to be reset.

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-21 Thread Michal Hocko
On Sun 17-03-13 13:04:09, Mel Gorman wrote: kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX pages have been reclaimed or the pgdat is considered balanced. It then rechecks if it needs to restart at DEF_PRIORITY and whether high-order reclaim needs to be reset. This is

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-21 Thread Mel Gorman
On Thu, Mar 21, 2013 at 03:54:58PM +0100, Michal Hocko wrote: Signed-off-by: Mel Gorman mgor...@suse.de --- mm/vmscan.c | 86 ++--- 1 file changed, 42 insertions(+), 44 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-21 Thread Michal Hocko
On Thu 21-03-13 15:26:02, Mel Gorman wrote: On Thu, Mar 21, 2013 at 03:54:58PM +0100, Michal Hocko wrote: Signed-off-by: Mel Gorman mgor...@suse.de --- mm/vmscan.c | 86 ++--- 1 file changed, 42 insertions(+), 44

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-19 Thread Mel Gorman
On Tue, Mar 19, 2013 at 06:26:43PM +0800, Simon Jeons wrote: > >>>- if (sc.nr_reclaimed >= SWAP_CLUSTER_MAX) > >>>- break; > >>>- } while (--sc.priority >= 0); > >>>+ if (order && sc.nr_reclaimed >= 2UL << order) > >>>+ order = sc.order = 0; >

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-19 Thread Simon Jeons
Hi Mel, On 03/19/2013 06:14 PM, Mel Gorman wrote: On Tue, Mar 19, 2013 at 11:08:23AM +0800, Simon Jeons wrote: Hi Mel, On 03/17/2013 09:04 PM, Mel Gorman wrote: kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX pages have been reclaimed or the pgdat is considered

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-19 Thread Mel Gorman
On Tue, Mar 19, 2013 at 11:08:23AM +0800, Simon Jeons wrote: > Hi Mel, > On 03/17/2013 09:04 PM, Mel Gorman wrote: > >kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX > >pages have been reclaimed or the pgdat is considered balanced. It then > >rechecks if it needs to

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-19 Thread Mel Gorman
On Tue, Mar 19, 2013 at 07:58:51AM +0800, Simon Jeons wrote: > >@@ -2672,26 +2677,25 @@ static void kswapd_shrink_zone(struct zone *zone, > > static unsigned long balance_pgdat(pg_data_t *pgdat, int order, > > int *classzone_idx) > > { > >-

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-19 Thread Michal Hocko
On Tue 19-03-13 11:08:23, Simon Jeons wrote: > Hi Mel, > On 03/17/2013 09:04 PM, Mel Gorman wrote: > >kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX > >pages have been reclaimed or the pgdat is considered balanced. It then > >rechecks if it needs to restart at

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-19 Thread Michal Hocko
On Tue 19-03-13 11:08:23, Simon Jeons wrote: Hi Mel, On 03/17/2013 09:04 PM, Mel Gorman wrote: kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX pages have been reclaimed or the pgdat is considered balanced. It then rechecks if it needs to restart at DEF_PRIORITY and

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-19 Thread Mel Gorman
On Tue, Mar 19, 2013 at 07:58:51AM +0800, Simon Jeons wrote: @@ -2672,26 +2677,25 @@ static void kswapd_shrink_zone(struct zone *zone, static unsigned long balance_pgdat(pg_data_t *pgdat, int order, int *classzone_idx) { -bool

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-19 Thread Mel Gorman
On Tue, Mar 19, 2013 at 11:08:23AM +0800, Simon Jeons wrote: Hi Mel, On 03/17/2013 09:04 PM, Mel Gorman wrote: kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX pages have been reclaimed or the pgdat is considered balanced. It then rechecks if it needs to restart at

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-19 Thread Simon Jeons
Hi Mel, On 03/19/2013 06:14 PM, Mel Gorman wrote: On Tue, Mar 19, 2013 at 11:08:23AM +0800, Simon Jeons wrote: Hi Mel, On 03/17/2013 09:04 PM, Mel Gorman wrote: kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX pages have been reclaimed or the pgdat is considered

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-19 Thread Mel Gorman
On Tue, Mar 19, 2013 at 06:26:43PM +0800, Simon Jeons wrote: - if (sc.nr_reclaimed = SWAP_CLUSTER_MAX) - break; - } while (--sc.priority = 0); + if (order sc.nr_reclaimed = 2UL order) + order = sc.order = 0; If order == 0 is meet, should

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-18 Thread Simon Jeons
Hi Mel, On 03/17/2013 09:04 PM, Mel Gorman wrote: kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX pages have been reclaimed or the pgdat is considered balanced. It then rechecks if it needs to restart at DEF_PRIORITY and whether high-order reclaim needs to be reset.

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-18 Thread Simon Jeons
Hi Mel, On 03/17/2013 09:04 PM, Mel Gorman wrote: kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX pages have been reclaimed or the pgdat is considered balanced. It then rechecks if it needs to restart at DEF_PRIORITY and whether high-order reclaim needs to be reset.

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-18 Thread Simon Jeons
Hi Mel, On 03/17/2013 09:04 PM, Mel Gorman wrote: kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX pages have been reclaimed or the pgdat is considered balanced. It then rechecks if it needs to restart at DEF_PRIORITY and whether high-order reclaim needs to be reset.

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-18 Thread Simon Jeons
Hi Mel, On 03/17/2013 09:04 PM, Mel Gorman wrote: kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX pages have been reclaimed or the pgdat is considered balanced. It then rechecks if it needs to restart at DEF_PRIORITY and whether high-order reclaim needs to be reset.

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-17 Thread Mel Gorman
On Sun, Mar 17, 2013 at 07:36:22AM -0700, Andi Kleen wrote: > Mel Gorman writes: > > > > To avoid infinite looping for high-order allocation requests kswapd will > > not reclaim for high-order allocations when it has reclaimed at least > > twice the number of pages as the allocation request. > >

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-17 Thread Andi Kleen
Mel Gorman writes: > > To avoid infinite looping for high-order allocation requests kswapd will > not reclaim for high-order allocations when it has reclaimed at least > twice the number of pages as the allocation request. Will this make higher order allocations fail earlier? Or does compaction

[PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-17 Thread Mel Gorman
kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX pages have been reclaimed or the pgdat is considered balanced. It then rechecks if it needs to restart at DEF_PRIORITY and whether high-order reclaim needs to be reset. This is not wrong per-se but it is confusing to follow

[PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-17 Thread Mel Gorman
kswapd stops raising the scanning priority when at least SWAP_CLUSTER_MAX pages have been reclaimed or the pgdat is considered balanced. It then rechecks if it needs to restart at DEF_PRIORITY and whether high-order reclaim needs to be reset. This is not wrong per-se but it is confusing to follow

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-17 Thread Andi Kleen
Mel Gorman mgor...@suse.de writes: To avoid infinite looping for high-order allocation requests kswapd will not reclaim for high-order allocations when it has reclaimed at least twice the number of pages as the allocation request. Will this make higher order allocations fail earlier? Or does

Re: [PATCH 03/10] mm: vmscan: Flatten kswapd priority loop

2013-03-17 Thread Mel Gorman
On Sun, Mar 17, 2013 at 07:36:22AM -0700, Andi Kleen wrote: Mel Gorman mgor...@suse.de writes: To avoid infinite looping for high-order allocation requests kswapd will not reclaim for high-order allocations when it has reclaimed at least twice the number of pages as the allocation