How does the linux kernel manage less than 1GB physical memory?

后端 未结 5 1502
伪装坚强ぢ
伪装坚强ぢ 2020-12-12 09:50

I\'m learning the linux kernel internals and while reading \"Understanding Linux Kernel\", quite a few memory related questions struck me. One of them is, how the Linux kern

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-12 10:04

    -

    Hi, actually, I don't work on x86 hardware platform, so there may exist some technical errors in my post.

    To my knowledge, the range between 0(or 16)MB - 896MB is listed specially while you have more RAM than that number, say, you have 1GB physical RAM on your board, which is called "low-memory". If you have more physical RAM than 896MB on your board, then, rest of the physical RAM is called highmem.

    Speaking of your question, there are 512MiBytes physical RAM on your board, so actually, there is no 896, no highmem.

    The total RAM kernel can see and also can map is 512MB.

    'Cause there is 1-to-1 mapping between physical memory and kernel virtual address, so there is 512MiBytes virtual address space for kernel. I'm really not sure whether or not the prior sentence is right, but it's what in my mind.

    What I mean is if there is 512MBytes, then the amount of physical RAM the kernel can manage is also 512MiBytes, further, the kernel cannot create such big address space like beyond 512MBytes.

    Refer to user space, there is one different point, pages of user's application can be swapped out to harddisk, but pages of the kernel cannot.

    So, for user space, with the help of page tables and other related modules, it seems there is still 4GBytes address space. Of course, this is virtual address space, not physical RAM space.

    This is what I understand.

    Thanks.

提交回复
热议问题