* [PATCH] mm/x86: Remove dead code for hugetlbpage.c
@ 2022-05-25 19:52 Peter Xu
2022-05-25 20:44 ` Mike Kravetz
2022-05-26 8:05 ` Muchun Song
0 siblings, 2 replies; 3+ messages in thread
From: Peter Xu @ 2022-05-25 19:52 UTC (permalink / raw)
To: linux-kernel, linux-mm; +Cc: Andrew Morton, peterx, Mike Kravetz
It seems to exist since the old times and never used once. Remove them.
Signed-off-by: Peter Xu <peterx@redhat.com>
---
arch/x86/mm/hugetlbpage.c | 39 ---------------------------------------
1 file changed, 39 deletions(-)
diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
index a0d023cb4292..509408da0da1 100644
--- a/arch/x86/mm/hugetlbpage.c
+++ b/arch/x86/mm/hugetlbpage.c
@@ -19,44 +19,6 @@
#include <asm/tlbflush.h>
#include <asm/elf.h>
-#if 0 /* This is just for testing */
-struct page *
-follow_huge_addr(struct mm_struct *mm, unsigned long address, int write)
-{
- unsigned long start = address;
- int length = 1;
- int nr;
- struct page *page;
- struct vm_area_struct *vma;
-
- vma = find_vma(mm, addr);
- if (!vma || !is_vm_hugetlb_page(vma))
- return ERR_PTR(-EINVAL);
-
- pte = huge_pte_offset(mm, address, vma_mmu_pagesize(vma));
-
- /* hugetlb should be locked, and hence, prefaulted */
- WARN_ON(!pte || pte_none(*pte));
-
- page = &pte_page(*pte)[vpfn % (HPAGE_SIZE/PAGE_SIZE)];
-
- WARN_ON(!PageHead(page));
-
- return page;
-}
-
-int pmd_huge(pmd_t pmd)
-{
- return 0;
-}
-
-int pud_huge(pud_t pud)
-{
- return 0;
-}
-
-#else
-
/*
* pmd_huge() returns 1 if @pmd is hugetlb related entry, that is normal
* hugetlb entry or non-present (migration or hwpoisoned) hugetlb entry.
@@ -72,7 +34,6 @@ int pud_huge(pud_t pud)
{
return !!(pud_val(pud) & _PAGE_PSE);
}
-#endif
#ifdef CONFIG_HUGETLB_PAGE
static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *file,
--
2.32.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/x86: Remove dead code for hugetlbpage.c
2022-05-25 19:52 [PATCH] mm/x86: Remove dead code for hugetlbpage.c Peter Xu
@ 2022-05-25 20:44 ` Mike Kravetz
2022-05-26 8:05 ` Muchun Song
1 sibling, 0 replies; 3+ messages in thread
From: Mike Kravetz @ 2022-05-25 20:44 UTC (permalink / raw)
To: Peter Xu, linux-kernel, linux-mm; +Cc: Andrew Morton
On 5/25/22 12:52, Peter Xu wrote:
> It seems to exist since the old times and never used once. Remove them.
Yes, and the code even assumes hugetlb pages are prefaulted. i.e. No
page fault support exists.
>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
> arch/x86/mm/hugetlbpage.c | 39 ---------------------------------------
> 1 file changed, 39 deletions(-)
Acked-by: Mike Kravetz <mike.kravetz@oracle.com>
--
Mike Kravetz
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/x86: Remove dead code for hugetlbpage.c
2022-05-25 19:52 [PATCH] mm/x86: Remove dead code for hugetlbpage.c Peter Xu
2022-05-25 20:44 ` Mike Kravetz
@ 2022-05-26 8:05 ` Muchun Song
1 sibling, 0 replies; 3+ messages in thread
From: Muchun Song @ 2022-05-26 8:05 UTC (permalink / raw)
To: Peter Xu; +Cc: linux-kernel, linux-mm, Andrew Morton, Mike Kravetz
On Wed, May 25, 2022 at 03:52:20PM -0400, Peter Xu wrote:
> It seems to exist since the old times and never used once. Remove them.
>
> Signed-off-by: Peter Xu <peterx@redhat.com>
Acked-by: Muchun Song <songmuchun@bytedance.com>
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-05-26 8:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-25 19:52 [PATCH] mm/x86: Remove dead code for hugetlbpage.c Peter Xu
2022-05-25 20:44 ` Mike Kravetz
2022-05-26 8:05 ` Muchun Song
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).