fruitoftheloom wrote: ↑
Wed Mar 01, 2017 6:56 am
knuxyl wrote:Are the Raspbian developers actively developing Raspbian 64-bit? The code is available for the 64-bit kernel, a couple of distros already use it like Devuan and SUSE.
AFAIAA there is no real benefit in developing a ARM64 Raspbian, do the RPF have the resources to support 2 distro's ??
CentOS & Fedora ARM64: viewtopic.php?f=51&t=151274
AFAIAA there is no real benefit in developing a ARM64 Raspbian,
... is wrong. The
feature of a 64-bit kernel is virtual memory.
If one has a SSD and a Linux 64-bit kernel it is possible to do:
Open a file - let us say it is 1023 GB in size - and memory map (mmap) it. Now, if a program access a page(=a 4 KB block of memory) of those 1023 GB that are in the virtual memory - backed by the file - the kernel does this:
If there is enough unused physical RAM it will use a page from there.
If there isn't enough free physical memory it does this:
- The kernel pages out (write to disk) the least used page.
- The kernel then write the requested page to the now free page in physical memory.
- The kernel makes a contex swith (from the kernel to the program), and then
- The MMU of the CPU repeats the machine code instruction that resulted in the page fault.
Virtual memory performance increases by 100% (by a factor of 2), if the pages are mmap'ed read-only. The reason is that the kernel knows that it doesn't need to write a page back to disk, because it can just reread the page again from disk
All this happen without the program knowing this had happened.
This is one of the purposes of virtual memory - run a program on top of an abstraction of memory.
In this example the Raspberry Pi has 1 TB (=1024 GB) of virtual memory, but as every one knows is has "only" 1 GB of physical memory.
If the program, fx a web server - that had mmap'ed a file - and has a very low amount of connections it can actually host a 1 TB file in (virtual) memory. It is, however, more likely that it has lazy mmap'ed many files read-only.
Too many people think about memory as of the computers in the 1970s/1980s - that a program allocates physical memory - it doesn't - It lives in virtual memory, and no where else.
The kernel make decisions about when, and how much a program would use of:
- physical memory,
- anonymous swap (swap files and/or swap partitions)
- and in this example virtual memory that are backed by a file
- This can be boiled down to that the kernel decides everything regarding memory for very program.
Memory that are backed by a file (non-anonymous swap) has preference over anonymous swap.