Skip to content

Commit

Permalink
arm64: hugetlb: set_huge_pte_at Add WARN_ON on !pte_present
Browse files Browse the repository at this point in the history
This patch adds a WARN_ON to set_huge_pte_at as the accessor assumes
that entries to be written down are all present. (There are separate
accessors to clear huge ptes).

We will need to handle the !pte_present case where memory offlining
is used on hugetlb pages. swap and migration entries will be supplied
to set_huge_pte_at in this case.

Cc: David Woods <dwoods@mellanox.com>
Signed-off-by: Steve Capper <steve.capper@arm.com>
Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
  • Loading branch information
Steve Capper authored and Catalin Marinas committed Aug 22, 2017
1 parent a88ce63 commit d3ea795
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/arm64/mm/hugetlbpage.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
unsigned long pfn;
pgprot_t hugeprot;

/*
* Code needs to be expanded to handle huge swap and migration
* entries. Needed for HUGETLB and MEMORY_FAILURE.
*/
WARN_ON(!pte_present(pte));

if (!pte_cont(pte)) {
set_pte_at(mm, addr, ptep, pte);
return;
Expand Down

0 comments on commit d3ea795

Please sign in to comment.