OSDN Git Service

xfs: don't allow log IO to be throttled
authorDave Chinner <dchinner@redhat.com>
Wed, 25 Mar 2020 03:10:27 +0000 (20:10 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Fri, 27 Mar 2020 15:32:54 +0000 (08:32 -0700)
commit2def2845cc33390e39b51440508043e4981e10ee
treec21efa7382bc2babccf46205407b3fbeb8f473c6
parent0e7ab7efe77451cba4cbecb6c9f5ef83cf32b36b
xfs: don't allow log IO to be throttled

Running metadata intensive workloads, I've been seeing the AIL
pushing getting stuck on pinned buffers and triggering log forces.
The log force is taking a long time to run because the log IO is
getting throttled by wbt_wait() - the block layer writeback
throttle. It's being throttled because there is a huge amount of
metadata writeback going on which is filling the request queue.

IOWs, we have a priority inversion problem here.

Mark the log IO bios with REQ_IDLE so they don't get throttled
by the block layer writeback throttle. When we are forcing the CIL,
we are likely to need to to tens of log IOs, and they are issued as
fast as they can be build and IO completed. Hence REQ_IDLE is
appropriate - it's an indication that more IO will follow shortly.

And because we also set REQ_SYNC, the writeback throttle will now
treat log IO the same way it treats direct IO writes - it will not
throttle them at all. Hence we solve the priority inversion problem
caused by the writeback throttle being unable to distinguish between
high priority log IO and background metadata writeback.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Allison Collins <allison.henderson@oracle.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_log.c