On Wed, 24 Jul 2019 15:35:12 +0200 Vlastimil Babka <vbabka@xxxxxxx> wrote: > On 7/23/19 11:40 PM, Andrew Morton wrote: > > On Tue, 23 Jul 2019 10:12:18 +0200 Michal Hocko <mhocko@xxxxxxxx> 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@xxxxxxx> > > 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) { _