linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: vmscan: reclaim highmem zone if buffer_heads is over limit
@ 2016-04-01  8:00 Minchan Kim
  2016-04-01  8:03 ` Michal Hocko
  0 siblings, 1 reply; 6+ messages in thread
From: Minchan Kim @ 2016-04-01  8:00 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm, linux-kernel, Minchan Kim, Johannes Weiner, Michal Hocko

We have been reclaimed highmem zone if buffer_heads is over limit
but [1] changed the behavior so it doesn't reclaim highmem zone
although buffer_heads is over the limit.
This patch restores the logic.

As well, [2] removed classzone_idx so we don't need code related to
it. This patch cleans it up.

[1] commit 6b4f7799c6a5 ("mm: vmscan: invoke slab shrinkers from shrink_zone()")
[2] commit 5acbd3bfc93b ("mm, oom: rework oom detection")

Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
---
 mm/vmscan.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index c7696a2e11c7..6e67de2a61ed 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2550,17 +2550,9 @@ static void shrink_zones(struct zonelist *zonelist, struct scan_control *sc)
 		sc->gfp_mask |= __GFP_HIGHMEM;
 
 	for_each_zone_zonelist_nodemask(zone, z, zonelist,
-					requested_highidx, sc->nodemask) {
-		enum zone_type classzone_idx;
-
+					gfp_zone(sc->gfp_mask), sc->nodemask) {
 		if (!populated_zone(zone))
 			continue;
-
-		classzone_idx = requested_highidx;
-		while (!populated_zone(zone->zone_pgdat->node_zones +
-							classzone_idx))
-			classzone_idx--;
-
 		/*
 		 * Take care memory controller reclaiming has small influence
 		 * to global LRU.
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm: vmscan: reclaim highmem zone if buffer_heads is over limit
  2016-04-01  8:00 [PATCH] mm: vmscan: reclaim highmem zone if buffer_heads is over limit Minchan Kim
@ 2016-04-01  8:03 ` Michal Hocko
  2016-04-01 20:14   ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: Michal Hocko @ 2016-04-01  8:03 UTC (permalink / raw)
  To: Minchan Kim; +Cc: Andrew Morton, linux-mm, linux-kernel, Johannes Weiner

On Fri 01-04-16 17:00:58, Minchan Kim wrote:
[...]
> [2] commit 5acbd3bfc93b ("mm, oom: rework oom detection")

I didn't look a tht patch yet but wanted to note that this sha is most
probably from linux-next and won't be stable. Also this patch will most
likely see some changes in future so making changes on top which should
go in independetly will likely just complicate things.
-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm: vmscan: reclaim highmem zone if buffer_heads is over limit
  2016-04-01  8:03 ` Michal Hocko
@ 2016-04-01 20:14   ` Andrew Morton
  2016-04-03 23:49     ` Minchan Kim
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2016-04-01 20:14 UTC (permalink / raw)
  To: Michal Hocko; +Cc: Minchan Kim, linux-mm, linux-kernel, Johannes Weiner

On Fri, 1 Apr 2016 10:03:50 +0200 Michal Hocko <mhocko@kernel.org> wrote:

> On Fri 01-04-16 17:00:58, Minchan Kim wrote:
> [...]
> > [2] commit 5acbd3bfc93b ("mm, oom: rework oom detection")
> 
> I didn't look a tht patch yet but wanted to note that this sha is most
> probably from linux-next and won't be stable. Also this patch will most
> likely see some changes in future so making changes on top which should
> go in independetly will likely just complicate things.

Yes, we'll need two patches please.  One to fix 6b4f7799c6a5 ("mm:
vmscan: invoke slab shrinkers from shrink_zone()") (which is in
mainline) and a second to clean up -mm's "mm, oom: rework oom detection".

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm: vmscan: reclaim highmem zone if buffer_heads is over limit
  2016-04-01 20:14   ` Andrew Morton
