Commit a0dfe235 authored by Kefeng Wang's avatar Kefeng Wang Committed by Peng Zhang
Browse files

mm: migrate: remove PageHead() check for HugeTLB in add_page_for_migration()

mainline inclusion
from mainline-v6.7-rc1
commit b426ed7889be80359cb4edef142e5c5fa697b068
category: other
bugzilla: https://gitee.com/openeuler/kernel/issues/I8JQWQ

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b426ed7889be80359cb4edef142e5c5fa697b068

--------------------------------

There is some different between hugeTLB and THP behave when passed the
address of a tail page, for THP, it will migrate the entire THP page, but
for HugeTLB, it will return -EACCES, or -ENOENT before commit e66f17ff
("mm/hugetlb: take page table lock in follow_huge_pmd()"),

  -EACCES The page is mapped by multiple processes and can be moved
	  only if MPOL_MF_MOVE_ALL is specified.
  -ENOENT The page is not present.

But when check manual[1], both of the two errnos are not suitable, it is
better to keep the same behave between hugetlb and THP when passed the
address of a tail page, so let's just remove the PageHead() check for
HugeTLB.

[1] https://man7.org/linux/man-pages/man2/move_pages.2.html

Link: https://lkml.kernel.org/r/20230913095131.2426871-8-wangkefeng.wang@huawei.com


Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Suggested-by: default avatarMike Kravetz <mike.kravetz@oracle.com>
Acked-by: default avatarZi Yan <ziy@nvidia.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: "Huang, Ying" <ying.huang@intel.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarZhangPeng <zhangpeng362@huawei.com>
parent 23f2833e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment