linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Xishi Qiu <qiuxishi@huawei.com>
To: Vlastimil Babka <vbabka@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	Tang Chen <tangchen@cn.fujitsu.com>,
	Mel Gorman <mgorman@techsingularity.net>
Cc: Linux MM <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"robert.liu@huawei.com" <robert.liu@huawei.com>
Subject: [RFC] mem-hotplug: shall we skip unmovable node when doing numa balance?
Date: Tue, 8 Nov 2016 12:43:17 +0800	[thread overview]
Message-ID: <582157E5.8000106@huawei.com> (raw)

On mem-hotplug system, there is a problem, please see the following case.

memtester xxG, the memory will be alloced on a movable node. And after numa
balancing, the memory may be migrated to the other node, it may be a unmovable
node. This will reduce the free memory of the unmovable node, and may be oom
later.

My question is that shall we skip unmovable node when doing numa balance?
or just let the manager set some numa policies?

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 057964d..f0954ac 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2334,6 +2334,13 @@ int mpol_misplaced(struct page *page, struct vm_area_struct *vma, unsigned long
 out:
 	mpol_cond_put(pol);
 
+	/* Skip unmovable nodes when do numa balancing */
+	if (movable_node_enabled && ret != -1) {
+		zone = NODE_DATA(ret)->node_zones + MAX_NR_ZONES - 1;
+		if (!populated_zone(zone))
+			ret = -1;
+	}
+
 	return ret;
 }

Thanks,
Xishi Qiu

--
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:[~2016-11-08  4:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-08  4:43 Xishi Qiu [this message]
2016-11-09 11:58 ` [RFC] mem-hotplug: shall we skip unmovable node when doing numa balance? Mel Gorman
2016-11-10  3:17   ` Xishi Qiu
2016-11-10  9:07     ` Mel Gorman

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=582157E5.8000106@huawei.com \
    --to=qiuxishi@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=robert.liu@huawei.com \
    --cc=tangchen@cn.fujitsu.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;
as well as URLs for NNTP newsgroup(s).