[Devel] [PATCH rh7 1/2] memcg: never fail kmem allocations

Cyrill Gorcunov gorcunov at virtuozzo.com
Fri Jan 22 06:04:43 PST 2016


On Fri, Jan 22, 2016 at 02:47:20PM +0300, Vladimir Davydov wrote:
> It is too dangerous to fail kmem allocations. E.g. there are lots of
> places where the caller just can't tolerate a failure and keep looping
> until kmalloc keeps failing. If kmalloc lacks __GFP_FS, which is common,
> it might loop forever. Another reason why it's dangerous to fail kmalloc
> is that it might result in unpredictable failures of userspace programs:
> no-one expects a system call to fail to ENOMEM to handle this gracefully
> - a program typically just abort if this happens.
> 
> Note, always letting kmalloc go doesn't mean that a container may breach
> its limit - sooner or later it will issue a userspace allocation, which
> will restore the justice. Besides, kmalloc will still run page reclaim
> or even OOM killer, provided the context allows, so this change should
> be safe.
> 
> Signed-off-by: Vladimir Davydov <vdavydov at virtuozzo.com>

Will this address

[ 1070.496158] SLUB: Unable to allocate memory on node -1 (gfp=0x200020)
[ 1070.497363]   cache: sigqueue(4:8b53f5c8-17d2-4ee4-b4c1-8d149b5902a5), object size: 168, buffer size: 168, default order: 0, min order: 0
[ 1070.499831]   node 0: slabs: 1, objs: 24, free: 0



More information about the Devel mailing list