linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Michal Hocko <mhocko@suse.com>,
	Yafang Shao <laoar.shao@gmail.com>,
	linux-mm@kvack.org, Mel Gorman <mgorman@techsingularity.net>,
	Yafang Shao <shaoyafang@didiglobal.com>
Subject: Re: [PATCH] mm/compaction: introduce a helper compact_zone_counters_init()
Date: Wed, 24 Jul 2019 17:19:45 -0700	[thread overview]
Message-ID: <20190724171945.c81db3079162a1eb4730bd20@linux-foundation.org> (raw)
In-Reply-To: <1fb6f7da-f776-9e42-22f8-bbb79b030b98@suse.cz>

On Wed, 24 Jul 2019 15:35:12 +0200 Vlastimil Babka <vbabka@suse.cz> wrote:

> On 7/23/19 11:40 PM, Andrew Morton wrote:
> > On Tue, 23 Jul 2019 10:12:18 +0200 Michal Hocko <mhocko@suse.com> wrote:
> > 
> >> On Tue 23-07-19 04:08:15, Yafang Shao wrote:
> >>> This is the follow-up of the
> >>> commit "mm/compaction.c: clear total_{migrate,free}_scanned before scanning a new zone".
> >>>
> >>> These counters are used to track activities during compacting a zone,
> >>> and they will be set to zero before compacting a new zone in all compact
> >>> paths. Move all these common settings into compact_zone() for better
> >>> management. A new helper compact_zone_counters_init() is introduced for
> >>> this purpose.
> >>
> >> The helper seems excessive a bit because we have a single call site but
> >> other than that this is an improvement to the current fragile and
> >> duplicated code.
> >>
> >> I would just get rid of the helper and squash it to your previous patch
> >> which Andrew already took to the mm tree.
> 
> I have squashed everything locally, and for the result:
> 
> Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
> 
> Also, why not squash some more?

An SOB would be nice..

And this?

--- a/mm/compaction.c~mm-compaction-clear-total_migratefree_scanned-before-scanning-a-new-zone-fix-2-fix
+++ a/mm/compaction.c
@@ -2551,10 +2551,10 @@ static void kcompactd_do_work(pg_data_t
 							COMPACT_CONTINUE)
 			continue;
 
-		cc.zone = zone;
-
 		if (kthread_should_stop())
 			return;
+
+		cc.zone = zone;
 		status = compact_zone(&cc, NULL);
 
 		if (status == COMPACT_SUCCESS) {
_


  reply	other threads:[~2019-07-25  0:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23  8:08 [PATCH] mm/compaction: introduce a helper compact_zone_counters_init() Yafang Shao
2019-07-23  8:12 ` Michal Hocko
2019-07-23  8:24   ` Yafang Shao
2019-07-23 21:40   ` Andrew Morton
2019-07-24 13:35     ` Vlastimil Babka
2019-07-25  0:19       ` Andrew Morton [this message]
2019-07-25  0:25         ` Andrew Morton
2019-07-25 11:42           ` Vlastimil Babka

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=20190724171945.c81db3079162a1eb4730bd20@linux-foundation.org \
    --to=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 \
    --cc=vbabka@suse.cz \
    /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;
as well as URLs for NNTP newsgroup(s).