Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1375796

Re: [PATCH 06/11] mm, compaction: distinguish between full and partial COMPACT_COMPLETE

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 06/11] mm, compaction: distinguish between full and partial COMPACT_COMPLETE
Date 2016-04-11 14:50 +0200
Message-ID <rmJrY-61n-27@gated-at.bofh.it> (permalink)
References <rkxlf-2sv-9@gated-at.bofh.it> <rkxlh-2sv-45@gated-at.bofh.it> <rmIYW-5N5-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon 11-04-16 14:10:26, Vlastimil Babka wrote:
> On 04/05/2016 01:25 PM, Michal Hocko wrote:
> >From: Michal Hocko <mhocko@suse.com>
> >
> >COMPACT_COMPLETE now means that compaction and free scanner met. This is
> >not very useful information if somebody just wants to use this feedback
> >and make any decisions based on that. The current caller might be a poor
> >guy who just happened to scan tiny portion of the zone and that could be
> >the reason no suitable pages were compacted. Make sure we distinguish
> >the full and partial zone walks.
> >
> >Consumers should treat COMPACT_PARTIAL_SKIPPED as a potential success
> >and be optimistic in retrying.
> >
> >The existing users of COMPACT_COMPLETE are conservatively changed to
> >use COMPACT_PARTIAL_SKIPPED as well but some of them should be probably
> >reconsidered and only defer the compaction only for COMPACT_COMPLETE
> >with the new semantic.
> >
> >This patch shouldn't introduce any functional changes.
> >
> >Signed-off-by: Michal Hocko <mhocko@suse.com>
> 
> Acked-by: Vlastimil Babka <vbabka@suse.cz>

Thanks!

> With some notes:
> 
> >@@ -1463,6 +1466,10 @@ static enum compact_result compact_zone(struct zone *zone, struct compact_contro
> >  		zone->compact_cached_migrate_pfn[0] = cc->migrate_pfn;
> >  		zone->compact_cached_migrate_pfn[1] = cc->migrate_pfn;
> >  	}
> >+
> >+	if (cc->migrate_pfn == start_pfn)
> >+		cc->whole_zone = true;
> >+
> 
> This assumes that migrate scanner at initial position implies also free
> scanner at the initial position. That should be true, because migration
> scanner is the first to run. But getting the zone->compact_cached_*_pfn is
> racy. Worse, zone->compact_cached_migrate_pfn is array distinguishing sync
> and async compaction, so it's possible that async compaction has advanced
> both its own migrate scanner cached position, and the shared free scanner
> cached position, and then sync compaction starts migrate scanner at
> start_pfn, but free scanner has already advanced.

OK, I see. The whole thing smelled racy but I thought it wouldn't be
such a big deal. Even if we raced then only a marginal part of the zone
wouldn't be scanned, right? Or is it possible that free_pfn would appear
in the middle of the zone because of the race?

> So you might still see a false positive COMPACT_COMPLETE, just less
> frequently and probably with much lower impact.
> But if you need to be truly reliable, check also that cc->free_pfn ==
> round_down(end_pfn - 1, pageblock_nr_pages)

I do not think we need the precise check if the race window (in the
skipped zone range) is always small.

