public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 02/14] xfs: clean up log space grant functions
Date: Thu, 2 Dec 2010 12:48:33 +1100	[thread overview]
Message-ID: <20101202014833.GN16922@dastard> (raw)
In-Reply-To: <20101201123032.GA20378@infradead.org>

On Wed, Dec 01, 2010 at 07:30:32AM -0500, Christoph Hellwig wrote:
> On Mon, Nov 29, 2010 at 12:38:20PM +1100, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> > 
> > xlog_grant_log_space and xlog_regrant_log_write_space both have very
> > similar structure. Both have a "wait on non-empty queue" section at
> > the start, followed by a "wait for space" loop of which the contents
> > are almost identical to the initial non-empty queue section.
> > 
> > In both cases, the non-empty queue wait can be folded into the wait
> > for space loop, simply by entering the loop if the queue is not
> > empty and the current ticket is not on the queue. If we trigger the
> > non-empty queue case, we always add ourselves to the queue, and
> > hence the second and subsequent loops are always driven by the "wait
> > for space" test.
> > 
> > IOWs, both wait conditions can be folded into the one loop, removing
> > a bunch of duplicated code and making it simpler to modify in
> > future patches.
> 
> I don't really like this patch.  The new conditions are overly
> complicated because of the desire to only go through the loop once
> for the queue not empty case.  In addition there's some behaviour
> changes:
> 
>  - in xlog_grant_log_space we previously didn't call xlog_grant_push_ail
>    for the queue not empty case, and now we do.

As you point out, there's no actual harm in doing that.

>  - in xlog_regrant_write_log_space the old version of the queue not
>    empty case would loop over all waiting tickets, and if we could
>    wake up all of them we'll skip the first wait, and given enough
>    free space also the second wait, while the new code always adds it
>    to the writeq, although it will still skip the actualy wait later.

I didn't think there's any harm in that, either, because we're
walking the entire queue anyway and it does not dirty any global
shared cachelines we aren't already dirtying by taking the queue
lock.

> My recommendation would be to skip this patch for now and revisit the
> area later.

Ugh. That means the following 10 patches need to be reworked.

> For example the superflous xlog_grant_push_ail actually
> is rather harmless these days with the xfsaild threshold, so not
> skipping it for the first case probably is fine in the end.  Then again
> the whole add to the queue just in case if it's non-empty doesn't make
> much sense to me to start with.  As soon as xfs_log_move_tail makes
> space in the log it wakes up all tickets waiting for it anyway, so
> adding us to the queue just in case seems rather inefficient, and not
> overl helpful.

Ok, so your main objection is the needless addition to the queue?
That can be avoided easily enough via a local variable. Would that
be sufficient to alleviate your concerns?

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2010-12-02  1:46 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-29  1:38 [PATCH 0/14] xfs: grant lock scaling and removal V2 Dave Chinner
2010-11-29  1:38 ` [PATCH 01/14] xfs: convert log grant ticket queues to list heads Dave Chinner
2010-11-30 22:59   ` Christoph Hellwig
2010-11-29  1:38 ` [PATCH 02/14] xfs: clean up log space grant functions Dave Chinner
2010-12-01 12:30   ` Christoph Hellwig
2010-12-02  1:48     ` Dave Chinner [this message]
2010-12-02 11:40       ` Christoph Hellwig
2010-12-03  6:45         ` Dave Chinner
2010-11-29  1:38 ` [PATCH 03/14] xfs: convert log grant heads to LSN notation Dave Chinner
2010-12-01 12:42   ` Christoph Hellwig
2010-12-02  1:49     ` Dave Chinner
2010-12-01 13:05   ` Christoph Hellwig
2010-12-02  2:01     ` Dave Chinner
2010-12-02 11:47       ` Christoph Hellwig
2010-11-29  1:38 ` [PATCH 04/14] xfs: use wait queues directly for log grant queues Dave Chinner
2010-12-01 12:34   ` Christoph Hellwig
2010-12-02  2:02     ` Dave Chinner
2010-11-29  1:38 ` [PATCH 05/14] xfs: make AIL tail pushing independent of the grant lock Dave Chinner
2010-12-01 12:45   ` Christoph Hellwig
2010-12-02  2:04     ` Dave Chinner
2010-11-29  1:38 ` [PATCH 06/14] xfs: convert l_last_sync_lsn to an atomic variable Dave Chinner
2010-12-01 12:54   ` Christoph Hellwig
2010-11-29  1:38 ` [PATCH 07/14] xfs: convert l_tail_lsn " Dave Chinner
2010-12-01 12:56   ` Christoph Hellwig
2010-11-29  1:38 ` [PATCH 08/14] xfs: convert log grant heads to atomic variables Dave Chinner
2010-12-01 12:59   ` Christoph Hellwig
2010-12-02  2:04     ` Dave Chinner
2010-11-29  1:38 ` [PATCH 09/14] xfs: introduce new locks for the log grant ticket wait queues Dave Chinner
2010-12-01 13:12   ` Christoph Hellwig
2010-12-02  2:10     ` Dave Chinner
2010-12-02 11:48       ` Christoph Hellwig
2010-11-29  1:38 ` [PATCH 10/14] xfs: convert grant head manipulations to lockless algorithm Dave Chinner
2010-12-01 13:15   ` Christoph Hellwig
2010-12-02  2:11     ` Dave Chinner
2010-11-29  1:38 ` [PATCH 11/14] xfs: remove log grant lock Dave Chinner
2010-12-01 13:15   ` Christoph Hellwig
2010-11-29  1:38 ` [PATCH 12/14] xfs: kill useless spinlock_destroy macro Dave Chinner
2010-12-01 13:19   ` Christoph Hellwig
2010-11-29  1:38 ` [PATCH 13/14] xfs: replace use of sv_t with waitqueues in the log Dave Chinner
2010-12-01 13:20   ` Christoph Hellwig
2010-11-29  1:38 ` [PATCH 14/14] xfs: remove sv wrappers Dave Chinner
2010-12-01 13:20   ` Christoph Hellwig

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=20101202014833.GN16922@dastard \
    --to=david@fromorbit.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