* [PATCH] XFS: don't block in xfs_qm_dqflush() during async writeback
@ 2008-10-07 21:57 Dave Chinner
2008-10-10 1:16 ` Peter Leckie
0 siblings, 1 reply; 2+ messages in thread
From: Dave Chinner @ 2008-10-07 21:57 UTC (permalink / raw)
To: xfs
Normally dquots are written back via delayed write mechanisms. They
are flushed to their backing buffer by xfssyncd, which is then
pushed out by either AIL or xfsbufd flushing. The flush from the
xfssyncd is supposed to be non-blocking, but xfs_qm_dqflush() always
waits for pinned duots, which means that it will block for the
length of time it takes to do a synchronous log force. This causes
unnecessary extra log I/O to be issued whenever we try to flush a
busy dquot.
Avoid the log forces and blocking xfssyncd by making xfs_qm_dqflush()
pay attention to what type of sync it is doing when it sees a pinned
dquot and not waiting when doing non-blocking flushes.
Signed-off-by: Dave Chinner <david@fromorbit.com>
---
fs/xfs/quota/xfs_dquot.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c
index 5dca401..591ca66 100644
--- a/fs/xfs/quota/xfs_dquot.c
+++ b/fs/xfs/quota/xfs_dquot.c
@@ -1221,16 +1221,14 @@ xfs_qm_dqflush(
xfs_dqtrace_entry(dqp, "DQFLUSH");
/*
- * If not dirty, nada.
+ * If not dirty, or it's pinned and we are not supposed to
+ * block, nada.
*/
- if (!XFS_DQ_IS_DIRTY(dqp)) {
+ if (!XFS_DQ_IS_DIRTY(dqp) ||
+ (!(flags & XFS_QMOPT_SYNC) && atomic_read(&dqp->q_pincount) > 0)) {
xfs_dqfunlock(dqp);
- return (0);
+ return 0;
}
-
- /*
- * Cant flush a pinned dquot. Wait for it.
- */
xfs_qm_dqunpin_wait(dqp);
/*
--
1.5.6.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] XFS: don't block in xfs_qm_dqflush() during async writeback
2008-10-07 21:57 [PATCH] XFS: don't block in xfs_qm_dqflush() during async writeback Dave Chinner
@ 2008-10-10 1:16 ` Peter Leckie
0 siblings, 0 replies; 2+ messages in thread
From: Peter Leckie @ 2008-10-10 1:16 UTC (permalink / raw)
To: Dave Chinner; +Cc: xfs
Dave Chinner wrote:
> Normally dquots are written back via delayed write mechanisms. They
> are flushed to their backing buffer by xfssyncd, which is then
> pushed out by either AIL or xfsbufd flushing. The flush from the
> xfssyncd is supposed to be non-blocking, but xfs_qm_dqflush() always
> waits for pinned duots, which means that it will block for the
> length of time it takes to do a synchronous log force. This causes
> unnecessary extra log I/O to be issued whenever we try to flush a
> busy dquot.
>
> Avoid the log forces and blocking xfssyncd by making xfs_qm_dqflush()
> pay attention to what type of sync it is doing when it sees a pinned
> dquot and not waiting when doing non-blocking flushes.
>
This patch looks good.
Thanks,
Pete
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-10-10 0:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-07 21:57 [PATCH] XFS: don't block in xfs_qm_dqflush() during async writeback Dave Chinner
2008-10-10 1:16 ` Peter Leckie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox