Thread (22 messages) 22 messages, 4 authors, 2022-05-10

Re: [PATCH 1/3] mm: change huge_ptep_clear_flush() to return the original pte

From: Baolin Wang <baolin.wang@linux.alibaba.com>
Date: 2022-05-06 03:01:50
Also in: linux-arch, linux-arm-kernel, linux-mips, linux-mm, linux-s390, linux-sh, lkml, sparclinux


On 5/6/2022 7:15 AM, Mike Kravetz wrote:
On 4/29/22 01:14, Baolin Wang wrote:
quoted
It is incorrect to use ptep_clear_flush() to nuke a hugetlb page
table when unmapping or migrating a hugetlb page, and will change
to use huge_ptep_clear_flush() instead in the following patches.

So this is a preparation patch, which changes the huge_ptep_clear_flush()
to return the original pte to help to nuke a hugetlb page table.

Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
---
  arch/arm64/include/asm/hugetlb.h   |  4 ++--
  arch/arm64/mm/hugetlbpage.c        | 12 +++++-------
  arch/ia64/include/asm/hugetlb.h    |  4 ++--
  arch/mips/include/asm/hugetlb.h    |  9 ++++++---
  arch/parisc/include/asm/hugetlb.h  |  4 ++--
  arch/powerpc/include/asm/hugetlb.h |  9 ++++++---
  arch/s390/include/asm/hugetlb.h    |  6 +++---
  arch/sh/include/asm/hugetlb.h      |  4 ++--
  arch/sparc/include/asm/hugetlb.h   |  4 ++--
  include/asm-generic/hugetlb.h      |  4 ++--
  10 files changed, 32 insertions(+), 28 deletions(-)
The above changes look straight forward.
Happy that you Cc'ed impacted arch maintainers so they can at least
have a look.

The only user of huge_ptep_clear_flush() today is hugetlb_cow/wp() in
mm/hugetlb.c.  Any reason why you did not change that code?  At least
Cause we did not use the return value of huge_ptep_clear_flush() in 
mm/hugetlb.c.
cast the return of huge_ptep_clear_flush() to void with a comment?
Sure. Will add an explicit casting in next version.
Not absolutely necessary.

Acked-by: Mike Kravetz <redacted>
Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help