aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorGravatar Ilya Dryomov <idryomov@gmail.com> 2019-08-30 20:44:24 +0200
committerGravatar Ilya Dryomov <idryomov@gmail.com> 2019-09-16 12:06:25 +0200
commit10c12851a022662bf6085bd4384b4ebed4c447ce (patch)
tree609a2973a0bbbd33afc073e6a122ddec858efe3f /kernel
parentceph: allow object copies across different filesystems in the same cluster (diff)
downloadlinux-10c12851a022662bf6085bd4384b4ebed4c447ce.tar.gz
linux-10c12851a022662bf6085bd4384b4ebed4c447ce.tar.bz2
linux-10c12851a022662bf6085bd4384b4ebed4c447ce.zip
libceph: avoid a __vmalloc() deadlock in ceph_kvmalloc()
The vmalloc allocator doesn't fully respect the specified gfp mask: while the actual pages are allocated as requested, the page table pages are always allocated with GFP_KERNEL. ceph_kvmalloc() may be called with GFP_NOFS and GFP_NOIO (for ceph and rbd respectively), so this may result in a deadlock. There is no real reason for the current PAGE_ALLOC_COSTLY_ORDER logic, it's just something that seemed sensible at the time (ceph_kvmalloc() predates kvmalloc()). kvmalloc() is smarter: in an attempt to reduce long term fragmentation, it first tries to kmalloc non-disruptively. Switch to kvmalloc() and set the respective PF_MEMALLOC_* flag using the scope API to avoid the deadlock. Note that kvmalloc() needs to be passed GFP_KERNEL to enable the fallback. Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Jeff Layton <jlayton@kernel.org>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions