public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Dave Chinner <david@fromorbit.com>
Cc: Christoph Hellwig <hch@infradead.org>, xfs@oss.sgi.com
Subject: Re: [PATCH 4/4] xfs: implement freezing by emptying the AIL
Date: Sat, 24 Mar 2012 13:06:18 -0400	[thread overview]
Message-ID: <20120324170618.GD21708@infradead.org> (raw)
In-Reply-To: <20120321235738.GB5091@dastard>

On Thu, Mar 22, 2012 at 10:57:38AM +1100, Dave Chinner wrote:
> > +	 * threshold.
> > +	 */
> > +	if (atomic_read(&ailp->xa_wait_empty))
> > +		target = xfs_ail_max(ailp)->li_lsn;
> 
> I don't think this is safe - we may have finished pushing the AIL to
> empty, but the waiter that decrements xa_wait_empty may not have run
> yet and we can race with that. In that case, xfs_ail_max() will
> return NULL as the AIL is empty.

True - I'll add a check for that.

> > +{
> > +	DEFINE_WAIT(wait);
> > +
> > +	/*
> > +	 * We use a counter instead of a flag here to support multiple
> > +	 * processes calling into sync at the same time.
> > +	 */
> > +	atomic_inc(&ailp->xa_wait_empty);
> > +	do {
> > +		prepare_to_wait(&ailp->xa_empty, &wait, TASK_KILLABLE);
> 
> Why a killable wait? We need to wait until the push is complete
> before returning because we can't return an error and we don't want
> ctrl-c to break out of this loop while writeback it still taking
> place on a non-shutdown based unmount (e.g. got thousands of inodes
> to write on a slow RAID5 device doing RMW cycles for every inode).

The idea was to ease debugging if we couldn't empty the AIL.  But given
that we'd leak tons of structures that probably is not a good idea.
I'll change it.

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

  reply	other threads:[~2012-03-24 17:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-16 17:55 [PATCH 0/4] implement filesystem freezing by emptying the AIL Christoph Hellwig
2012-03-16 17:55 ` [PATCH 1/4] xfs: remove log item from AIL in xfs_qm_dqflush after a shutdown Christoph Hellwig
2012-03-21 23:16   ` Dave Chinner
2012-03-16 17:55 ` [PATCH 2/4] xfs: remove log item from AIL in xfs_iflush " Christoph Hellwig
2012-03-21 23:20   ` Dave Chinner
2012-03-24 13:47     ` Christoph Hellwig
2012-03-16 17:55 ` [PATCH 3/4] xfs: allow assigning the tail lsn with the AIL lock held Christoph Hellwig
2012-03-21 17:22   ` Mark Tinguely
2012-03-21 23:29   ` Dave Chinner
2012-03-24 13:48     ` Christoph Hellwig
2012-03-16 17:55 ` [PATCH 4/4] xfs: implement freezing by emptying the AIL Christoph Hellwig
2012-03-21 23:57   ` Dave Chinner
2012-03-24 17:06     ` Christoph Hellwig [this message]
2012-03-24 17:08       ` 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=20120324170618.GD21708@infradead.org \
    --to=hch@infradead.org \
    --cc=david@fromorbit.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