-1

On x86, the solution would be either PAE, but yet better is to use a 32-bit system with a 64-bit kernel.

The physical memory of the planned 32-bit ARM system is only 3GB. I would like to increase it, possibly even above 4GB, by using swap file.

While the physical memory remains 32 bit addressable, I believe, OS still need to somehow handle the current pages on the swap, what might be non-trivial if the total amount of memory is not 32-bit addressable.

For example, I think, maybe two processes can not always map the same memory page, and similar problems might arise. However, I can not see it really impossible.

Is it possible on a 32-bit ARM Linux kernel?

11
  • 1
    It should be possible, but obviously the 32 bit limitation does not only apply to physical address space, but also to virtual address space. Commented Nov 19 at 10:47
  • @SimonRichter Maybe you have missed the very important fact that the 32-bit limitation == 4GB. Commented Nov 19 at 12:30
  • 1
    @peterh no I don't think Simon did miss that. Suffice to say that the 32-bit = 4GB exists in the size of address. There is no hardware limitation on addressing data on disk as such. If zettabytes disks existed, the IO for that drive would support sufficient address space and drivers could be written to address them. 32 bit systems can read/write TB disks. The limitation only exists for virtual address space where the translation from virtual to physical address (in RAM not swap) happens inside the CPU silicon and therefore there is a very hard limit on the size of virtual address space. Commented Nov 19 at 16:02
  • @PhilipCouling You are argumenting for that it is possible. That it is possible, I admitted already in the question, which asks for it that was done. The question was not that it is possible, but that is it done. Beside that, hardware (MMU) page tables often use their own (cpu-provided) data structure to register, where a not available page resides, in practice that is a bit field to show where is it on the swap. The OS might use this functionality or not. If the OS uses it and it does not support >4GB virtual address space, then that is over. Commented Nov 19 at 16:38
  • the equivalent to x86 PAE on ARM32 is LPAE Commented Nov 19 at 17:15

1 Answer 1

4

Yes, it is possible — the address space limitation applies to the kernel and to individual processes, but each process has its own address space. It is therefore possible to swap out more than the address space.

Here’s the output from free on a stressed-out armhf system I have handy:

 total used free shared buff/cache available Mem: 2058368 2000020 42836 32 15512 22396 Swap: 3905532 2486720 1418812 

The total used memory and swap is greater than 4GiB, out of 6GiB approximately.

See How does the kernel address swapped memory pages on swap partition or swap file? for details on how the kernel tracks swapped-out memory.

1
  • I think you might create a buy-me-a-caffee page Commented Nov 19 at 14:13

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.