All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shaohua Li <shli@kernel.org>
To: NeilBrown <neilb@suse.de>
Cc: Christoph Hellwig <hch@infradead.org>, linux-raid@vger.kernel.org
Subject: Re: [RFC]raid5: add an option to avoid copy data from bio to stripe cache
Date: Tue, 29 Apr 2014 10:01:24 +0800	[thread overview]
Message-ID: <20140429020124.GA24123@kernel.org> (raw)
In-Reply-To: <20140428204407.226c88e4@notabene.brown>

On Mon, Apr 28, 2014 at 08:44:07PM +1000, NeilBrown wrote:
> On Mon, 28 Apr 2014 03:17:48 -0700 Christoph Hellwig <hch@infradead.org>
> wrote:
> 
> > On Mon, Apr 28, 2014 at 02:58:41PM +0800, Shaohua Li wrote:
> > > 
> > > The stripe cache has two goals:
> > > 1. cache data, so next time if data can be found in stripe cache, disk access
> > > can be avoided.
> > 
> > I think this is mostly a side effect.  We have a much larger and better
> > tuned page cache to take care of this.
> > 
> > > 2. stable data. data is copied from bio to stripe cache and calculated parity.
> > > data written to disk is from stripe cache, so if upper layer changes bio data,
> > > data written to disk isn't impacted.
> > > 
> > > In my environment, I can guarantee 2 will not happen.
> > 
> > Why just in your environment?  Now that we got stable pages in the page
> > cache this should always be the case.
> 
> Hmm... I hadn't realised that we were guaranteed stabled pages always (if
> requested).  It seems that we are.
> 
> > 
> > > Of course, this shouldn't be enabled by default, so I added an option to
> > > control it.
> > 
> > Unless careful benchmarking in various scenarious shows adverse effects
> > this should be the default.  And if we can find adverse effects we need
> > to look into them.
> 
> Certainly some benchmarking is needed.
> 
> We should set
> 
>  mddev->queue->backing_dev_info.capabilities |= BDI_CAP_STABLE_WRITES
> 
> if and only iff 'skip_copy' is set. Then test various cases just to confirm
> that it is generally an improvement.

IIRC, we switched from 'force wait page writeback' to 'wait page writeback if
required' because of performance issues reported, so we shoudn't always enable
BDI_CAP_STABLE_WRITES. Is it safe to set/clear BDI_CAP_STABLE_WRITES at
runtime, if we use 'skip_copy' to control it? Ofcourse, we don't need runtime
changing the setting, but we need a mechanism to setup it before array runs.

As of performance, the 'skip_copy' is very helpful (> 30% boost) for my raid5
array (with 6 fast PCIe SSD) for 1M request size workload. Nothing changed for
4k randwrite workload.

Thanks,
Shaohua

  reply	other threads:[~2014-04-29  2:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-28  6:58 [RFC]raid5: add an option to avoid copy data from bio to stripe cache Shaohua Li
2014-04-28  7:06 ` NeilBrown
2014-04-28  7:28   ` Shaohua Li
2014-04-28 10:08     ` NeilBrown
2014-04-28 10:17 ` Christoph Hellwig
2014-04-28 10:44   ` NeilBrown
2014-04-29  2:01     ` Shaohua Li [this message]
2014-04-29  7:07       ` NeilBrown
2014-04-29 11:13         ` Shaohua Li
2014-05-21  7:01           ` NeilBrown
2014-05-21  9:57             ` Shaohua Li
2014-05-29  7:01               ` NeilBrown

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=20140429020124.GA24123@kernel.org \
    --to=shli@kernel.org \
    --cc=hch@infradead.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.