arch/s390/mm/hugetlbpage.c
Source file repositories/reference/linux-study-clean/arch/s390/mm/hugetlbpage.c
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/mm/hugetlbpage.c- Extension
.c- Size
- 7448 bytes
- Lines
- 242
- Domain
- Architecture Layer
- Bucket
- arch/s390
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/cpufeature.hlinux/mm.hlinux/hugetlb.hlinux/mman.hlinux/sched/mm.hlinux/security.hasm/pgalloc.h
Detected Declarations
function Authorfunction __rste_to_ptefunction __set_huge_pte_atfunction set_huge_pte_atfunction huge_ptep_getfunction __huge_ptep_get_and_clearfunction arch_hugetlb_valid_sizefunction arch_hugetlb_cma_order
Annotated Snippet
if (pudp) {
if (sz == PUD_SIZE)
return (pte_t *) pudp;
else if (sz == PMD_SIZE)
pmdp = pmd_alloc(mm, pudp, addr);
}
}
return (pte_t *) pmdp;
}
pte_t *huge_pte_offset(struct mm_struct *mm,
unsigned long addr, unsigned long sz)
{
pgd_t *pgdp;
p4d_t *p4dp;
pud_t *pudp;
pmd_t *pmdp = NULL;
pgdp = pgd_offset(mm, addr);
if (pgd_present(pgdp_get(pgdp))) {
p4dp = p4d_offset(pgdp, addr);
if (p4d_present(p4dp_get(p4dp))) {
pudp = pud_offset(p4dp, addr);
if (sz == PUD_SIZE)
return (pte_t *)pudp;
if (pud_present(pudp_get(pudp)))
pmdp = pmd_offset(pudp, addr);
}
}
return (pte_t *) pmdp;
}
bool __init arch_hugetlb_valid_size(unsigned long size)
{
if (cpu_has_edat1() && size == PMD_SIZE)
return true;
else if (cpu_has_edat2() && size == PUD_SIZE)
return true;
else
return false;
}
unsigned int __init arch_hugetlb_cma_order(void)
{
if (cpu_has_edat2())
return PUD_SHIFT - PAGE_SHIFT;
return 0;
}
Annotation
- Immediate include surface: `linux/cpufeature.h`, `linux/mm.h`, `linux/hugetlb.h`, `linux/mman.h`, `linux/sched/mm.h`, `linux/security.h`, `asm/pgalloc.h`.
- Detected declarations: `function Author`, `function __rste_to_pte`, `function __set_huge_pte_at`, `function set_huge_pte_at`, `function huge_ptep_get`, `function __huge_ptep_get_and_clear`, `function arch_hugetlb_valid_size`, `function arch_hugetlb_cma_order`.
- Atlas domain: Architecture Layer / arch/s390.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.