@ 2016-04-03 23:49     ` Minchan Kim
  0 siblings, 0 replies; 6+ messages in thread
From: Minchan Kim @ 2016-04-03 23:49 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Michal Hocko, linux-mm, linux-kernel, Johannes Weiner

On Fri, Apr 01, 2016 at 01:14:58PM -0700, Andrew Morton wrote:
> On Fri, 1 Apr 2016 10:03:50 +0200 Michal Hocko <mhocko@kernel.org> wrote:
> 
> > On Fri 01-04-16 17:00:58, Minchan Kim wrote:
> > [...]
> > > [2] commit 5acbd3bfc93b ("mm, oom: rework oom detection")
> > 
> > I didn't look a tht patch yet but wanted to note that this sha is most
> > probably from linux-next and won't be stable. Also this patch will most
> > likely see some changes in future so making changes on top which should
> > go in independetly will likely just complicate things.
> 
> Yes, we'll need two patches please.  One to fix 6b4f7799c6a5 ("mm:
> vmscan: invoke slab shrinkers from shrink_zone()") (which is in
> mainline) and a second to clean up -mm's "mm, oom: rework oom detection".

Andrew, Michal

Thanks. I just sent out it as separate patch.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm: vmscan: reclaim highmem zone if buffer_heads is over limit
  2016-04-03 23:46 Minchan Kim
@ 2016-04-05 20:37 ` Andrew Morton
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Morton @ 2016-04-05 20:37 UTC (permalink / raw)
  To: Minchan Kim; +Cc: linux-kernel, linux-mm, Johannes Weiner, stable

On Mon,  4 Apr 2016 08:46:09 +0900 Minchan Kim <minchan@kernel.org> wrote:

> We have been reclaimed highmem zone if buffer_heads is over limit
> but [1] changed the behavior so it doesn't reclaim highmem zone
> although buffer_heads is over the limit.
> This patch restores the logic.
> 
> [1] commit 6b4f7799c6a5 ("mm: vmscan: invoke slab shrinkers from shrink_zone()")
> 
> ...
>
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -2550,7 +2550,7 @@ static void shrink_zones(struct zonelist *zonelist, struct scan_control *sc)
>  		sc->gfp_mask |= __GFP_HIGHMEM;
>  
>  	for_each_zone_zonelist_nodemask(zone, z, zonelist,
> -					requested_highidx, sc->nodemask) {
> +					gfp_zone(sc->gfp_mask), sc->nodemask) {
>  		enum zone_type classzone_idx;
>  
>  		if (!populated_zone(zone))

Wait wut wot.  We broke this over a year ago?  Highmem pagecache pages
pinning buffer_head lowmem used to be a huuuge problem.  Before most of
you were born ;)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] mm: vmscan: reclaim highmem zone if buffer_heads is over limit
@ 2016-04-03 23:46 Minchan Kim
  2016-04-05 20:37 ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: Minchan Kim @ 2016-04-03 23:46 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, linux-mm, Minchan Kim, Johannes Weiner, stable

We have been reclaimed highmem zone if buffer_heads is over limit
but [1] changed the behavior so it doesn't reclaim highmem zone
although buffer_heads is over the limit.
This patch restores the logic.

[1] commit 6b4f7799c6a5 ("mm: vmscan: invoke slab shrinkers from shrink_zone()")

Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: stable@vger.kernel.org
Signed-off-by: Minchan Kim <minchan@kernel.org>
---
 mm/vmscan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index c7696a2e11c7..d84efa03c8a8 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2550,7 +2550,7 @@ static void shrink_zones(struct zonelist *zonelist, struct scan_control *sc)
 		sc->gfp_mask |= __GFP_HIGHMEM;
 
 	for_each_zone_zonelist_nodemask(zone, z, zonelist,
-					requested_highidx, sc->nodemask) {
+					gfp_zone(sc->gfp_mask), sc->nodemask) {
 		enum zone_type classzone_idx;
 
 		if (!populated_zone(zone))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-04-05 20:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-01  8:00 [PATCH] mm: vmscan: reclaim highmem zone if buffer_heads is over limit Minchan Kim
2016-04-01  8:03 ` Michal Hocko
2016-04-01 20:14   ` Andrew Morton
2016-04-03 23:49     ` Minchan Kim
2016-04-03 23:46 Minchan Kim
2016-04-05 20:37 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).