ReverseFlowControl
ReverseFlowControl

Reputation: 826

Does Linux support 2MB pages at compile time?

I know processors these days, some of them, support 2MB and 1GB page sizes. Is it possible to compile the Linux kernel to natively support 2MB as opposed to the standard 4Kb page?

Thanks.

Upvotes: 4

Views: 1173

Answers (1)

nzoueidi
nzoueidi

Reputation: 71

Well, I can say yes and no.

The page size is fixed. But that depend on your patience to the erros and issues that you will encounter.

The page size is known and determined by the MMU hardware, so the operating system is taking that into account. However, notice that some Linux systems (and hardware!) have hugetlbpage and Linux mmap(2) might accept MAP_HUGETLB (but your code should handle the case of processors or kernels without huge page support, e.g. by calling mmap again without MAP_HUGETLB when the first mmap with MAP_HUGETLB has failed).

You may find these links interested for you:

Upvotes: 1

Related Questions