2

Does Kernel logical address go through MMU when used in load/store instruction? Does MMU handle kernel logical address differently from kernel virtual address? Please give reasons for the same.

If MMU handles both kind of addresses similarly, then what is the advantage of kernel logical address ?

What is the advantage of dividing memory into High and Low memory?

0

Load/store instructions can only address virtual memory. They all go through the MMU. The MMU always translates addresses using the current page table.

Linux only divides memory into "Low" and "High" on 32-bit CPUs. A 32-bit virtual address identifies one of 4GB different locations. In order to access more than 4GB of different physical memory locations, we must use temporary virtual mappings.

Look at the official document: linux-5.0/Documentation/vm/highmem.rst

The general recommendation is that you don't use more than 8GiB on a 32-bit machine - although more might work for you and your workload, you're pretty much on your own - don't expect kernel developers to really care much if things come apart.

Aside: "kernel logical address" means a type of virtual address which points inside the permanent mapping of low memory. This term was used by a specific Linux book. It is not used outside the context of that book.

Question: What is the "advantage" of permanently mapping a very large area of physical memory, i.e. "low memory"?

Answer: It means most Linux kernel code can avoid the extra complexity and performance overhead of dealing with "high memory". I.e. the need to create temporary mappings. This is particularly important considering that high memory is only relevant to the obsolescent 32-bit CPU.

Most kernel code can allocate inside low memory. Most kernel code doesn't need a large amount of RAM. The exception is that Linux allows the page cache to be allocated in high memory. So kernel code which touches page cache is required to be aware of this.

Even socket (network) buffers do not support highmem. Example: https://www.airship.com/blog/linux-kernel-tuning-for-c500k/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.