Re: [PATCH 1/5] xfs: use per-filesystem I/O completion workqueues

Dave Chinner
2012-02-16T06:57:23Z

On Tue, Feb 07, 2012 at 01:10:38PM -0500, Christoph Hellwig wrote:
> The new concurrency managed workqueues are cheap enough that we can create
> per-filesystem instead of global workqueues. This allows us to remove the
> trylock or defer scheme on the ilock, which is not helpful once we have
> outstanding log reservations until finishing a size update.

Agreed.

And it removes some of the issues with dependencies between
filesystems like loopback mounted XFS-on-XFS filesystems, though to
fix them completely we also need per-filesystem log workqueues. Is
it worth just converting that one as well in this patch just to
remove all global work queues?

> Signed-off-by: Christoph Hellwig <hch@lst.de>

....
> +STATIC int
> +xfs_init_mount_workqueues(
> + struct xfs_mount *mp)
> +{
> +#define XFS_WQ_NAME_LEN 512
> + char name[XFS_WQ_NAME_LEN];
> +
> + snprintf(name, XFS_WQ_NAME_LEN, "xfs-data/%s", mp->m_fsname);
> + mp->m_data_workqueue = alloc_workqueue(name, WQ_MEM_RECLAIM, 1);
> + if (!mp->m_data_workqueue)
> + goto out;

As of b196be8 ("workqueue: make alloc_workqueue() take printf fmt and
args for name"), this dance is not necessary. somethign like:

mp->m_data_workqueue = alloc_workqueue(name, WQ_MEM_RECLAIM, 1,
"xfs-data/%s", mp->m_fsname);

will work just fine.

Also, I thin kwe want significant parallelism on this workqueue -
having an inode block on an ilock shoul dnot stop us from processing
other ioends in the same fs....

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com