From: David Chinner <dgc@sgi.com>
To: Matthew Wilcox <matthew@wil.cx>
Cc: David Chinner <dgc@sgi.com>,
xfs@oss.sgi.com, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] Remove l_flushsema
Date: Wed, 30 Apr 2008 20:41:25 +1000 [thread overview]
Message-ID: <20080430104125.GM108924158@sgi.com> (raw)
In-Reply-To: <20080430090502.GH14976@parisc-linux.org>
On Wed, Apr 30, 2008 at 03:05:03AM -0600, Matthew Wilcox wrote:
>
> The l_flushsema doesn't exactly have completion semantics, nor mutex
> semantics. It's used as a list of tasks which are waiting to be notified
> that a flush has completed. It was also being used in a way that was
> potentially racy, depending on the semaphore implementation.
>
> By using a waitqueue instead of a semaphore we avoid the need for a
> separate counter, since we know we just need to wake everything on the
> queue.
Looks good at first glance. thanks for doing this, Matthew.
I've been swamped the last couple of days so I haven't had
a chance to do this myself....
> Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
>
> --
>
> I've only given this light testing, it could use some more.
Yeah, I've pulled it into my qa tree so it'll get some shaking down.
If it survives for a while, I'll push it into the xfs tree.
One comment, though:
> @@ -2278,14 +2277,9 @@ xlog_state_do_callback(
> }
> #endif
>
> - flushcnt = 0;
> - if (log->l_iclog->ic_state & (XLOG_STATE_ACTIVE|XLOG_STATE_IOERROR)) {
> - flushcnt = log->l_flushcnt;
> - log->l_flushcnt = 0;
> - }
> + if (log->l_iclog->ic_state & (XLOG_STATE_ACTIVE|XLOG_STATE_IOERROR))
> + wake_up_all(&log->l_flush_wq);
> spin_unlock(&log->l_icloglock);
> - while (flushcnt--)
> - vsema(&log->l_flushsema);
The only thing that I'm concerned about here is that this will
substantially increase the time the l_icloglock is held. This is
a severely contended lock on large cpu count machines and putting
the wakeup inside this lock will increase the hold time.
I guess I can address this by adding a new lock for the waitqueue
in a separate patch set.
Hmmm - CONFIG_XFS_DEBUG builds break in the xfs-dev tree with
this patch (in the xfs kdb module). I'll fix this up as well.
Cheers,
Dave.
--
Dave Chinner
Principal Engineer
SGI Australian Software Group
next prev parent reply other threads:[~2008-04-30 10:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-30 9:05 [PATCH] Remove l_flushsema Matthew Wilcox
2008-04-30 10:24 ` Matthew Wilcox
2008-04-30 10:41 ` David Chinner [this message]
2008-04-30 10:58 ` Christoph Hellwig
2008-04-30 11:11 ` David Chinner
2008-04-30 11:15 ` Christoph Hellwig
2008-04-30 11:34 ` David Chinner
2008-04-30 11:37 ` Christoph Hellwig
2008-04-30 15:17 ` Matthew Wilcox
2008-05-01 1:19 ` David Chinner
2008-04-30 11:52 ` Matthew Wilcox
2008-04-30 12:14 ` David 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=20080430104125.GM108924158@sgi.com \
--to=dgc@sgi.com \
--cc=linux-fsdevel@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