linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shaohua Li <shli@kernel.org>
To: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Cc: shli@fb.com, linux-raid@vger.kernel.org
Subject: Re: [PATCH v4 3/7] raid5-ppl: Partial Parity Log write logging implementation
Date: Wed, 1 Mar 2017 09:51:33 -0800	[thread overview]
Message-ID: <20170301175133.jimllzchgsemndak@kernel.org> (raw)
In-Reply-To: <d1021e37-f40d-955b-0726-1b64cc4f8064@intel.com>

On Wed, Mar 01, 2017 at 05:13:38PM +0100, Artur Paszkiewicz wrote:
> On 02/28/2017 01:04 AM, Shaohua Li wrote:
> > On Tue, Feb 21, 2017 at 08:43:57PM +0100, Artur Paszkiewicz wrote:
> >> This implements the PPL write logging functionality. The description
> >> of PPL is added to the documentation. More details can be found in the
> >> comments in raid5-ppl.c.
> >>
> >> Put the PPL metadata structures to md_p.h because userspace tools
> >> (mdadm) will also need to read/write PPL.
> >>
> >> Warn about using PPL with enabled disk volatile write-back cache for
> >> now. It can be removed once disk cache flushing before writing PPL is
> >> implemented.
> >>
> >> Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
> >> ---
> >>  Documentation/md/raid5-ppl.txt |  44 +++
> >>  drivers/md/Makefile            |   2 +-
> >>  drivers/md/raid5-ppl.c         | 617 +++++++++++++++++++++++++++++++++++++++++
> >>  drivers/md/raid5.c             |  49 +++-
> >>  drivers/md/raid5.h             |   8 +
> >>  include/uapi/linux/raid/md_p.h |  26 ++
> >>  6 files changed, 738 insertions(+), 8 deletions(-)
> >>  create mode 100644 Documentation/md/raid5-ppl.txt
> >>  create mode 100644 drivers/md/raid5-ppl.c
> >>
> >> diff --git a/Documentation/md/raid5-ppl.txt b/Documentation/md/raid5-ppl.txt
> >> new file mode 100644
> >> index 000000000000..127072b09363
> >> --- /dev/null
> >> +++ b/Documentation/md/raid5-ppl.txt
> >> @@ -0,0 +1,44 @@
> >> +Partial Parity Log
> >> +
> >> +
> >> +		while (stripes_count--) {
> >> +			/*
> >> +			 * if entry without partial parity just skip its stripes
> >> +			 * without adding pages to bio
> >> +			 */
> >> +			if (pp_size > 0 &&
> >> +			    !bio_add_page(bio, sh->ppl_page, PAGE_SIZE, 0)) {
> >> +				struct bio *prev = bio;
> >> +
> >> +				bio = bio_alloc_bioset(GFP_NOIO, BIO_MAX_PAGES,
> >> +						       ppl_conf->bs);
> > 
> > The code keeps allocating bios but doesn't dispatch any yet. The bioset can't
> > guarantee the allocation successes. To have the guarantee, we must make sure
> > previous bios could finish.
> 
> Is it ok to submit the bio before allocating another from the same
> bioset, without waiting for it to complete? The description for
> bio_alloc_bioset() suggests this, if I understand it correctly: "Callers
> that need to allocate more than 1 bio must always submit the previously
> allocated bio for IO before attempting to allocate a new one." 

Yes, I mean submit.
  
> >>  		return -EINVAL;
> >>  	if (mddev->delta_disks == 0 &&
> >>  	    mddev->new_layout == mddev->layout &&
> >> diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h
> >> index 3cc4cb28f7e6..f915a7a0e752 100644
> >> --- a/drivers/md/raid5.h
> >> +++ b/drivers/md/raid5.h
> >> @@ -230,6 +230,7 @@ struct stripe_head {
> >>  	struct list_head	r5c; /* for r5c_cache->stripe_in_journal */
> >>  
> >>  	struct page		*ppl_page; /* partial parity of this stripe */
> >> +	struct ppl_io_unit	*ppl_log_io;
> > 
> > Maybe we should put the ppl fields and raid5 fields to a union
> 
> Good idea, will do.
> 
> >>  	/**
> >>  	 * struct stripe_operations
> >>  	 * @target - STRIPE_OP_COMPUTE_BLK target
> >> @@ -689,6 +690,7 @@ struct r5conf {
> >>  	int			group_cnt;
> >>  	int			worker_cnt_per_group;
> >>  	struct r5l_log		*log;
> >> +	struct ppl_conf		*ppl;
> > 
> > Maybe use void * log_private, so works for both raid5-cache and ppl
> 
> Do you mean replace "struct ppl_conf *ppl" with "void *log_private"?

Right. But if this makes checking the log type hard, ignore it.

Thanks,
Shaohua

  reply	other threads:[~2017-03-01 17:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-21 19:43 [PATCH v4 0/7] Partial Parity Log for MD RAID 5 Artur Paszkiewicz
2017-02-21 19:43 ` [PATCH v4 1/7] md: superblock changes for PPL Artur Paszkiewicz
2017-02-21 19:43 ` [PATCH v4 2/7] raid5: calculate partial parity for a stripe Artur Paszkiewicz
2017-02-27 23:45   ` Shaohua Li
2017-03-01 16:12     ` Artur Paszkiewicz
2017-02-21 19:43 ` [PATCH v4 3/7] raid5-ppl: Partial Parity Log write logging implementation Artur Paszkiewicz
2017-02-28  0:04   ` Shaohua Li
2017-03-01 16:13     ` Artur Paszkiewicz
2017-03-01 17:51       ` Shaohua Li [this message]
2017-02-21 19:43 ` [PATCH v4 4/7] md: add sysfs entries for PPL Artur Paszkiewicz
2017-02-28  0:37   ` Shaohua Li
2017-03-01 16:13     ` Artur Paszkiewicz
2017-02-21 19:43 ` [PATCH v4 5/7] raid5-ppl: load and recover the log Artur Paszkiewicz
2017-02-28  1:12   ` Shaohua Li
2017-03-01 16:14     ` Artur Paszkiewicz
2017-03-01 17:59       ` Shaohua Li
2017-03-02  8:40         ` Artur Paszkiewicz
2017-02-21 19:44 ` [PATCH v4 6/7] raid5-ppl: support disk hot add/remove with PPL Artur Paszkiewicz
2017-02-28  1:22   ` Shaohua Li
2017-03-01 16:14     ` Artur Paszkiewicz
2017-02-21 19:44 ` [PATCH v4 7/7] raid5-ppl: runtime PPL enabling or disabling Artur Paszkiewicz
2017-02-28  1:31   ` Shaohua Li
2017-03-01 16:14     ` Artur Paszkiewicz
2017-02-28  1:35 ` [PATCH v4 0/7] Partial Parity Log for MD RAID 5 Shaohua Li
2017-03-01 16:12   ` Artur Paszkiewicz

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=20170301175133.jimllzchgsemndak@kernel.org \
    --to=shli@kernel.org \
    --cc=artur.paszkiewicz@intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=shli@fb.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;
as well as URLs for NNTP newsgroup(s).