linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Yafang Shao <laoar.shao@gmail.com>,
	mhocko@suse.com, mgorman@techsingularity.net
Cc: akpm@linux-foundation.org, linux-mm@kvack.org, shaoyafang@didiglobal.com
Subject: Re: [PATCH] mm/compaction: fix missed direct_compaction setting for non-direct compaction
Date: Fri, 29 Mar 2019 09:45:24 +0100	[thread overview]
Message-ID: <60f6a5fd-e4d3-b615-6f41-cc7dd16d183c@suse.cz> (raw)
In-Reply-To: <1553848599-6124-1-git-send-email-laoar.shao@gmail.com>

On 3/29/19 9:36 AM, Yafang Shao wrote:
> direct_compaction is not initialized for kcompactd or manually triggered
> compaction (via /proc or /sys).

It doesn't need to, this style of initialization does guarantee that any
field not explicitly mentioned is initialized to 0/NULL/false... and
this pattern is used all over the kernel.

> That may cause unexpected behavior in __compact_finished(), so we should
> set direct_compaction to false explicitly for these compactions.

It's not necessary.

> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
> Cc: Vlastimil Babka <vbabka@suse.cz>
> ---
>  mm/compaction.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/compaction.c b/mm/compaction.c
> index 98f99f4..ba2b711 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -2400,13 +2400,12 @@ static void compact_node(int nid)
>  		.total_free_scanned = 0,
>  		.mode = MIGRATE_SYNC,
>  		.ignore_skip_hint = true,
> +		.direct_compaction = false,
>  		.whole_zone = true,
>  		.gfp_mask = GFP_KERNEL,
>  	};
>  
> -
>  	for (zoneid = 0; zoneid < MAX_NR_ZONES; zoneid++) {
> -
>  		zone = &pgdat->node_zones[zoneid];
>  		if (!populated_zone(zone))
>  			continue;
> @@ -2522,8 +2521,10 @@ static void kcompactd_do_work(pg_data_t *pgdat)
>  		.classzone_idx = pgdat->kcompactd_classzone_idx,
>  		.mode = MIGRATE_SYNC_LIGHT,
>  		.ignore_skip_hint = false,
> +		.direct_compaction = false,
>  		.gfp_mask = GFP_KERNEL,
>  	};
> +
>  	trace_mm_compaction_kcompactd_wake(pgdat->node_id, cc.order,
>  							cc.classzone_idx);
>  	count_compact_event(KCOMPACTD_WAKE);
> 


  reply	other threads:[~2019-03-29  8:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-29  8:36 Yafang Shao
2019-03-29  8:45 ` Vlastimil Babka [this message]
2019-03-29  8:48   ` Yafang Shao
2019-03-29  8:54     ` Vlastimil Babka
2019-03-29  8:55       ` Yafang Shao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=60f6a5fd-e4d3-b615-6f41-cc7dd16d183c@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=laoar.shao@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@suse.com \
    --cc=shaoyafang@didiglobal.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox