Skip to content

Commit 04940c9

Browse files
committed
Merge: hugetlb updates for fadump
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6139 Description: hugetlb updates for fadump JIRA: https://issues.redhat.com/browse/RHEL-73488 Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=66350288 Tested: Verified Brew build test kernel RPMs Signed-off-by: Mamatha Inamdar <minamdar@redhat.com> commit d629d7a Author: Sourabh Jain <sourabhjain@linux.ibm.com> Date: Tue Dec 17 13:16:40 2024 +0530 powerpc/book3s64/hugetlb: Fix disabling hugetlb when fadump is active Commit 8597538 ("powerpc/fadump: Do not use hugepages when fadump is active") disabled hugetlb support when fadump is active by returning early from hugetlbpage_init():arch/powerpc/mm/hugetlbpage.c and not populating hpage_shift/HPAGE_SHIFT. Later, commit 2354ad2 ("powerpc/mm: Update default hugetlb size early") moved the allocation of hpage_shift/HPAGE_SHIFT to early boot, which inadvertently re-enabled hugetlb support when fadump is active. Fix this by implementing hugepages_supported() on powerpc. This ensures that disabling hugetlb for the fadump kernel is independent of hpage_shift/HPAGE_SHIFT. Fixes: 2354ad2 ("powerpc/mm: Update default hugetlb size early") Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20241217074640.1064510-1-sourabhjain@linux.ibm.com Signed-off-by: Mamatha Inamdar <minamdar@redhat.com> Approved-by: Steve Best <sbest@redhat.com> Approved-by: Tony Camuso <tcamuso@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Rado Vrbovsky <rvrbovsk@redhat.com>
2 parents f1536c3 + bee365e commit 04940c9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

arch/powerpc/include/asm/hugetlb.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@
1515

1616
extern bool hugetlb_disabled;
1717

18+
static inline bool hugepages_supported(void)
19+
{
20+
if (hugetlb_disabled)
21+
return false;
22+
23+
return HPAGE_SHIFT != 0;
24+
}
25+
#define hugepages_supported hugepages_supported
26+
1827
void __init hugetlbpage_init_defaultsize(void);
1928

2029
int slice_is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,

0 commit comments

Comments
 (0)