Thanks!
-- 
Michal Hocko
SUSE Labs

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/11] oom detection rework v5 Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
  [PATCH 10/11] mm, oom: protect !costly allocations some more Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
    Re: [PATCH 10/11] mm, oom: protect !costly allocations some more Andrew Morton <akpm@linux-foundation.org> - 2016-04-06 02:10 +0200
      Re: [PATCH 10/11] mm, oom: protect !costly allocations some more Michal Hocko <mhocko@kernel.org> - 2016-04-06 11:30 +0200
    Re: [PATCH 10/11] mm, oom: protect !costly allocations some more Vlastimil Babka <vbabka@suse.cz> - 2016-04-11 16:50 +0200
  [PATCH 08/11] mm, compaction: Simplify __alloc_pages_direct_compact feedback interface Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
    Re: [PATCH 08/11] mm, compaction: Simplify  __alloc_pages_direct_compact feedback interface Vlastimil Babka <vbabka@suse.cz> - 2016-04-11 16:00 +0200
  [PATCH 04/11] mm, compaction: cover all compaction mode in compact_zone Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
  [PATCH 05/11] mm, compaction: distinguish COMPACT_DEFERRED from COMPACT_SKIPPED Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
    Re: [PATCH 05/11] mm, compaction: distinguish COMPACT_DEFERRED from  COMPACT_SKIPPED Vlastimil Babka <vbabka@suse.cz> - 2016-04-11 13:10 +0200
      Re: [PATCH 05/11] mm, compaction: distinguish COMPACT_DEFERRED from  COMPACT_SKIPPED Michal Hocko <mhocko@kernel.org> - 2016-04-11 13:30 +0200
  [PATCH 07/11] mm, compaction: Update compaction_result ordering Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
    Re: [PATCH 07/11] mm, compaction: Update compaction_result ordering Vlastimil Babka <vbabka@suse.cz> - 2016-04-11 14:20 +0200
  [PATCH 02/11] mm: throttle on IO only when there are too many dirty and writeback pages Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
  [PATCH 01/11] mm, oom: rework oom detection Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
  [PATCH 03/11] mm, compaction: change COMPACT_ constants into enum Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
  [PATCH 06/11] mm, compaction: distinguish between full and partial COMPACT_COMPLETE Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
    Re: [PATCH 06/11] mm, compaction: distinguish between full and  partial COMPACT_COMPLETE Vlastimil Babka <vbabka@suse.cz> - 2016-04-11 14:20 +0200
      Re: [PATCH 06/11] mm, compaction: distinguish between full and  partial COMPACT_COMPLETE Michal Hocko <mhocko@kernel.org> - 2016-04-11 14:50 +0200
        Re: [PATCH 06/11] mm, compaction: distinguish between full and  partial COMPACT_COMPLETE Vlastimil Babka <vbabka@suse.cz> - 2016-04-11 15:00 +0200
          Re: [PATCH 06/11] mm, compaction: distinguish between full and  partial COMPACT_COMPLETE Michal Hocko <mhocko@kernel.org> - 2016-04-11 15:30 +0200
            Re: [PATCH 06/11] mm, compaction: distinguish between full and  partial COMPACT_COMPLETE Vlastimil Babka <vbabka@suse.cz> - 2016-04-11 15:50 +0200
              Re: [PATCH 06/11] mm, compaction: distinguish between full and  partial COMPACT_COMPLETE Michal Hocko <mhocko@kernel.org> - 2016-04-11 15:50 +0200
  [PATCH 09/11] mm, compaction: Abstract compaction feedback to helpers Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
    Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to  helpers Andrew Morton <akpm@linux-foundation.org> - 2016-04-06 02:00 +0200
      Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to  helpers Hugh Dickins <hughd@google.com> - 2016-04-06 03:00 +0200
        Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to  helpers Michal Hocko <mhocko@kernel.org> - 2016-04-06 11:30 +0200
        Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to  helpers Andrew Morton <akpm@linux-foundation.org> - 2016-04-06 19:50 +0200
    Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to  helpers Vlastimil Babka <vbabka@suse.cz> - 2016-04-11 16:40 +0200
      Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to  helpers Michal Hocko <mhocko@kernel.org> - 2016-04-11 17:20 +0200
        Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to  helpers Michal Hocko <mhocko@kernel.org> - 2016-04-11 17:40 +0200
        Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to  helpers Vlastimil Babka <vbabka@suse.cz> - 2016-04-12 14:00 +0200
          Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to  helpers Michal Hocko <mhocko@kernel.org> - 2016-04-12 14:30 +0200
    Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to  helpers Michal Hocko <mhocko@kernel.org> - 2016-04-11 18:00 +0200
      [RFC PATCH] mm: use compaction feedback for thp backoff conditions Michal Hocko <mhocko@kernel.org> - 2016-04-11 18:10 +0200
      Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to  helpers Vlastimil Babka <vbabka@suse.cz> - 2016-04-12 14:00 +0200
  [PATCH 11/11] mm: consider compaction feedback also for costly allocation Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
    Re: [PATCH 11/11] mm: consider compaction feedback also for costly  allocation Michal Hocko <mhocko@kernel.org> - 2016-04-05 14:50 +0200
    Re: [PATCH 11/11] mm: consider compaction feedback also for costly  allocation Vlastimil Babka <vbabka@suse.cz> - 2016-04-11 17:10 +0200
  Re: [PATCH 00/11] oom detection rework v5 Michal Hocko <mhocko@kernel.org> - 2016-04-05 14:50 +0200

csiph-web