环境
Red Hat Enterprise Linux 5
Red Hat Enterprise Linux 6
Red Hat Enterprise Linux 7
问题
What is HugePage size in RHEL for s390x architecture and if it can be changed?
决议
HugePage size in Red Hat Enterprise Linux 5 for s390x architecture is 2 megabytes.
HugePage size in Red Hat Enterprise Linux 6 for s390x architecture is 1 megabyte.
HugePage size in Red Hat Enterprise Linux 7 for s390x architecture is 1 megabyte.
There is no possibility to change HugePage size in RHEL with s390x architecture.
根源
HugePage size is hardcoded in the source code of the kernel, so it cannot be changed without modifying the kernel source code and recompilation.
诊断步骤
- Check HugePage size in /proc/meminfo file:
Raw
$ cat /proc/meminfo ...skip... Hugepagesize: 1024 kB
- For s390x architecture, the hugepage size is already defined in the kernel code itself:
- RHEL 7:
Raw
arch/s390/include/asm/page.h: #define HPAGE_SHIFT 20 #define HPAGE_SIZE (1UL << HPAGE_SHIFT) #define HPAGE_MASK (~(HPAGE_SIZE - 1)) #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) #define HUGE_MAX_HSTATE 2
- RHEL 6:
Raw
arch/s390/include/asm/page.h: #define HPAGE_SHIFT 20 #define HPAGE_SIZE (1UL << HPAGE_SHIFT) #define HPAGE_MASK (~(HPAGE_SIZE - 1)) #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
- RHEL 5:
Raw
include/asm-s390/page.h:#define HPAGE_SHIFT 21 #define HPAGE_SIZE (1UL << HPAGE_SHIFT) #define HPAGE_MASK (~(HPAGE_SIZE - 1)) #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)