From: Christopher Lameter <cl@linux.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
Zi Yan <zi.yan@cs.rutgers.edu>,
Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
"Kirill A. Shutemov" <kirill@shutemov.name>,
Vlastimil Babka <vbabka@suse.cz>,
Andrea Reale <ar@linux.vnet.ibm.com>,
linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] mm, numa: rework do_pages_move
Date: Fri, 5 Jan 2018 12:41:22 -0600 (CST) [thread overview]
Message-ID: <alpine.DEB.2.20.1801051237300.26065@nuc-kabylake> (raw)
In-Reply-To: <20180105180905.GR2801@dhcp22.suse.cz>
On Fri, 5 Jan 2018, Michal Hocko wrote:
> I believe there should be some cap on the number of pages. We shouldn't
> keep it held for million of pages if all of them are moved to the same
> node. I would really like to postpone that to later unless it causes
> some noticeable regressions because this would complicate the code
> further and I am not sure this is all worth it.
Attached a patch to make the code more readable.
Also why are you migrating the pages on pagelist if a
add_page_for_migration() fails? One could simply update
the status in user space and continue.
Index: linux/mm/migrate.c
===================================================================
--- linux.orig/mm/migrate.c
+++ linux/mm/migrate.c
@@ -1584,16 +1584,20 @@ static int do_pages_move(struct mm_struc
if (!node_isset(node, task_nodes))
goto out_flush;
- if (current_node == NUMA_NO_NODE) {
- current_node = node;
- start = i;
- } else if (node != current_node) {
- err = do_move_pages_to_node(mm, &pagelist, current_node);
- if (err)
- goto out;
- err = store_status(status, start, current_node, i - start);
- if (err)
- goto out;
+ if (node != current_node) {
+
+ if (current_node != NUMA_NO_NODE) {
+
+ /* Move the pages to current_node */
+ err = do_move_pages_to_node(mm, &pagelist, current_node);
+ if (err)
+ goto out;
+
+ err = store_status(status, start, current_node, i - start);
+ if (err)
+ goto out;
+ }
+
start = i;
current_node = node;
}
@@ -1607,6 +1611,10 @@ static int do_pages_move(struct mm_struc
if (!err)
continue;
+ /*
+ * Failure to isolate a page so flush the pages on
+ * pagelist after storing status and continue.
+ */
err = store_status(status, i, err, 1);
if (err)
goto out_flush;
@@ -1614,6 +1622,7 @@ static int do_pages_move(struct mm_struc
err = do_move_pages_to_node(mm, &pagelist, current_node);
if (err)
goto out;
+
if (i > start) {
err = store_status(status, start, current_node, i - start);
if (err)
--
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:[~2018-01-05 18:43 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-03 8:25 [PATCH 0/3] unclutter thp migration Michal Hocko
2018-01-03 8:25 ` [PATCH 1/3] mm, numa: rework do_pages_move Michal Hocko
2018-01-05 3:52 ` Anshuman Khandual
2018-01-05 9:14 ` Michal Hocko
2018-01-05 9:20 ` Anshuman Khandual
2018-01-05 9:33 ` Michal Hocko
2018-01-05 17:15 ` Christopher Lameter
2018-01-05 18:09 ` Michal Hocko
2018-01-05 18:41 ` Christopher Lameter [this message]
2018-01-05 18:48 ` Michal Hocko
2018-01-05 19:27 ` Christopher Lameter
2018-01-05 19:44 ` Michal Hocko
2018-01-29 22:06 ` Zi Yan
2018-01-29 22:35 ` Andrew Morton
2018-01-29 23:39 ` Zi Yan
2018-01-29 23:48 ` Andrew Morton
2018-01-03 8:25 ` [PATCH 2/3] mm, migrate: remove reason argument from new_page_t Michal Hocko
2018-01-03 9:11 ` Michal Hocko
2018-01-03 14:00 ` Anshuman Khandual
2018-01-03 14:09 ` Michal Hocko
2018-01-03 14:19 ` Anshuman Khandual
2018-01-03 8:25 ` [PATCH 3/3] mm: unclutter THP migration Michal Hocko
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=alpine.DEB.2.20.1801051237300.26065@nuc-kabylake \
--to=cl@linux.com \
--cc=akpm@linux-foundation.org \
--cc=ar@linux.vnet.ibm.com \
--cc=khandual@linux.vnet.ibm.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=vbabka@suse.cz \
--cc=zi.yan@cs.rutgers.edu \
/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).