diff options
author | Dave Chinner <dchinner@redhat.com> | 2018-03-06 17:03:28 -0800 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-03-11 20:27:55 -0700 |
commit | cb0a8d23024e7bd234dea4d0fc5c4902a8dda766 (patch) | |
tree | 350326308ff764800517d26319de97f6814a6e7c /fs/xfs/xfs_log_cil.c | |
parent | 0c8efd610b58cb23cefdfa12015799079aef94ae (diff) | |
download | linux-cb0a8d23024e7bd234dea4d0fc5c4902a8dda766.tar.bz2 |
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>
Diffstat (limited to 'fs/xfs/xfs_log_cil.c')
-rw-r--r-- | fs/xfs/xfs_log_cil.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/xfs_log_cil.c b/fs/xfs/xfs_log_cil.c index 43aa42a3a5d3..cb376ac8a595 100644 --- a/fs/xfs/xfs_log_cil.c +++ b/fs/xfs/xfs_log_cil.c @@ -202,7 +202,7 @@ xlog_cil_alloc_shadow_bufs( */ kmem_free(lip->li_lv_shadow); - lv = kmem_alloc(buf_size, KM_SLEEP|KM_NOFS); + lv = kmem_alloc_large(buf_size, KM_SLEEP | KM_NOFS); memset(lv, 0, xlog_cil_iovec_space(niovecs)); lv->lv_item = lip; |