From: Shaohua Li <shli@kernel.org>
To: Song Liu <songliubraving@fb.com>
Cc: linux-raid@vger.kernel.org, shli@fb.com, neilb@suse.com,
kernel-team@fb.com, dan.j.williams@intel.com, hch@infradead.org
Subject: Re: [PATCH 2/2] md/r5cache: generate R5LOG_PAYLOAD_FLUSH
Date: Thu, 9 Mar 2017 13:53:31 -0800 [thread overview]
Message-ID: <20170309215331.dgsyxtp6wr4r7dxh@kernel.org> (raw)
In-Reply-To: <20170308014422.4019149-2-songliubraving@fb.com>
On Tue, Mar 07, 2017 at 05:44:22PM -0800, Song Liu wrote:
> In r5c_finish_stripe_write_out(), R5LOG_PAYLOAD_FLUSH is append to
> log->current_io.
>
> Appending R5LOG_PAYLOAD_FLUSH in quiesce needs extra writes to
> journal. To simplify the logic, we just skip R5LOG_PAYLOAD_FLUSH in
> quiesce.
>
> Even R5LOG_PAYLOAD_FLUSH supports multiple stripes per payload.
> However, current implementation is one stripe per R5LOG_PAYLOAD_FLUSH,
> which is simpler.
much simpiler than I expected :)
> Signed-off-by: Song Liu <songliubraving@fb.com>
> ---
> drivers/md/raid5-cache.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 59 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c
> index e69f922..fd0bfea 100644
> --- a/drivers/md/raid5-cache.c
> +++ b/drivers/md/raid5-cache.c
> @@ -590,7 +590,21 @@ static void r5l_log_endio(struct bio *bio)
> mempool_free(io->meta_page, log->meta_pool);
>
> spin_lock_irqsave(&log->io_list_lock, flags);
> - __r5l_set_io_unit_state(io, IO_UNIT_IO_END);
> +
> + if (list_empty(&io->stripe_list))
> + /*
> + * this io_unit only has R5LOG_PAYLOAD_FLUSH, set
> + * to IO_UNIT_STRIPE_END
> + */
> + __r5l_set_io_unit_state(io, IO_UNIT_STRIPE_END);
> + else
> + /*
> + * io_unit with R5LOG_PAYLOAD_FLUSH and also DATA/PARITY
> + * set to IO_UNIT_IO_END and wait for all stripes get
> + * handled.
> + */
> + __r5l_set_io_unit_state(io, IO_UNIT_IO_END);
This part along with r5l_do_reclaim change looks strange. Could we call
__r5l_stripe_write_finished here? It makes more sense as we also free io unit
and do other things. The r5l_do_reclaim part looks quite hackish.
Thanks,
Shaohua
prev parent reply other threads:[~2017-03-09 21:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-08 1:44 [PATCH 1/2] md/r5cache: handle R5LOG_PAYLOAD_FLUSH in recovery Song Liu
2017-03-08 1:44 ` [PATCH 2/2] md/r5cache: generate R5LOG_PAYLOAD_FLUSH Song Liu
2017-03-09 21:53 ` Shaohua Li [this message]
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=20170309215331.dgsyxtp6wr4r7dxh@kernel.org \
--to=shli@kernel.org \
--cc=dan.j.williams@intel.com \
--cc=hch@infradead.org \
--cc=kernel-team@fb.com \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.com \
--cc=shli@fb.com \
--cc=songliubraving@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