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 5/6] xfs: convert the xfsaild threads to a workqueue
Date: Mon, 4 Apr 2011 12:11:38 +1000	[thread overview]
Message-ID: <20110404021138.GN6957@dastard> (raw)
In-Reply-To: <20110403105957.GB3872@infradead.org>

On Sun, Apr 03, 2011 at 06:59:57AM -0400, Christoph Hellwig wrote:
> On Sun, Apr 03, 2011 at 10:38:47AM +1000, Dave Chinner wrote:
> > FWIW, we already have an implicit delay for frequent callers when
> > the AIL is busy - the uninterruptible sleep for  sleeps of <= 20ms.
> > That was implemented specifically to rate-limit wakeups while the
> > xfsaild was busy pushing. This is essentially a different
> > implementation of the same mechanism.
> 
> In that cases maybe the minum delay of the delayed work should stay
> at 20ms?

I've been looking at this a little more - I don't think the
work_pending() check is sufficient. The pending bit is cleared
before the work function is called, so while the work is executing
we can queue up another work. That means when the work completes and
decides it needs to back off for a short while, it won't back off
because new work has been been queued and the pending bit has been
set.

Hence I thinkthis needs an external "work running" bit to be set so
that the backoff works as expected. That is, when pushing the tail
we need to do:

	ailp->xa_target = threshold_lsn;
	if (test_and_set_bit(ailp->pushing))
		queue_delayed_work(work, 0);

When the AIL work function needs to back off for a certain timeout,
it just does:

	queue_delayed_work(work, tout);

and when it completes the push, it does:

	clear_bit(ailp->pushing);

So the next tail push requeues the work again. That gets around the
need for implicit wakeup rate limiting, allows tail pushing to keep
moving the target forwards while the work is running, and doesn't
allow tail pushing to impact on a running push.

I'll modify it to do this - it should also simplify the code as
well.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

  reply	other threads:[~2011-04-04  2:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-10  0:05 [PATCH 0/6] xfs: Reduce OOM kill problems under heavy load V2 Dave Chinner
2011-03-10  0:05 ` [PATCH 1/6] xfs: introduce inode cluster buffer trylocks for xfs_iflush Dave Chinner
2011-03-10 17:31   ` Christoph Hellwig
2011-03-10  0:05 ` [PATCH 2/6] xfs: introduce a xfssyncd workqueue Dave Chinner
2011-03-10 17:34   ` Christoph Hellwig
2011-03-18  3:39     ` Dave Chinner
2011-03-10  0:05 ` [PATCH 3/6] xfs: convert ENOSPC inode flushing to use new syncd workqueue Dave Chinner
2011-03-10 17:35   ` Christoph Hellwig
2011-03-18  3:39     ` Dave Chinner
2011-03-10  0:05 ` [PATCH 4/6] xfs: introduce background inode reclaim work Dave Chinner
2011-03-10 17:40   ` Christoph Hellwig
2011-03-18  4:00     ` Dave Chinner
2011-03-10  0:05 ` [PATCH 5/6] xfs: convert the xfsaild threads to a workqueue Dave Chinner
2011-03-10 17:48   ` Christoph Hellwig
2011-03-18  4:06     ` Dave Chinner
2011-03-19 13:45       ` Christoph Hellwig
2011-04-03  0:38         ` Dave Chinner
2011-04-03 10:59           ` Christoph Hellwig
2011-04-04  2:11             ` Dave Chinner [this message]
2011-03-10  0:05 ` [PATCH 6/6] xfs: push the AIL from memory reclaim and periodic sync Dave Chinner
2011-03-10 21:31   ` Christoph Hellwig
2011-03-18  4:07     ` 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=20110404021138.GN6957@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