Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-18 Thread Joonsoo Kim
On Mon, Jul 18, 2016 at 08:51:16AM +0200, Vlastimil Babka wrote: > On 07/18/2016 07:07 AM, Joonsoo Kim wrote: > >On Thu, Jul 14, 2016 at 10:32:09AM +0200, Vlastimil Babka wrote: > >>On 07/14/2016 07:23 AM, Joonsoo Kim wrote: > >> > >>I don't think there's a problem in the scenario? Kswapd will

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-18 Thread Joonsoo Kim
On Mon, Jul 18, 2016 at 08:51:16AM +0200, Vlastimil Babka wrote: > On 07/18/2016 07:07 AM, Joonsoo Kim wrote: > >On Thu, Jul 14, 2016 at 10:32:09AM +0200, Vlastimil Babka wrote: > >>On 07/14/2016 07:23 AM, Joonsoo Kim wrote: > >> > >>I don't think there's a problem in the scenario? Kswapd will

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-18 Thread Vlastimil Babka
On 07/18/2016 07:07 AM, Joonsoo Kim wrote: On Thu, Jul 14, 2016 at 10:32:09AM +0200, Vlastimil Babka wrote: On 07/14/2016 07:23 AM, Joonsoo Kim wrote: I don't think there's a problem in the scenario? Kswapd will keep being woken up and reclaim from the node lru. It will hit and free any low

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-18 Thread Vlastimil Babka
On 07/18/2016 07:07 AM, Joonsoo Kim wrote: On Thu, Jul 14, 2016 at 10:32:09AM +0200, Vlastimil Babka wrote: On 07/14/2016 07:23 AM, Joonsoo Kim wrote: I don't think there's a problem in the scenario? Kswapd will keep being woken up and reclaim from the node lru. It will hit and free any low

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-17 Thread Joonsoo Kim
On Thu, Jul 14, 2016 at 10:32:09AM +0200, Vlastimil Babka wrote: > On 07/14/2016 07:23 AM, Joonsoo Kim wrote: > >On Fri, Jul 08, 2016 at 11:11:47AM +0100, Mel Gorman wrote: > >>On Fri, Jul 08, 2016 at 11:44:47AM +0900, Joonsoo Kim wrote: > >> > >>It doesn't stop reclaiming for the lower zones.

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-17 Thread Joonsoo Kim
On Thu, Jul 14, 2016 at 10:32:09AM +0200, Vlastimil Babka wrote: > On 07/14/2016 07:23 AM, Joonsoo Kim wrote: > >On Fri, Jul 08, 2016 at 11:11:47AM +0100, Mel Gorman wrote: > >>On Fri, Jul 08, 2016 at 11:44:47AM +0900, Joonsoo Kim wrote: > >> > >>It doesn't stop reclaiming for the lower zones.

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-17 Thread Joonsoo Kim
On Thu, Jul 14, 2016 at 10:05:00AM +0100, Mel Gorman wrote: > On Thu, Jul 14, 2016 at 02:23:32PM +0900, Joonsoo Kim wrote: > > > > > > > > > And, I'd like to know why max() is used for classzone_idx rather > > > > > > than > > > > > > min()? I think that kswapd should balance the lowest zone

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-17 Thread Joonsoo Kim
On Thu, Jul 14, 2016 at 10:05:00AM +0100, Mel Gorman wrote: > On Thu, Jul 14, 2016 at 02:23:32PM +0900, Joonsoo Kim wrote: > > > > > > > > > And, I'd like to know why max() is used for classzone_idx rather > > > > > > than > > > > > > min()? I think that kswapd should balance the lowest zone

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-14 Thread Mel Gorman
On Thu, Jul 14, 2016 at 02:23:32PM +0900, Joonsoo Kim wrote: > > > > > > > And, I'd like to know why max() is used for classzone_idx rather than > > > > > min()? I think that kswapd should balance the lowest zone requested. > > > > > > > > > > > > > If there are two allocation requests -- one

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-14 Thread Mel Gorman
On Thu, Jul 14, 2016 at 02:23:32PM +0900, Joonsoo Kim wrote: > > > > > > > And, I'd like to know why max() is used for classzone_idx rather than > > > > > min()? I think that kswapd should balance the lowest zone requested. > > > > > > > > > > > > > If there are two allocation requests -- one

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-14 Thread Vlastimil Babka
On 07/14/2016 07:23 AM, Joonsoo Kim wrote: On Fri, Jul 08, 2016 at 11:11:47AM +0100, Mel Gorman wrote: On Fri, Jul 08, 2016 at 11:44:47AM +0900, Joonsoo Kim wrote: It doesn't stop reclaiming for the lower zones. It's reclaiming the LRU for the whole node that may or may not have lower zone

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-14 Thread Vlastimil Babka
On 07/14/2016 07:23 AM, Joonsoo Kim wrote: On Fri, Jul 08, 2016 at 11:11:47AM +0100, Mel Gorman wrote: On Fri, Jul 08, 2016 at 11:44:47AM +0900, Joonsoo Kim wrote: It doesn't stop reclaiming for the lower zones. It's reclaiming the LRU for the whole node that may or may not have lower zone

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-13 Thread Joonsoo Kim
On Fri, Jul 08, 2016 at 11:11:47AM +0100, Mel Gorman wrote: > On Fri, Jul 08, 2016 at 11:44:47AM +0900, Joonsoo Kim wrote: > > > > > @@ -3390,12 +3386,24 @@ static int kswapd(void *p) > > > > >* We can speed up thawing tasks if we don't call > > > > > balance_pgdat > > > > >

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-13 Thread Joonsoo Kim
On Fri, Jul 08, 2016 at 11:11:47AM +0100, Mel Gorman wrote: > On Fri, Jul 08, 2016 at 11:44:47AM +0900, Joonsoo Kim wrote: > > > > > @@ -3390,12 +3386,24 @@ static int kswapd(void *p) > > > > >* We can speed up thawing tasks if we don't call > > > > > balance_pgdat > > > > >

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-08 Thread Mel Gorman
On Fri, Jul 08, 2016 at 11:44:47AM +0900, Joonsoo Kim wrote: > > > > @@ -3390,12 +3386,24 @@ static int kswapd(void *p) > > > > * We can speed up thawing tasks if we don't call > > > > balance_pgdat > > > > * after returning from the refrigerator > > > >

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-08 Thread Mel Gorman
On Fri, Jul 08, 2016 at 11:44:47AM +0900, Joonsoo Kim wrote: > > > > @@ -3390,12 +3386,24 @@ static int kswapd(void *p) > > > > * We can speed up thawing tasks if we don't call > > > > balance_pgdat > > > > * after returning from the refrigerator > > > >

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-07 Thread Joonsoo Kim
On Thu, Jul 07, 2016 at 11:17:01AM +0100, Mel Gorman wrote: > On Thu, Jul 07, 2016 at 10:20:39AM +0900, Joonsoo Kim wrote: > > > @@ -3249,9 +3249,19 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, > > > int order, > > > > > > prepare_to_wait(>kswapd_wait, , TASK_INTERRUPTIBLE); > > > >

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-07 Thread Joonsoo Kim
On Thu, Jul 07, 2016 at 11:17:01AM +0100, Mel Gorman wrote: > On Thu, Jul 07, 2016 at 10:20:39AM +0900, Joonsoo Kim wrote: > > > @@ -3249,9 +3249,19 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, > > > int order, > > > > > > prepare_to_wait(>kswapd_wait, , TASK_INTERRUPTIBLE); > > > >

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-07 Thread Mel Gorman
On Thu, Jul 07, 2016 at 10:20:39AM +0900, Joonsoo Kim wrote: > > @@ -3249,9 +3249,19 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, > > int order, > > > > prepare_to_wait(>kswapd_wait, , TASK_INTERRUPTIBLE); > > > > + /* > > +* If kswapd has not been woken recently, then

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-07 Thread Mel Gorman
On Thu, Jul 07, 2016 at 10:20:39AM +0900, Joonsoo Kim wrote: > > @@ -3249,9 +3249,19 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, > > int order, > > > > prepare_to_wait(>kswapd_wait, , TASK_INTERRUPTIBLE); > > > > + /* > > +* If kswapd has not been woken recently, then

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-07 Thread Mel Gorman
On Thu, Jul 07, 2016 at 02:51:21PM +0900, Minchan Kim wrote: > > It becomes difficult to tell the difference between "no wakeup and init to > > zone 0" and "wakeup and reclaim for zone 0". At least that's the problem > > I ran into when I tried before settling on -1. > > Sorry for bothering you

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-07 Thread Mel Gorman
On Thu, Jul 07, 2016 at 02:51:21PM +0900, Minchan Kim wrote: > > It becomes difficult to tell the difference between "no wakeup and init to > > zone 0" and "wakeup and reclaim for zone 0". At least that's the problem > > I ran into when I tried before settling on -1. > > Sorry for bothering you

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-06 Thread Minchan Kim
On Wed, Jul 06, 2016 at 09:31:21AM +0100, Mel Gorman wrote: > On Wed, Jul 06, 2016 at 09:30:54AM +0900, Minchan Kim wrote: > > On Tue, Jul 05, 2016 at 11:26:39AM +0100, Mel Gorman wrote: > > > > > > > > > > > @@ -3418,10 +3426,10 @@ void wakeup_kswapd(struct zone *zone, int > > > > > order,

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-06 Thread Minchan Kim
On Wed, Jul 06, 2016 at 09:31:21AM +0100, Mel Gorman wrote: > On Wed, Jul 06, 2016 at 09:30:54AM +0900, Minchan Kim wrote: > > On Tue, Jul 05, 2016 at 11:26:39AM +0100, Mel Gorman wrote: > > > > > > > > > > > @@ -3418,10 +3426,10 @@ void wakeup_kswapd(struct zone *zone, int > > > > > order,

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-06 Thread Joonsoo Kim
On Fri, Jul 01, 2016 at 09:01:16PM +0100, Mel Gorman wrote: > kswapd goes through some complex steps trying to figure out if it should > stay awake based on the classzone_idx and the requested order. It is > unnecessarily complex and passes in an invalid classzone_idx to > balance_pgdat(). What

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-06 Thread Joonsoo Kim
On Fri, Jul 01, 2016 at 09:01:16PM +0100, Mel Gorman wrote: > kswapd goes through some complex steps trying to figure out if it should > stay awake based on the classzone_idx and the requested order. It is > unnecessarily complex and passes in an invalid classzone_idx to > balance_pgdat(). What

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-06 Thread Mel Gorman
On Wed, Jul 06, 2016 at 09:30:54AM +0900, Minchan Kim wrote: > On Tue, Jul 05, 2016 at 11:26:39AM +0100, Mel Gorman wrote: > > > > > > > @@ -3418,10 +3426,10 @@ void wakeup_kswapd(struct zone *zone, int > > > > order, enum zone_type classzone_idx) > > > > if (!cpuset_zone_allowed(zone,

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-06 Thread Mel Gorman
On Wed, Jul 06, 2016 at 09:30:54AM +0900, Minchan Kim wrote: > On Tue, Jul 05, 2016 at 11:26:39AM +0100, Mel Gorman wrote: > > > > > > > @@ -3418,10 +3426,10 @@ void wakeup_kswapd(struct zone *zone, int > > > > order, enum zone_type classzone_idx) > > > > if (!cpuset_zone_allowed(zone,

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-05 Thread Minchan Kim
On Tue, Jul 05, 2016 at 11:26:39AM +0100, Mel Gorman wrote: > > > @@ -3418,10 +3426,10 @@ void wakeup_kswapd(struct zone *zone, int order, > > > enum zone_type classzone_idx) > > > if (!cpuset_zone_allowed(zone, GFP_KERNEL | __GFP_HARDWALL)) > > > return; > > > pgdat =

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-05 Thread Minchan Kim
On Tue, Jul 05, 2016 at 11:26:39AM +0100, Mel Gorman wrote: > > > @@ -3418,10 +3426,10 @@ void wakeup_kswapd(struct zone *zone, int order, > > > enum zone_type classzone_idx) > > > if (!cpuset_zone_allowed(zone, GFP_KERNEL | __GFP_HARDWALL)) > > > return; > > > pgdat =

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-05 Thread Mel Gorman
On Tue, Jul 05, 2016 at 02:59:31PM +0900, Minchan Kim wrote: > > @@ -3249,9 +3249,19 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, > > int order, > > > > prepare_to_wait(>kswapd_wait, , TASK_INTERRUPTIBLE); > > > > + /* > > +* If kswapd has not been woken recently, then

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-05 Thread Mel Gorman
On Tue, Jul 05, 2016 at 02:59:31PM +0900, Minchan Kim wrote: > > @@ -3249,9 +3249,19 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, > > int order, > > > > prepare_to_wait(>kswapd_wait, , TASK_INTERRUPTIBLE); > > > > + /* > > +* If kswapd has not been woken recently, then

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-04 Thread Minchan Kim
On Fri, Jul 01, 2016 at 09:01:16PM +0100, Mel Gorman wrote: > kswapd goes through some complex steps trying to figure out if it should > stay awake based on the classzone_idx and the requested order. It is > unnecessarily complex and passes in an invalid classzone_idx to > balance_pgdat(). What

Re: [PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-04 Thread Minchan Kim
On Fri, Jul 01, 2016 at 09:01:16PM +0100, Mel Gorman wrote: > kswapd goes through some complex steps trying to figure out if it should > stay awake based on the classzone_idx and the requested order. It is > unnecessarily complex and passes in an invalid classzone_idx to > balance_pgdat(). What

[PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-01 Thread Mel Gorman
kswapd goes through some complex steps trying to figure out if it should stay awake based on the classzone_idx and the requested order. It is unnecessarily complex and passes in an invalid classzone_idx to balance_pgdat(). What matters most of all is whether a larger order has been requsted and

[PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-01 Thread Mel Gorman
kswapd goes through some complex steps trying to figure out if it should stay awake based on the classzone_idx and the requested order. It is unnecessarily complex and passes in an invalid classzone_idx to balance_pgdat(). What matters most of all is whether a larger order has been requsted and

[PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-01 Thread Mel Gorman
kswapd goes through some complex steps trying to figure out if it should stay awake based on the classzone_idx and the requested order. It is unnecessarily complex and passes in an invalid classzone_idx to balance_pgdat(). What matters most of all is whether a larger order has been requsted and

[PATCH 08/31] mm, vmscan: simplify the logic deciding whether kswapd sleeps

2016-07-01 Thread Mel Gorman
kswapd goes through some complex steps trying to figure out if it should stay awake based on the classzone_idx and the requested order. It is unnecessarily complex and passes in an invalid classzone_idx to balance_pgdat(). What matters most of all is whether a larger order has been requsted and