linux - Changing memory page size -


i reading there,that number of virtual memory pages equal number of physical memory frames , size of frames , of pages equal,like 32bit system page size 4096.

well thinking there there way change page size or frame size?

i using linux os. have searched lot , found is,we can change page size or in fact can increase page size shifting huge pages.is there other way change (increase or decrease) or set page size of our choice?

(not coding anything,a general question)

in practice (nearly) impossible "change" memory page size, since page size known & determined mmu hardware, operating system taking account. however, notice some linux systems (and hardware!) have hugetlbpage , linux mmap(2) might accept map_hugetlb (but code should handle case of processors or kernels without huge page support, e.g. calling mmap again without map_hugetlb when first mmap map_hugetlb has failed).

from read, on some linux systems, can use hugetlbpage various sizes. sysadmin can restrict these (or kernels disable it), code should prepared mmap map_hugetlb fails.

even "huge pages", page size not arbitrary. use sysconf(_sc_page_size) on posix systems standard page size (it 4kbytes). see sysconf(3)

afaik, on systems hugetlbpage feature, mmap can called without map_hugetlb , page size (as reported sysconf(_sc_page_size)) still 4kbytes. perhaps recent kernels weird configurations using huge pages everywhere, , iirc kernels might configured 1mbyte page (i not sure , might wrong)...


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -