From: Daniel Walker <dwalker@mvista.com>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com, linux-kernel@vger.kernel.org, matthew@wil.cx
Subject: Re: [PATCH 4/6] Replace inode flush semaphore with a completion
Date: Tue, 12 Aug 2008 20:11:17 -0700 [thread overview]
Message-ID: <1218597077.6166.15.camel@dhcp32.mvista.com> (raw)
In-Reply-To: <1214556284-4160-5-git-send-email-david@fromorbit.com>
On Fri, 2008-06-27 at 18:44 +1000, Dave Chinner wrote:
> Use the new completion flush code to implement the inode
> flush lock. Removes one of the final users of semaphores
> in the XFS code base.
>
> Version 2:
> o make flock functions static inlines
> o use new completion interfaces
I was looking over this lock in XFS .. The iflock/ifunlock seem to be
very much like mutexes in most of the calling locations. Where the lock
happens at the start, and the unlock happens when the function calls
bottom out. It seems like a better way to go would be to change from,
xfs_ilock(uqp, XFS_ILOCK_EXCL);
xfs_iflock(uqp);
error = xfs_iflush(uqp, XFS_IFLUSH_SYNC);
Where xfs_iflush eventually does the unlock to,
xfs_ilock(uqp, XFS_ILOCK_EXCL);
xfs_iflock(uqp);
error = xfs_iflush(uqp, XFS_IFLUSH_SYNC);
xfs_ifunlock(uqp);
And remove the unlocking from inside xfs_iflush(). Then use a flag to
indicate that the flush is in progress, and a
completion/wait_for_completion when another thread needs to wait on the
flush to complete if it's an async flush.
That seems vastly more complex than your current patch, but I think it
will be much cleaner ..
Daniel
next prev parent reply other threads:[~2008-08-13 3:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-27 8:44 [PATCH 0/6] Remove most users of semaphores from XFS V2 Dave Chinner
2008-06-27 8:44 ` [PATCH 1/6] Clean up stale references to semaphores Dave Chinner
2008-06-27 8:44 ` [PATCH 2/6] Replace the XFS buf iodone semaphore with a completion Dave Chinner
2008-06-27 8:44 ` [PATCH 3/6] Extend completions to provide XFS object flush requirements Dave Chinner
2008-06-27 8:44 ` [PATCH 4/6] Replace inode flush semaphore with a completion Dave Chinner
2008-08-13 3:11 ` Daniel Walker [this message]
2008-08-13 7:50 ` Dave Chinner
2008-08-13 15:34 ` Daniel Walker
2008-08-14 0:19 ` Dave Chinner
2008-08-14 1:34 ` Daniel Walker
2008-08-14 2:30 ` Dave Chinner
2008-06-27 8:44 ` [PATCH 5/6] Replace dquot " Dave Chinner
2008-06-27 8:44 ` [PATCH 6/6] Remove the sema_t from XFS Dave Chinner
2008-07-11 1:13 [RESEND, PATCH 0/6] Remove most users of semaphores " Dave Chinner
2008-07-11 1:13 ` [PATCH 4/6] Replace inode flush semaphore with a completion 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=1218597077.6166.15.camel@dhcp32.mvista.com \
--to=dwalker@mvista.com \
--cc=david@fromorbit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew@wil.cx \
--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
all inboxes | Powered by JetHome®