From: Michal Hocko <mhocko@kernel.org>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Mel Gorman <mgorman@suse.de>, Rik van Riel <riel@redhat.com>,
Johannes Weiner <hannes@cmpxchg.org>,
linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] mm, oom, compaction: prevent from should_compact_retry looping for ever for costly orders
Date: Tue, 12 Apr 2016 14:43:44 +0200 [thread overview]
Message-ID: <20160412124344.GE10771@dhcp22.suse.cz> (raw)
In-Reply-To: <570CA287.3030604@suse.cz>
On Tue 12-04-16 09:23:51, Vlastimil Babka wrote:
[...]
> It's a bit complicated, but I agree that something like this is needed to
> prevent unexpected endless loops. Alternatively you could maybe just extend
> compact_result to distinguish between COMPACT_SKIPPED (but possible after
> reclaim) and COMPACT_IMPOSSIBLE (or some better name?). Then
> compaction_withdrawn() would obviously be false for IMPOSSIBLE, while
> compaction_failed() would be true? Then you shouldn't need
> compaction_zonelist_suitable().
I would rather not add more states. My head spins with the current state
already...
> >+bool compaction_zonelist_suitable(struct alloc_context *ac, int order,
> >+ int alloc_flags)
> >+{
> >+ struct zone *zone;
> >+ struct zoneref *z;
> >+
> >+ /*
> >+ * Make sure at least one zone would pass __compaction_suitable if we continue
> >+ * retrying the reclaim.
> >+ */
> >+ for_each_zone_zonelist_nodemask(zone, z, ac->zonelist, ac->classzone_idx,
>
> I think here you should s/classzone_idx/high_zoneidx/
true
>
> >+ ac->nodemask) {
> >+ unsigned long available;
> >+ enum compact_result compact_result;
> >+
> >+ /*
> >+ * Do not consider all the reclaimable memory because we do not
> >+ * want to trash just for a single high order allocation which
> >+ * is even not guaranteed to appear even if __compaction_suitable
> >+ * is happy about the watermark check.
> >+ */
> >+ available = zone_reclaimable_pages(zone) / order;
> >+ available += zone_page_state_snapshot(zone, NR_FREE_PAGES);
> >+ compact_result = __compaction_suitable(zone, order, alloc_flags,
> >+ ac->high_zoneidx, available);
>
> And vice versa here.
will fix this. Thanks!
--
Michal Hocko
SUSE Labs
--
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>
prev parent reply other threads:[~2016-04-12 12:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-11 6:45 [PATCH 0/2] oom detection rework followups Michal Hocko
2016-04-11 6:45 ` [PATCH 1/2] vmscan: consider classzone_idx in compaction_ready Michal Hocko
2016-04-11 15:24 ` Vlastimil Babka
2016-04-11 6:45 ` [PATCH 2/2] mm, oom, compaction: prevent from should_compact_retry looping for ever for costly orders Michal Hocko
2016-04-12 7:23 ` Vlastimil Babka
2016-04-12 12:43 ` Michal Hocko [this message]
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=20160412124344.GE10771@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=riel@redhat.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