linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: compact: remove watermark check at compact suitable
@ 2016-05-23  3:20 Chen Feng
  2016-05-23  8:20 ` Vlastimil Babka
  0 siblings, 1 reply; 2+ messages in thread
From: Chen Feng @ 2016-05-23  3:20 UTC (permalink / raw)
  To: puck.chen, akpm, vbabka, iamjoonsoo.kim, mina86, rientjes,
	linux-mm, linux-kernel
  Cc: xuyiping, suzhuangluan, dan.zhao, qijiwen, oliver.fu, puck.chen

There are two paths calling this function.
For direct compact, there is no need to check the zone watermark here.
For kswapd wakeup kcompactd, since there is a reclaim before this.
It makes sense to do compact even the watermark is ok at this time.

Signed-off-by: Chen Feng <puck.chen@hisilicon.com>
---
 mm/compaction.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index 8fa2540..cb322df 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -1260,13 +1260,6 @@ static unsigned long __compaction_suitable(struct zone *zone, int order,
 		return COMPACT_CONTINUE;
 
 	watermark = low_wmark_pages(zone);
-	/*
-	 * If watermarks for high-order allocation are already met, there
-	 * should be no need for compaction at all.
-	 */
-	if (zone_watermark_ok(zone, order, watermark, classzone_idx,
-								alloc_flags))
-		return COMPACT_PARTIAL;
 
 	/*
 	 * Watermarks for order-0 must be met for compaction. Note the 2UL.
-- 
1.9.1

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

* Re: [PATCH] mm: compact: remove watermark check at compact suitable
  2016-05-23  3:20 [PATCH] mm: compact: remove watermark check at compact suitable Chen Feng
@ 2016-05-23  8:20 ` Vlastimil Babka
  0 siblings, 0 replies; 2+ messages in thread
From: Vlastimil Babka @ 2016-05-23  8:20 UTC (permalink / raw)
  To: Chen Feng, akpm, iamjoonsoo.kim, mina86, rientjes, linux-mm,
	linux-kernel
  Cc: xuyiping, suzhuangluan, dan.zhao, qijiwen, oliver.fu, puck.chen

On 05/23/2016 05:20 AM, Chen Feng wrote:
> There are two paths calling this function.
> For direct compact, there is no need to check the zone watermark here.
> For kswapd wakeup kcompactd, since there is a reclaim before this.
> It makes sense to do compact even the watermark is ok at this time.

Hi,

I'm just working on v2 of the series [1] and some patches planned for v2 are 
trying to simplify the watermark checks around compaction. The check you are 
removing looked like simple and obvious one, so I didn't change it. But I'll 
think more about your patch, e.g. if there are some corner cases. See for 
example the fragindex check:

          * index of -1000 would imply allocations might succeed depending on
          * watermarks, but we already failed the high-order watermark check

After your patch, there is no more high-order watermark check, so the assumption 
here is gone.
Also the comment above __compaction_suitable() should be updated too.

[1] http://lkml.kernel.org/r/<1462865763-22084-1-git-send-email-vbabka@suse.cz>

> Signed-off-by: Chen Feng <puck.chen@hisilicon.com>
> ---
>   mm/compaction.c | 7 -------
>   1 file changed, 7 deletions(-)
>
> diff --git a/mm/compaction.c b/mm/compaction.c
> index 8fa2540..cb322df 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -1260,13 +1260,6 @@ static unsigned long __compaction_suitable(struct zone *zone, int order,
>   		return COMPACT_CONTINUE;
>
>   	watermark = low_wmark_pages(zone);
> -	/*
> -	 * If watermarks for high-order allocation are already met, there
> -	 * should be no need for compaction at all.
> -	 */
> -	if (zone_watermark_ok(zone, order, watermark, classzone_idx,
> -								alloc_flags))
> -		return COMPACT_PARTIAL;
>
>   	/*
>   	 * Watermarks for order-0 must be met for compaction. Note the 2UL.
>

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-23  3:20 [PATCH] mm: compact: remove watermark check at compact suitable Chen Feng
2016-05-23  8:20 ` Vlastimil Babka

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).