linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@cmpxchg.org>
To: Rik van Riel <riel@redhat.com>, Mel Gorman <mgorman@suse.de>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: kswapd endless loop for compaction
Date: Tue, 20 Nov 2012 14:04:41 -0500	[thread overview]
Message-ID: <20121120190440.GA24381@cmpxchg.org> (raw)

Hi guys,

while testing a 3.7-rc5ish kernel, I noticed that kswapd can drop into
a busy spin state without doing reclaim.  printk-style debugging told
me that this happens when the distance between a zone's high watermark
and its low watermark is less than two huge pages (DMA zone).

1. The first loop in balance_pgdat() over the zones finds all zones to
be above their high watermark and only does goto out (all_zones_ok).

2. pgdat_balanced() at the out: label also just checks the high
watermark, so the node is considered balanced and the order is not
reduced.

3. In the `if (order)' block after it, compaction_suitable() checks if
the zone's low watermark + twice the huge page size is okay, which
it's not necessarily in a small zone, and so COMPACT_SKIPPED makes it
it go back to loop_again:.

This will go on until somebody else allocates and breaches the high
watermark and then hopefully goes on to reclaim the zone above low
watermark + 2 * THP.

I'm not really sure what the correct solution is.  Should we modify
the zone_watermark_ok() checks in balance_pgdat() to take into account
the higher watermark requirements for reclaim on behalf of compaction?
Change the check in compaction_suitable() / not use it directly?

Thanks,
Johannes

--
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>

             reply	other threads:[~2012-11-20 19:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-20 19:04 Johannes Weiner [this message]
2012-11-21 22:01 ` kswapd endless loop for compaction Johannes Weiner
2012-11-22 14:40 ` Jaegeuk Hanse
2012-11-23  8:50 ` Jaegeuk Hanse

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=20121120190440.GA24381@cmpxchg.org \
    --to=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=riel@redhat.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;
as well as URLs for NNTP newsgroup(s).