]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
percpu: add __GFP_NORETRY semantics to the percpu balancing path
authorDennis Zhou <dennisszhou@gmail.com>
Fri, 16 Feb 2018 18:07:19 +0000 (12:07 -0600)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Mon, 9 Apr 2018 13:41:55 +0000 (10:41 -0300)
commit393e6d551a1f899d99d7816edd271392638721b8
tree12178d2d154d415bc835062c7de5f2c4155e0f97
parent08126c08394d0fee0dfa6a2bf66b5ded75aa7bfe
percpu: add __GFP_NORETRY semantics to the percpu balancing path

BugLink: http://bugs.launchpad.net/bugs/1762370
commit 47504ee04b9241548ae2c28be7d0b01cff3b7aa6 upstream.

Percpu memory using the vmalloc area based chunk allocator lazily
populates chunks by first requesting the full virtual address space
required for the chunk and subsequently adding pages as allocations come
through. To ensure atomic allocations can succeed, a workqueue item is
used to maintain a minimum number of empty pages. In certain scenarios,
such as reported in [1], it is possible that physical memory becomes
quite scarce which can result in either a rather long time spent trying
to find free pages or worse, a kernel panic.

This patch adds support for __GFP_NORETRY and __GFP_NOWARN passing them
through to the underlying allocators. This should prevent any
unnecessary panics potentially caused by the workqueue item. The passing
of gfp around is as additional flags rather than a full set of flags.
The next patch will change these to caller passed semantics.

V2:
Added const modifier to gfp flags in the balance path.
Removed an extra whitespace.

[1] https://lkml.org/lkml/2018/2/12/551

Signed-off-by: Dennis Zhou <dennisszhou@gmail.com>
Suggested-by: Daniel Borkmann <daniel@iogearbox.net>
Reported-by: syzbot+adb03f3f0bb57ce3acda@syzkaller.appspotmail.com
Acked-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
mm/percpu-km.c
mm/percpu-vm.c
mm/percpu.c