From: Brian Foster <bfoster@redhat.com>
To: xfs@oss.sgi.com
Subject: [PATCH RFC v3 2/2] xfs: split metadata and log buffer completion to separate workqueues
Date: Thu, 13 Nov 2014 14:24:01 -0500 [thread overview]
Message-ID: <1415906641-43587-3-git-send-email-bfoster@redhat.com> (raw)
In-Reply-To: <1415906641-43587-1-git-send-email-bfoster@redhat.com>
XFS traditionally sends all buffer I/O completion work to a single
queue. This includes metadata buffer completion and log buffer
completion. The log buffer completion requires a high priority queue to
prevent stalls due to log forces getting stuck behind other queued work.
Rather than continue to prioritize all buffer I/O completion due to the
needs of log completion, split log buffer completion off to
m_log_workqueue and move the high priority flag from m_buf_workqueue to
m_log_workqueue.
[XXX: Use of XBF_SYNCIO is purely for demonstration. Define a new flag.]
Signed-off-by: Brian Foster <bfoster@redhat.com>
---
fs/xfs/xfs_buf.c | 9 ++++++++-
fs/xfs/xfs_super.c | 5 ++---
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index c06d790..58d729c 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1050,8 +1050,15 @@ void
xfs_buf_ioend_async(
struct xfs_buf *bp)
{
+ struct workqueue_struct *wq;
+
+ if (bp->b_flags & XBF_SYNCIO)
+ wq = bp->b_target->bt_mount->m_log_workqueue;
+ else
+ wq = bp->b_target->bt_mount->m_buf_workqueue;
+
INIT_WORK(&bp->b_iodone_work, xfs_buf_ioend_work);
- queue_work(bp->b_target->bt_mount->m_buf_workqueue, &bp->b_iodone_work);
+ queue_work(wq, &bp->b_iodone_work);
}
void
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 03e3cc2..4b8cd37 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -843,8 +843,7 @@ xfs_init_mount_workqueues(
struct xfs_mount *mp)
{
mp->m_buf_workqueue = alloc_workqueue("xfs-buf/%s",
- WQ_MEM_RECLAIM|WQ_HIGHPRI|WQ_FREEZABLE, 1,
- mp->m_fsname);
+ WQ_MEM_RECLAIM|WQ_FREEZABLE, 1, mp->m_fsname);
if (!mp->m_buf_workqueue)
goto out;
@@ -869,7 +868,7 @@ xfs_init_mount_workqueues(
goto out_destroy_cil;
mp->m_log_workqueue = alloc_workqueue("xfs-log/%s",
- WQ_FREEZABLE, 0, mp->m_fsname);
+ WQ_FREEZABLE|WQ_HIGHPRI, 0, mp->m_fsname);
if (!mp->m_log_workqueue)
goto out_destroy_reclaim;
--
1.8.3.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2014-11-13 19:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-13 19:23 [PATCH v3 0/2] xfs: split up xfslogd global workqueue Brian Foster
2014-11-13 19:24 ` [PATCH v3 1/2] xfs: replace global xfslogd wq with per-mount wq Brian Foster
2014-11-28 2:49 ` Dave Chinner
2014-11-13 19:24 ` Brian Foster [this message]
2014-11-28 2:48 ` [PATCH RFC v3 2/2] xfs: split metadata and log buffer completion to separate workqueues Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1415906641-43587-3-git-send-email-bfoster@redhat.com \
--to=bfoster@redhat.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox