From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Michal Hocko <mhocko@kernel.org>
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>,
Michal Hocko <mhocko@suse.com>
Subject: Re: [RFC PATCH 1/3] mm, numa: rework do_pages_move
Date: Wed, 13 Dec 2017 15:07:33 +0300 [thread overview]
Message-ID: <20171213120733.umeb7rylswl7chi5@node.shutemov.name> (raw)
In-Reply-To: <20171208161559.27313-2-mhocko@kernel.org>
On Fri, Dec 08, 2017 at 05:15:57PM +0100, Michal Hocko wrote:
> From: Michal Hocko <mhocko@suse.com>
>
> do_pages_move is supposed to move user defined memory (an array of
> addresses) to the user defined numa nodes (an array of nodes one for
> each address). The user provided status array then contains resulting
> numa node for each address or an error. The semantic of this function is
> little bit confusing because only some errors are reported back. Notably
> migrate_pages error is only reported via the return value. This patch
> doesn't try to address these semantic nuances but rather change the
> underlying implementation.
>
> Currently we are processing user input (which can be really large)
> in batches which are stored to a temporarily allocated page. Each
> address is resolved to its struct page and stored to page_to_node
> structure along with the requested target numa node. The array of these
> structures is then conveyed down the page migration path via private
> argument. new_page_node then finds the corresponding structure and
> allocates the proper target page.
>
> What is the problem with the current implementation and why to change
> it? Apart from being quite ugly it also doesn't cope with unexpected
> pages showing up on the migration list inside migrate_pages path.
> That doesn't happen currently but the follow up patch would like to
> make the thp migration code more clear and that would need to split a
> THP into the list for some cases.
>
> How does the new implementation work? Well, instead of batching into a
> fixed size array we simply batch all pages that should be migrated to
> the same node and isolate all of them into a linked list which doesn't
> require any additional storage. This should work reasonably well because
> page migration usually migrates larger ranges of memory to a specific
> node. So the common case should work equally well as the current
> implementation. Even if somebody constructs an input where the target
> numa nodes would be interleaved we shouldn't see a large performance
> impact because page migration alone doesn't really benefit from
> batching. mmap_sem batching for the lookup is quite questionable and
> isolate_lru_page which would benefit from batching is not using it even
> in the current implementation.
>
> Signed-off-by: Michal Hocko <mhocko@suse.com>
> ---
> mm/internal.h | 1 +
> mm/mempolicy.c | 5 +-
> mm/migrate.c | 306 +++++++++++++++++++++++++--------------------------------
> 3 files changed, 139 insertions(+), 173 deletions(-)
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?
One nitpick: I don't think 'chunk' terminology should go away with the
patch.
--
Kirill A. Shutemov
--
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:[~2017-12-13 12:07 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 [this message]
2017-12-13 12:17 ` Michal Hocko
2017-12-13 12:47 ` Kirill A. Shutemov
2017-12-13 14:10 ` Michal Hocko
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=20171213120733.umeb7rylswl7chi5@node.shutemov.name \
--to=kirill@shutemov.name \
--cc=akpm@linux-foundation.org \
--cc=ar@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=mhocko@suse.com \
--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