]> asedeno.scripts.mit.edu Git - linux.git/commit
xfs: fall back to vmalloc when allocation log vector buffers
authorDave Chinner <dchinner@redhat.com>
Wed, 7 Mar 2018 01:03:28 +0000 (17:03 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 12 Mar 2018 03:27:55 +0000 (20:27 -0700)
commitcb0a8d23024e7bd234dea4d0fc5c4902a8dda766
tree350326308ff764800517d26319de97f6814a6e7c
parent0c8efd610b58cb23cefdfa12015799079aef94ae
xfs: fall back to vmalloc when allocation log vector buffers

When using large directory blocks, we regularly see memory
allocations of >64k being made for the shadow log vector buffer.
When we are under memory pressure, kmalloc() may not be able to find
contiguous memory chunks large enough to satisfy these allocations
easily, and if memory is fragmented we can potentially stall here.

TO avoid this problem, switch the log vector buffer allocation to
use kmem_alloc_large(). This will allow failed allocations to fall
back to vmalloc and so remove the dependency on large contiguous
regions of memory being available. This should prevent slowdowns
and potential stalls when memory is low and/or fragmented.

Signed-Off-By: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/kmem.c
fs/xfs/kmem.h
fs/xfs/xfs_log_cil.c