linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: linux-mm@kvack.org, Zi Yan <zi.yan@cs.rutgers.edu>,
	Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
	Vlastimil Babka <vbabka@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andrea Reale <ar@linux.vnet.ibm.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 1/3] mm, numa: rework do_pages_move
Date: Wed, 13 Dec 2017 15:10:39 +0100	[thread overview]
Message-ID: <20171213141039.GL25185@dhcp22.suse.cz> (raw)
In-Reply-To: <20171213124731.hmg4r5m3efybgjtx@node.shutemov.name>

On Wed 13-12-17 15:47:31, Kirill A. Shutemov wrote:
> On Wed, Dec 13, 2017 at 01:17:03PM +0100, Michal Hocko wrote:
> > On Wed 13-12-17 15:07:33, Kirill A. Shutemov wrote:
> > [...]
> > > The approach looks fine to me.
> > > 
> > > But patch is rather large and hard to review. And how git mixed add/remove
> > > lines doesn't help too. Any chance to split it up further?
> > 
> > I was trying to do that but this is a drop in replacement so it is quite
> > hard to do in smaller pieces. I've already put the allocation callback
> > cleanup into a separate one but this is about all that I figured how to
> > split. If you have any suggestions I am willing to try them out.
> 
> "git diff --patience" seems generate more readable output for the patch.

Hmm, I wasn't aware of this option. Are you suggesting I should use it
to general the patch to send?

> > > One nitpick: I don't think 'chunk' terminology should go away with the
> > > patch.
> > 
> > Not sure what you mean here. I have kept chunk_start, chunk_node, so I
> > am not really changing that terminology
> 
> We don't really have chunks anymore, right? We still *may* have per-node
> batching, but..
> 
> Maybe just 'start' and 'current_node'?

Ohh, I've read your response that you want to preserve the naming. I can
certainly do the rename.
---
diff --git a/mm/migrate.c b/mm/migrate.c
index 9d7252ea2acd..5491045b60f9 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1556,14 +1556,14 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes,
 			 const int __user *nodes,
 			 int __user *status, int flags)
 {
-	int chunk_node = NUMA_NO_NODE;
+	int current_node = NUMA_NO_NODE;
 	LIST_HEAD(pagelist);
-	int chunk_start, i;
+	int start, i;
 	int err = 0, err1;
 
 	migrate_prep();
 
-	for (i = chunk_start = 0; i < nr_pages; i++) {
+	for (i = start = 0; i < nr_pages; i++) {
 		const void __user *p;
 		unsigned long addr;
 		int node;
@@ -1585,25 +1585,25 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes,
 		if (!node_isset(node, task_nodes))
 			goto out_flush;
 
-		if (chunk_node == NUMA_NO_NODE) {
-			chunk_node = node;
-			chunk_start = i;
-		} else if (node != chunk_node) {
-			err = do_move_pages_to_node(mm, &pagelist, chunk_node);
+		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, chunk_start, chunk_node, i - chunk_start);
+			err = store_status(status, start, current_node, i - start);
 			if (err)
 				goto out;
-			chunk_start = i;
-			chunk_node = node;
+			start = i;
+			current_node = node;
 		}
 
 		/*
 		 * Errors in the page lookup or isolation are not fatal and we simply
 		 * report them via status
 		 */
-		err = add_page_for_migration(mm, addr, chunk_node,
+		err = add_page_for_migration(mm, addr, current_node,
 				&pagelist, flags & MPOL_MF_MOVE_ALL);
 		if (!err)
 			continue;
@@ -1612,22 +1612,22 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes,
 		if (err)
 			goto out_flush;
 
-		err = do_move_pages_to_node(mm, &pagelist, chunk_node);
+		err = do_move_pages_to_node(mm, &pagelist, current_node);
 		if (err)
 			goto out;
-		if (i > chunk_start) {
-			err = store_status(status, chunk_start, chunk_node, i - chunk_start);
+		if (i > start) {
+			err = store_status(status, start, current_node, i - start);
 			if (err)
 				goto out;
 		}
-		chunk_node = NUMA_NO_NODE;
+		current_node = NUMA_NO_NODE;
 	}
 	err = 0;
 out_flush:
 	/* Make sure we do not overwrite the existing error */
-	err1 = do_move_pages_to_node(mm, &pagelist, chunk_node);
+	err1 = do_move_pages_to_node(mm, &pagelist, current_node);
 	if (!err1)
-		err1 = store_status(status, chunk_start, chunk_node, i - chunk_start);
+		err1 = store_status(status, start, current_node, i - start);
 	if (!err)
 		err = err1;
 out:
-- 
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>

  reply	other threads:[~2017-12-13 14:10 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07 12:48 [RFC PATCH] mm: unclutter THP migration Michal Hocko
2017-12-07 14:10 ` Zi Yan
2017-12-07 14:34   ` Michal Hocko
2017-12-08 16:15     ` [RFC PATCH 0/3] " Michal Hocko
2017-12-08 16:15       ` [RFC PATCH 1/3] mm, numa: rework do_pages_move Michal Hocko
2017-12-13 12:07         ` Kirill A. Shutemov
2017-12-13 12:17           ` Michal Hocko
2017-12-13 12:47             ` Kirill A. Shutemov
2017-12-13 14:10               ` Michal Hocko [this message]
2017-12-13 14:27                 ` Kirill A. Shutemov
2017-12-13 14:39         ` Michal Hocko
2017-12-14 15:35           ` Kirill A. Shutemov
2017-12-15  9:28             ` Michal Hocko
2017-12-15  9:51               ` Kirill A. Shutemov
2017-12-15  9:57                 ` Michal Hocko
2018-01-02 11:25         ` Anshuman Khandual
2018-01-02 12:12           ` Michal Hocko
2018-01-03  3:11             ` Anshuman Khandual
2018-01-03  8:42         ` Anshuman Khandual
2018-01-03  8:58           ` Michal Hocko
2018-01-03  9:36             ` Anshuman Khandual
2018-01-03  9:52               ` Michal Hocko
2017-12-08 16:15       ` [RFC PATCH 2/3] mm, migrate: remove reason argument from new_page_t Michal Hocko
2017-12-27  2:12         ` Zi Yan
2017-12-29 11:32           ` Michal Hocko
2017-12-08 16:15       ` [RFC PATCH 3/3] mm: unclutter THP migration Michal Hocko
2017-12-13 12:20         ` Kirill A. Shutemov
2017-12-27  2:19         ` Zi Yan
2017-12-29 11:36           ` Michal Hocko
2017-12-29 15:45             ` Zi Yan
2017-12-31  9:07               ` Michal Hocko
2017-12-31 13:09                 ` Zi Yan
2017-12-19 12:07       ` [RFC PATCH 0/3] " 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=20171213141039.GL25185@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=ar@linux.vnet.ibm.com \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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