From: Vlastimil Babka <vbabka@suse.cz>
To: Joonsoo Kim <js1304@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Mel Gorman <mgorman@suse.de>, Rik van Riel <riel@redhat.com>,
David Rientjes <rientjes@google.com>,
Minchan Kim <minchan@kernel.org>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>
Subject: Re: [PATCH v2 4/9] mm/compaction: remove compaction deferring
Date: Fri, 25 Sep 2015 11:33:38 +0200 [thread overview]
Message-ID: <560514F2.2060407@suse.cz> (raw)
In-Reply-To: <1440382773-16070-5-git-send-email-iamjoonsoo.kim@lge.com>
On 08/24/2015 04:19 AM, Joonsoo Kim wrote:
> Now, we have a way to determine compaction depleted state and compaction
> activity will be limited according this state and depletion depth so
> compaction overhead would be well controlled without compaction deferring.
> So, this patch remove compaction deferring completely and enable
> compaction activity limit.
>
> Various functions are renamed and tracepoint outputs are changed due to
> this removing.
It's more like renaming "deferred" to "failed" and the whole result is somewhat
hard to follow, as the changelog doesn't describe a lot. So if I understand
correctly:
- compaction has to fail 4 times to cause __reset_isolation_suitable(), which
also resets the fail counter back to 0
- thus after each 4 failures, depletion depth is adjusted
- when successes cross the depletion threshold, compaction_depleted() becomes
false and then compact_zone will clear the flag
- with flag clear, scan limit is no longer applied at all, but depletion depth
stays as it is... it will be set to 0 when the flag is set again
Maybe the switch from "depleted with some depth" to "not depleted at all" could
be more gradual?
Also I have a suspicion that the main feature of this (IIUC) which is the scan
limiting (and which I do consider improvement! and IIRC David wished for
something like that too) could be achieved with less code churn that is renaming
"deferred" to "failed" and adding another "depleted" state. E.g.
compact_defer_shift looks similar to compact_depletion_depth, and deferring
could be repurposed for scan limiting instead of binary go/no-go decisions. BTW
the name "depleted" also suggests a binary state, so it's not that much better
name than "deferred" IMHO.
Also I think my objection from patch 2 stays - __reset_isolation_suitable()
called from kswapd will set zone->compact_success = 0, potentially increase
depletion depth etc, with no connection to the number of failed compactions.
[...]
> @@ -1693,13 +1667,13 @@ static void __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc)
> if (cc->order == -1)
> __reset_isolation_suitable(zone);
>
> - if (cc->order == -1 || !compaction_deferred(zone, cc->order))
> + if (cc->order == -1)
This change means kswapd no longer compacts from balance_pgdat() ->
compact_pgdat(). Probably you meant to call compact_zone unconditionally here?
> compact_zone(zone, cc);
>
> if (cc->order > 0) {
> if (zone_watermark_ok(zone, cc->order,
> low_wmark_pages(zone), 0, 0))
> - compaction_defer_reset(zone, cc->order, false);
> + compaction_failed_reset(zone, cc->order, false);
> }
>
> VM_BUG_ON(!list_empty(&cc->freepages));
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 0e9cc98..c67f853 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -2827,7 +2827,7 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order,
> struct zone *zone = page_zone(page);
>
> zone->compact_blockskip_flush = false;
> - compaction_defer_reset(zone, order, true);
> + compaction_failed_reset(zone, order, true);
> count_vm_event(COMPACTSUCCESS);
> return page;
> }
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 37e90db..a561b5f 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -2469,10 +2469,10 @@ static inline bool compaction_ready(struct zone *zone, int order)
> watermark_ok = zone_watermark_ok_safe(zone, 0, watermark, 0, 0);
>
> /*
> - * If compaction is deferred, reclaim up to a point where
> + * If compaction is depleted, reclaim up to a point where
> * compaction will have a chance of success when re-enabled
> */
> - if (compaction_deferred(zone, order))
> + if (test_bit(ZONE_COMPACTION_DEPLETED, &zone->flags))
> return watermark_ok;
Hm this is a deviation from the "replace go/no-go with scan limit" principle.
Also compaction_deferred() could recover after some retries, and this flag won't.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-09-25 9:33 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-24 2:19 [PATCH v2 0/9] mm/compaction: redesign compaction Joonsoo Kim
2015-08-24 2:19 ` [PATCH v2 1/9] mm/compaction: skip useless pfn when updating cached pfn Joonsoo Kim
2015-08-24 9:07 ` Vlastimil Babka
2015-09-07 5:35 ` Joonsoo Kim
2015-09-08 16:30 ` Vlastimil Babka
2015-08-24 2:19 ` [PATCH v2 2/9] mm/compaction: introduce compaction depleted state on zone Joonsoo Kim
2015-09-25 8:04 ` Vlastimil Babka
2015-09-30 8:12 ` Joonsoo Kim
2015-08-24 2:19 ` [PATCH v2 3/9] mm/compaction: limit compaction activity in compaction depleted state Joonsoo Kim
2015-08-24 2:19 ` [PATCH v2 4/9] mm/compaction: remove compaction deferring Joonsoo Kim
2015-09-25 9:33 ` Vlastimil Babka [this message]
2015-09-30 8:28 ` Joonsoo Kim
2015-08-24 2:19 ` [PATCH v2 5/9] mm/compaction: allow to scan nonmovable pageblock when depleted state Joonsoo Kim
2015-09-25 10:32 ` Vlastimil Babka
2015-09-30 8:30 ` Joonsoo Kim
2015-08-24 2:19 ` [PATCH v2 6/9] mm/compaction: manage separate skip-bits for migration and free scanner Joonsoo Kim
2015-08-24 2:19 ` [PATCH v2 7/9] mm/compaction: redesign compaction Joonsoo Kim
2015-10-14 11:38 ` Vlastimil Babka
2015-10-15 2:38 ` Joonsoo Kim
2015-08-24 2:19 ` [PATCH v2 8/9] mm/compaction: don't use higher order freepage than compaction aims at Joonsoo Kim
2015-09-25 11:41 ` Vlastimil Babka
2015-09-30 8:38 ` Joonsoo Kim
2015-08-24 2:19 ` [PATCH v2 9/9] mm/compaction: new threshold for compaction depleted zone Joonsoo Kim
2015-10-14 12:28 ` Vlastimil Babka
2015-10-15 6:03 ` Joonsoo Kim
2015-10-15 6:06 ` Joonsoo Kim
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=560514F2.2060407@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=js1304@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=minchan@kernel.org \
--cc=riel@redhat.com \
--cc=rientjes@google.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