Thread (14 messages) 14 messages, 7 authors, 2021-02-18

Re: [RFC PATCH] mm, oom: introduce vm.sacrifice_hugepage_on_oom

flat view

From: David Hildenbrand <hidden>
Date: 2021-02-17 09:11:50
Also in: linux-fsdevel, linux-mm, lkml

On 16.02.21 04:07, Eiichi Tsukata wrote:
Hugepages can be preallocated to avoid unpredictable allocation latency.
If we run into 4k page shortage, the kernel can trigger OOM even though
there were free hugepages. When OOM is triggered by user address page
fault handler, we can use oom notifier to free hugepages in user space
but if it's triggered by memory allocation for kernel, there is no way
to synchronously handle it in user space.

This patch introduces a new sysctl vm.sacrifice_hugepage_on_oom. If
enabled, it first tries to free a hugepage if available before invoking
the oom-killer. The default value is disabled not to change the current
behavior.
In addition to the other comments, some more thoughts:

What if you're low on kernel memory but you end up freeing huge pages residing in ZONE_MOVABLE? IOW, this is not zone aware.

-- 
Thanks,

David / dhildenb
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help