From: Matthew Wilcox <matthew@wil.cx>
To: Christoph Hellwig <hch@infradead.org>
Cc: David Chinner <dgc@sgi.com>, xfs@oss.sgi.com
Subject: Re: [PATCH] Remove l_flushsema
Date: Wed, 30 Apr 2008 09:17:14 -0600 [thread overview]
Message-ID: <20080430151714.GM14976@parisc-linux.org> (raw)
In-Reply-To: <20080430113753.GA17871@infradead.org>
On Wed, Apr 30, 2008 at 07:37:53AM -0400, Christoph Hellwig wrote:
> On Wed, Apr 30, 2008 at 09:34:18PM +1000, David Chinner wrote:
> > > probably loose some arguments).
> >
> > Yep, much cleaner. Who's signoff goes on this?
>
> You can have mine:
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> but I think it's till essentially willy's and he should be credited for
> it.
I'm fine with adding my S-o-B to this version:
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Here's a little twist on the idea to avoid the thundering herd.
A vigorous review of this might not be a bad idea -- the idea is to only
wake up sleeping processes when there seems to be enough space in the
log to make it worthwhile. So there's a few places where we unlock the
l_icloglock and jump back to restart; I didn't add an sv_signal there.
But there should be an sv_signal before each exit from the function,
and I think I've done that.
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 1bfe3f9..4533a10 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -2282,7 +2282,7 @@ xlog_state_do_callback(
if (log->l_iclog->ic_state & (XLOG_STATE_ACTIVE|XLOG_STATE_IOERROR))
wait = 1;
spin_unlock(&log->l_icloglock);
- sv_broadcast(&log->l_flush_wait);
+ sv_signal(&log->l_flush_wait);
} /* xlog_state_do_callback */
@@ -2377,6 +2377,7 @@ restart:
spin_lock(&log->l_icloglock);
if (XLOG_FORCED_SHUTDOWN(log)) {
spin_unlock(&log->l_icloglock);
+ sv_signal(&log->l_flush_wait);
return XFS_ERROR(EIO);
}
@@ -2425,8 +2426,11 @@ restart:
/* If I'm the only one writing to this iclog, sync it to disk */
if (atomic_read(&iclog->ic_refcnt) == 1) {
spin_unlock(&log->l_icloglock);
- if ((error = xlog_state_release_iclog(log, iclog)))
+ error = xlog_state_release_iclog(log, iclog);
+ if (error) {
+ sv_signal(&log->l_flush_wait);
return error;
+ }
} else {
atomic_dec(&iclog->ic_refcnt);
spin_unlock(&log->l_icloglock);
@@ -2452,6 +2456,7 @@ restart:
ASSERT(iclog->ic_offset <= iclog->ic_size);
spin_unlock(&log->l_icloglock);
+ sv_signal(&log->l_flush_wait);
*logoffsetp = log_offset;
return 0;
--
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
next prev parent reply other threads:[~2008-04-30 15:17 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
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 [this message]
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=20080430151714.GM14976@parisc-linux.org \
--to=matthew@wil.cx \
--cc=dgc@sgi.com \
--cc=hch@infradead.org \
--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