linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Li Xinhai" <lixinhai.lxh@gmail.com>
To: anshuman.khandual <anshuman.khandual@arm.com>,
	 "Michal Hocko" <mhocko@kernel.org>
Cc: n-horiguchi <n-horiguchi@ah.jp.nec.com>,
	 "linux-mm@kvack.org" <linux-mm@kvack.org>,
	 akpm <akpm@linux-foundation.org>,
	 torvalds <torvalds@linux-foundation.org>,
	 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	 "Mike Kravetz" <mike.kravetz@oracle.com>
Subject: Re: [PATCH v4] mm/mempolicy,hugetlb: Checking hstate for hugetlbfs page in vma_migratable
Date: Tue, 21 Jan 2020 21:08:35 +0800	[thread overview]
Message-ID: <20200121210832933327375@gmail.com> (raw)
In-Reply-To: 3cef881e-8685-4917-1784-286dc3b11bf6@arm.com

On 2020-01-21 at 12:12 Anshuman Khandual wrote:
>
>
>On 01/20/2020 09:35 PM, Michal Hocko wrote:
>> On Mon 20-01-20 23:37:25, Li Xinhai wrote:
>> [...]
>>> Changelog is updated as below, thanks for comments:
>>> ---
>>> mm/mempolicy: Checking hugepage migration is supported by arch in vma_migratable
>>>
>>> vma_migratable() is called to check if pages in vma can be migrated
>>> before go ahead to further actions. Currently it is used in below code
>>> path:
>>> - task_numa_work
>>> - mbind
>>> - move_pages
>>>
>>> For hugetlb mapping, whether vma is migratable or not is determined by:
>>> - CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION
>>> - arch_hugetlb_migration_supported
>>>
>>> Issue: current code only checks for CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION,
>>> which express less accurate semantics of vma_migratable(). (note that
>>> current code in vma_migratable don't cause failure or bug because
>>> unmap_and_move_huge_page() will catch unsupported hugepage and handle it
>>> properly)
>>>
>>> This patch checks the two factors for impoveing code logic and
>>> robustness. It will enable early bail out of hugepage migration procedure,
>>> but because currently all architecture supporting hugepage migration is able
>>> to support all page size, we would not see performance gain with this patch
>>> applied.
>>
>> This looks definitely better than the original one. I hope it is more
>> clear to you what I meant by a better description for the justification.
>> I would just add that the no code should use
>> CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION directly and use
>> arch_hugetlb_migration_supported instead. This will be the case after
>> this patch.
>
>As I have mentioned previously on the other thread, there might be an case
>to keep the existing code (just added with a comment) which will preserve
>the performance. But the proposed method will do it the right way and also
>get rid of CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION here. Its OK either way.
> 

In my understanding, we need to starting utilize the exported arch* interface,
insteadd of till some arch support only part of page size, that would be hard
for arch developers to notitce that there is a site want to call it, and add the
call. (BTW, arch_hugetlb_migration_supported also give arch the right to decide
whether migration is supported or not by more factors, besides page size)

Yes, CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION is removed. And I provide
VMA level checking with a new interface for hugetlb mapping, so later if we
need add more checks, that will also help us, and lower the chance for error.

>>
>> Please keep in mind that changelogs are really important and growing in
>> importance as the code gets more complicated over time. It is much more
>> easier to see what the patch does because reading diffs and the code is
>> easy but the lack of motivation is what people usually fighting with.
>>

  reply	other threads:[~2020-01-21 13:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-16  4:11 [PATCH v4] mm/mempolicy,hugetlb: Checking hstate for hugetlbfs page in vma_migratable Li Xinhai
2020-01-16  9:56 ` Michal Hocko
2020-01-16 13:50   ` Li Xinhai
2020-01-16 15:18     ` Michal Hocko
2020-01-16 15:38       ` Li Xinhai
2020-01-17  3:16         ` Li Xinhai
2020-01-18  3:11           ` Li Xinhai
2020-01-18 15:27             ` Li Xinhai
2020-01-20 10:12             ` Michal Hocko
2020-01-20 15:37               ` Li Xinhai
2020-01-20 16:05                 ` Michal Hocko
2020-01-21  3:42                   ` Anshuman Khandual
2020-01-21 13:08                     ` Li Xinhai [this message]
2020-01-21 12:44                   ` Li Xinhai
2020-01-20  9:21       ` Anshuman Khandual
2020-01-20 11:32         ` Michal Hocko
2020-01-21  3:22           ` Anshuman Khandual
2020-01-20 14:19         ` Li Xinhai
2020-01-22  6:05 ` Anshuman Khandual
2020-01-22 13:21   ` Li Xinhai
2020-01-23  7:48     ` Anshuman Khandual

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=20200121210832933327375@gmail.com \
    --to=lixinhai.lxh@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=mike.kravetz@oracle.com \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=torvalds@linux-foundation.org \
    /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).