public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <aelder@sgi.com>
To: xfs@oss.sgi.com
Subject: Re: [PATCH] xfs: set cursor in xfs_ail_splice() even when AIL was empty
Date: Fri, 22 Jul 2011 09:24:28 -0500	[thread overview]
Message-ID: <1311344668.2771.13.camel@doink> (raw)
In-Reply-To: <201107212205.p6LM5dxF016460@stout.americas.sgi.com>

On Thu, 2011-07-21 at 17:05 -0500, Alex Elder wrote:
> In xfs_ail_splice(), if a cursor is provided it is updated
> to point to the last item on the list to be spliced into
> the AIL.  But if the AIL was found to be empty, the cursor
> (if provided) is just initialized instead.
> 
> There is no reason the null AIL case needs to be any different.
> And treating it the same way allows this code to be rearranged
> a bit, with a somewhat tidier result.
> 
> Signed-off-by: Alex Elder <aelder@sgi.com>

I discovered a problem as I was thinking about this
last night.  I'll send an update shortly.

The problem is that my proposed xfs_ail_splice()
shouldn't update the cursor if an empty list is
passed, because the result won't produce a valid
item pointer.  An earlier edition of this patch
asserted no empty list would get passed, but that
fired fairly quickly.  Looking carefully at the
code as it stands now, an empty list will actually
do no harm, but that's just lucky, more or less.

And because the list_splice() after that ends up
being a no-op, there is really no point in
scanning the AIL to re-validate lip.  Therefore
we should just avoid calling xfs_ail_splice()
at all with an empty item list.

					-Alex


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

  reply	other threads:[~2011-07-22 14:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-21 22:05 [PATCH] xfs: set cursor in xfs_ail_splice() even when AIL was empty Alex Elder
2011-07-22 14:24 ` Alex Elder [this message]
2011-07-29 10:56 ` 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=1311344668.2771.13.camel@doink \
    --to=aelder@sgi.com \
    --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