Re: [PATCH 18/20] xfs: remove unused buffer cache APIs

Dave Chinner
2019-06-04T06:24:47Z

On Mon, Jun 03, 2019 at 07:29:43PM +0200, Christoph Hellwig wrote:
> Now that the log code uses bios directly we can drop various special
> cases in the buffer cache code.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> fs/xfs/xfs_buf.c | 83 ++----------------------------------------------
> fs/xfs/xfs_buf.h | 27 ----------------
> 2 files changed, 2 insertions(+), 108 deletions(-)

That's a nice result. One minor thing:

> @@ -1258,7 +1192,7 @@ xfs_buf_ioend_async(
> struct xfs_buf *bp)
> {
> INIT_WORK(&bp->b_ioend_work, xfs_buf_ioend_work);
> - queue_work(bp->b_ioend_wq, &bp->b_ioend_work);
> + queue_work(bp->b_target->bt_mount->m_buf_workqueue, &bp->b_ioend_work);
> }

It'd be nice to keep bp->b_ioend_wq to avoid pointer chasing here.
Perhaps we could set it up in _xfs_buf_alloc() where we are pretty
much guaranteed to have the xfs_mount hot in cache, and then it's
set for the life of the buffer. Just a thought, but either way:

Reviewed-by: Dave Chinner <dchinner@redhat.com>

--
Dave Chinner
david@fromorbit.com