Skip to contentSkip to conversation

xfs: log IO completion workqueue is a high priority queue

PATCH In review Dave Chinner 2 participants 2 messages Sep 8, 2010 – Sep 9, 2010 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: log IO completion workqueue is a high priority queue

From: Dave Chinner <[email protected]>

The workqueue implementation in 2.6.36-rcX has changed, resulting in the workqueues no longer having dedicated threads for work processing. This has caused severe livelocks under heavy parallel create workloads because the log IO completions have been getting held up behind metadata IO completions. Hence log commits would stall, memory allocation would stall because pages could not be cleaned, and lock contention on the AIL during inode IO completion processing was being seen to slow everything down even further.

By making the log Io completion workqueue a high priority workqueue, they are queued ahead of all data/metadata IO completions and processed before the data/metadata completions. Hence the log never gets stalled, and operations needed to clean memory can continue as quickly as possible. This avoids the livelock conditions and allos the system to keep running under heavy load as per normal.

---
 fs/xfs/linux-2.6/xfs_buf.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
fs/xfs/linux-2.6/xfs_buf.c +2 -1
index 6130828..2a6645f 100644
@@ -1956,7 +1956,8 @@ xfs_buf_init(void)
 	if (!xfs_buf_zone)
 		goto out;
 
-	xfslogd_workqueue = create_workqueue("xfslogd");
+	xfslogd_workqueue = alloc_workqueue("xfslogd",
+					WQ_RESCUER | WQ_HIGHPRI, 1);
 	if (!xfslogd_workqueue)
 		goto out_free_buf_zone;
 
Signature · 6 lines
1.7.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Dave Chinner

queued ahead of all data/metadata IO completions and processed before the data/metadata completions. Hence the log never gets stalled, and operations needed to clean memory can continue as quickly as possible. This avoids the livelock conditions and allos the system to keep running under heavy load as per normal.

From a quick review of how the WQ_HIGHPRI flag is handled this look good

to me. I'm still rather suspicious of the new workqueue code, and the complete lack of documentation for it, though.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs