RE: [PATCH 0/6 v3] kvmalloc
From: David Laight <hidden>
Date: 2017-01-26 09:49:04
Also in:
linux-mm, lkml
From: Daniel Borkmann
Sent: 26 January 2017 09:37
...
quoted
quoted
I assume that kvzalloc() is still the same from [1], right? If so, then it would unfortunately (partially) reintroduce the issue that was fixed. If you look above at flags, they're also passed to __vmalloc() to not trigger OOM in these situations I've experienced.Pushing __GFP_NORETRY to __vmalloc doesn't have the effect you might think it would. It can still trigger the OOM killer becauset the flags are no propagated all the way down to all allocations requests (e.g. page tables). This is the same reason why GFP_NOFS is not supported in vmalloc.Ok, good to know, is that somewhere clearly documented (like for the case with kmalloc())? If not, could we do that for non-mm folks, or at least add a similar WARN_ON_ONCE() as you did for kvmalloc() to make it obvious to users that a given flag combination is not supported all the way down?
ISTM that requests for the relatively small memory blocks needed for page tables aren't really likely to invoke the OOM killer when it isn't already being invoked by other actions. So that isn't really a problem. More of a problem is that requests that you really don't mind failing can use the last 'reasonably available' memory. This will cause the next allocate to fail when it would be better for the earlier one to fail instead. David -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>