High memory (user space) and highmem (kernel space)











up vote
3
down vote

favorite












Each process has 2 memory area: User space (high memory) and kernel space (low memmory). In the kernel space, are the first 896 MB used for mapping kernel code (not fully 1 GB)? This means, when a user -space application performs a system call or anything related to the kernel, the kernel will refer to kernel space for the system call to execute, is it?



The reserved 128MB in kernel space (for high memory (user space) access), is it all the references of user-space memory area? So, a kernel process can access any user space by refer to this area, is this true?



That's why this area is called highmem in kernel space, isn't it?










share|improve this question


























    up vote
    3
    down vote

    favorite












    Each process has 2 memory area: User space (high memory) and kernel space (low memmory). In the kernel space, are the first 896 MB used for mapping kernel code (not fully 1 GB)? This means, when a user -space application performs a system call or anything related to the kernel, the kernel will refer to kernel space for the system call to execute, is it?



    The reserved 128MB in kernel space (for high memory (user space) access), is it all the references of user-space memory area? So, a kernel process can access any user space by refer to this area, is this true?



    That's why this area is called highmem in kernel space, isn't it?










    share|improve this question
























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      Each process has 2 memory area: User space (high memory) and kernel space (low memmory). In the kernel space, are the first 896 MB used for mapping kernel code (not fully 1 GB)? This means, when a user -space application performs a system call or anything related to the kernel, the kernel will refer to kernel space for the system call to execute, is it?



      The reserved 128MB in kernel space (for high memory (user space) access), is it all the references of user-space memory area? So, a kernel process can access any user space by refer to this area, is this true?



      That's why this area is called highmem in kernel space, isn't it?










      share|improve this question













      Each process has 2 memory area: User space (high memory) and kernel space (low memmory). In the kernel space, are the first 896 MB used for mapping kernel code (not fully 1 GB)? This means, when a user -space application performs a system call or anything related to the kernel, the kernel will refer to kernel space for the system call to execute, is it?



      The reserved 128MB in kernel space (for high memory (user space) access), is it all the references of user-space memory area? So, a kernel process can access any user space by refer to this area, is this true?



      That's why this area is called highmem in kernel space, isn't it?







      linux kernel memory






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 2 '12 at 4:50









      Amumu

      273412




      273412






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          5
          down vote



          accepted










          "High memory" and "low memory" do not apply to the virtual address space of processes, it's about physical memory instead.



          In the process' virtual address space, the user space occupies the first 3GB, and the kernel space the fourth GB of this linear address space.



          The first 896MB of the kernel space (not only kernel code, but its data also) is "directly" mapped to the first 896 MB of the physical memory. It is "direct" in the sense that there's always an offset of 0xc0000000 between any linear address of this 896MB part of the virtual kernel space and its corresponding address in physical memory (note however that the MMU is enabled and that page table entries are actually used for this).



          The last 128MB part of the virtual kernel space is where are mapped some pieces of the physical "high memory" (> 896MB) : thus it can only map no more than 128MB of "high memory" at a time.



          Reference: "Understanding the Linux Kernel", third edition - sections "8.1.3. Memory Zones" and "8.1.6. Kernel Mappings of High-Memory Page Frames".






          share|improve this answer




























            up vote
            1
            down vote













            High and Low Memory :





            • Low memory : Memory for which logical addresses exist in kernel space. On almost every system you will likely encounter, all memory is low memory.


            • High memory : Memory for which logical addresses do not exist, because it is beyond the address range set aside for kernel virtual addresses.This means the kernel needs to start using temporary mappings of the pieces of physical memory that it wants to access.


            Kernel splits virtual address into two part user address space and kernel address space. The kernel’s code and data structures must fit into that space, but the biggest consumer of kernel address space is virtual mappings for physical memory. Thus kernel needs its own virtual address for any memory it must touch directly. So, the maximum amount of physical memory that could be handled by the kernel was the amount that could be mapped into the kernel’s portion of the virtual address space, minus the space used by kernel code.



            enter image description here






            share|improve this answer





















            • I see you're adding content to this old question. It would be nice if we had something on this question, to point out that it is (and arguably always was!) obsolescent. I.e. 32-bit Linux is generally not used on PCs anymore, and 64-bit Linux does not split physical memory into highmem / lowmem (and obviously the 3GB/1GB user/kernel split doesn't apply either, both virtual areas are significantly larger).
              – sourcejedi
              Nov 25 at 10:21













            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f42095%2fhigh-memory-user-space-and-highmem-kernel-space%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            5
            down vote



            accepted










            "High memory" and "low memory" do not apply to the virtual address space of processes, it's about physical memory instead.



            In the process' virtual address space, the user space occupies the first 3GB, and the kernel space the fourth GB of this linear address space.



            The first 896MB of the kernel space (not only kernel code, but its data also) is "directly" mapped to the first 896 MB of the physical memory. It is "direct" in the sense that there's always an offset of 0xc0000000 between any linear address of this 896MB part of the virtual kernel space and its corresponding address in physical memory (note however that the MMU is enabled and that page table entries are actually used for this).



            The last 128MB part of the virtual kernel space is where are mapped some pieces of the physical "high memory" (> 896MB) : thus it can only map no more than 128MB of "high memory" at a time.



            Reference: "Understanding the Linux Kernel", third edition - sections "8.1.3. Memory Zones" and "8.1.6. Kernel Mappings of High-Memory Page Frames".






            share|improve this answer

























              up vote
              5
              down vote



              accepted










              "High memory" and "low memory" do not apply to the virtual address space of processes, it's about physical memory instead.



              In the process' virtual address space, the user space occupies the first 3GB, and the kernel space the fourth GB of this linear address space.



              The first 896MB of the kernel space (not only kernel code, but its data also) is "directly" mapped to the first 896 MB of the physical memory. It is "direct" in the sense that there's always an offset of 0xc0000000 between any linear address of this 896MB part of the virtual kernel space and its corresponding address in physical memory (note however that the MMU is enabled and that page table entries are actually used for this).



              The last 128MB part of the virtual kernel space is where are mapped some pieces of the physical "high memory" (> 896MB) : thus it can only map no more than 128MB of "high memory" at a time.



              Reference: "Understanding the Linux Kernel", third edition - sections "8.1.3. Memory Zones" and "8.1.6. Kernel Mappings of High-Memory Page Frames".






              share|improve this answer























                up vote
                5
                down vote



                accepted







                up vote
                5
                down vote



                accepted






                "High memory" and "low memory" do not apply to the virtual address space of processes, it's about physical memory instead.



                In the process' virtual address space, the user space occupies the first 3GB, and the kernel space the fourth GB of this linear address space.



                The first 896MB of the kernel space (not only kernel code, but its data also) is "directly" mapped to the first 896 MB of the physical memory. It is "direct" in the sense that there's always an offset of 0xc0000000 between any linear address of this 896MB part of the virtual kernel space and its corresponding address in physical memory (note however that the MMU is enabled and that page table entries are actually used for this).



                The last 128MB part of the virtual kernel space is where are mapped some pieces of the physical "high memory" (> 896MB) : thus it can only map no more than 128MB of "high memory" at a time.



                Reference: "Understanding the Linux Kernel", third edition - sections "8.1.3. Memory Zones" and "8.1.6. Kernel Mappings of High-Memory Page Frames".






                share|improve this answer












                "High memory" and "low memory" do not apply to the virtual address space of processes, it's about physical memory instead.



                In the process' virtual address space, the user space occupies the first 3GB, and the kernel space the fourth GB of this linear address space.



                The first 896MB of the kernel space (not only kernel code, but its data also) is "directly" mapped to the first 896 MB of the physical memory. It is "direct" in the sense that there's always an offset of 0xc0000000 between any linear address of this 896MB part of the virtual kernel space and its corresponding address in physical memory (note however that the MMU is enabled and that page table entries are actually used for this).



                The last 128MB part of the virtual kernel space is where are mapped some pieces of the physical "high memory" (> 896MB) : thus it can only map no more than 128MB of "high memory" at a time.



                Reference: "Understanding the Linux Kernel", third edition - sections "8.1.3. Memory Zones" and "8.1.6. Kernel Mappings of High-Memory Page Frames".







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Oct 18 '12 at 11:46









                telenn

                9115




                9115
























                    up vote
                    1
                    down vote













                    High and Low Memory :





                    • Low memory : Memory for which logical addresses exist in kernel space. On almost every system you will likely encounter, all memory is low memory.


                    • High memory : Memory for which logical addresses do not exist, because it is beyond the address range set aside for kernel virtual addresses.This means the kernel needs to start using temporary mappings of the pieces of physical memory that it wants to access.


                    Kernel splits virtual address into two part user address space and kernel address space. The kernel’s code and data structures must fit into that space, but the biggest consumer of kernel address space is virtual mappings for physical memory. Thus kernel needs its own virtual address for any memory it must touch directly. So, the maximum amount of physical memory that could be handled by the kernel was the amount that could be mapped into the kernel’s portion of the virtual address space, minus the space used by kernel code.



                    enter image description here






                    share|improve this answer





















                    • I see you're adding content to this old question. It would be nice if we had something on this question, to point out that it is (and arguably always was!) obsolescent. I.e. 32-bit Linux is generally not used on PCs anymore, and 64-bit Linux does not split physical memory into highmem / lowmem (and obviously the 3GB/1GB user/kernel split doesn't apply either, both virtual areas are significantly larger).
                      – sourcejedi
                      Nov 25 at 10:21

















                    up vote
                    1
                    down vote













                    High and Low Memory :





                    • Low memory : Memory for which logical addresses exist in kernel space. On almost every system you will likely encounter, all memory is low memory.


                    • High memory : Memory for which logical addresses do not exist, because it is beyond the address range set aside for kernel virtual addresses.This means the kernel needs to start using temporary mappings of the pieces of physical memory that it wants to access.


                    Kernel splits virtual address into two part user address space and kernel address space. The kernel’s code and data structures must fit into that space, but the biggest consumer of kernel address space is virtual mappings for physical memory. Thus kernel needs its own virtual address for any memory it must touch directly. So, the maximum amount of physical memory that could be handled by the kernel was the amount that could be mapped into the kernel’s portion of the virtual address space, minus the space used by kernel code.



                    enter image description here






                    share|improve this answer





















                    • I see you're adding content to this old question. It would be nice if we had something on this question, to point out that it is (and arguably always was!) obsolescent. I.e. 32-bit Linux is generally not used on PCs anymore, and 64-bit Linux does not split physical memory into highmem / lowmem (and obviously the 3GB/1GB user/kernel split doesn't apply either, both virtual areas are significantly larger).
                      – sourcejedi
                      Nov 25 at 10:21















                    up vote
                    1
                    down vote










                    up vote
                    1
                    down vote









                    High and Low Memory :





                    • Low memory : Memory for which logical addresses exist in kernel space. On almost every system you will likely encounter, all memory is low memory.


                    • High memory : Memory for which logical addresses do not exist, because it is beyond the address range set aside for kernel virtual addresses.This means the kernel needs to start using temporary mappings of the pieces of physical memory that it wants to access.


                    Kernel splits virtual address into two part user address space and kernel address space. The kernel’s code and data structures must fit into that space, but the biggest consumer of kernel address space is virtual mappings for physical memory. Thus kernel needs its own virtual address for any memory it must touch directly. So, the maximum amount of physical memory that could be handled by the kernel was the amount that could be mapped into the kernel’s portion of the virtual address space, minus the space used by kernel code.



                    enter image description here






                    share|improve this answer












                    High and Low Memory :





                    • Low memory : Memory for which logical addresses exist in kernel space. On almost every system you will likely encounter, all memory is low memory.


                    • High memory : Memory for which logical addresses do not exist, because it is beyond the address range set aside for kernel virtual addresses.This means the kernel needs to start using temporary mappings of the pieces of physical memory that it wants to access.


                    Kernel splits virtual address into two part user address space and kernel address space. The kernel’s code and data structures must fit into that space, but the biggest consumer of kernel address space is virtual mappings for physical memory. Thus kernel needs its own virtual address for any memory it must touch directly. So, the maximum amount of physical memory that could be handled by the kernel was the amount that could be mapped into the kernel’s portion of the virtual address space, minus the space used by kernel code.



                    enter image description here







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 25 at 9:35









                    finn

                    1613




                    1613












                    • I see you're adding content to this old question. It would be nice if we had something on this question, to point out that it is (and arguably always was!) obsolescent. I.e. 32-bit Linux is generally not used on PCs anymore, and 64-bit Linux does not split physical memory into highmem / lowmem (and obviously the 3GB/1GB user/kernel split doesn't apply either, both virtual areas are significantly larger).
                      – sourcejedi
                      Nov 25 at 10:21




















                    • I see you're adding content to this old question. It would be nice if we had something on this question, to point out that it is (and arguably always was!) obsolescent. I.e. 32-bit Linux is generally not used on PCs anymore, and 64-bit Linux does not split physical memory into highmem / lowmem (and obviously the 3GB/1GB user/kernel split doesn't apply either, both virtual areas are significantly larger).
                      – sourcejedi
                      Nov 25 at 10:21


















                    I see you're adding content to this old question. It would be nice if we had something on this question, to point out that it is (and arguably always was!) obsolescent. I.e. 32-bit Linux is generally not used on PCs anymore, and 64-bit Linux does not split physical memory into highmem / lowmem (and obviously the 3GB/1GB user/kernel split doesn't apply either, both virtual areas are significantly larger).
                    – sourcejedi
                    Nov 25 at 10:21






                    I see you're adding content to this old question. It would be nice if we had something on this question, to point out that it is (and arguably always was!) obsolescent. I.e. 32-bit Linux is generally not used on PCs anymore, and 64-bit Linux does not split physical memory into highmem / lowmem (and obviously the 3GB/1GB user/kernel split doesn't apply either, both virtual areas are significantly larger).
                    – sourcejedi
                    Nov 25 at 10:21




















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f42095%2fhigh-memory-user-space-and-highmem-kernel-space%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    List directoties down one level, excluding some named directories and files

                    list processes belonging to a network namespace

                    list systemd RuntimeDirectory mounts