3 ms·
> Some of us disagree violently with that FAQ's discussion of the OOM killer and strict overcommit. Agreed. Android for example has made major architectural c
by ndesaulniers 10y ago
> Some of us disagree violently with that FAQ's discussion of the OOM killer and strict overcommit.
Agreed. Android for example has made major architectural changes due to not having swap. I wasn't around during the early days, and by no means an expert, but it looks to me like the following decisions were made:
1. No swapping, flash at the time was very slow, limited in capacity, and still has limited lifetime. Introduce OOM killer. [0]
2. SysV semaphores and shared memory can leak when killing a process. [1][2] It looks like these have since been added to bionic (Android's libc). [3]
3. Introduce The Binder kernel driver for IPC instead. The Binder handles reference counting, and can do neat things like death notifications. [4]
4. Introduce ashmem for shared memory. [5]
[0] https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/drivers/staging/android/lowmemorykiller.c?id=refs/tags/v4.8.1 https://git.kernel.org/cgit/linux/kernel/git/stable/linux-st... (extreamly readable at 212 LOC)
[1] See `man 7 sem_overview`'s and `man 7 shm_overview`'s Persistence sections.
[2] https://android.googlesource.com/platform/ndk/+/jb-release/docs/system/libc/SYSV-IPC.html https://android.googlesource.com/platform/ndk/+/jb-release/d...
[3] https://android.googlesource.com/platform/bionic/+/master/libc/include/semaphore.h https://android.googlesource.com/platform/bionic/+/master/li..., https://android.googlesource.com/platform/bionic/+/master/libc/include/sys/sem.h https://android.googlesource.com/platform/bionic/+/master/li...
[3] https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/drivers/android/binder.c?id=refs/tags/v4.8.1 https://git.kernel.org/cgit/linux/kernel/git/stable/linux-st...
[4] https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/drivers/staging/android/ashmem.c?id=refs/tags/v4.8.1 https://git.kernel.org/cgit/linux/kernel/git/stable/linux-st...