From: Song Liu <songliubraving@fb.com>
To: Zhengyuan Liu <liuzhengyuan@kylinos.cn>
Cc: Shaohua Li <shli@fb.com>, JackieLiu <liuyun01@kylinos.cn>,
"linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>
Subject: Re: [PATCH 2/2] md/r5cache: set journal mode according to log content
Date: Sun, 4 Dec 2016 20:11:04 +0000 [thread overview]
Message-ID: <3C042EF3-9D5D-4CA9-BC9F-57DF51A84D91@fb.com> (raw)
In-Reply-To: <1480841097-21018-2-git-send-email-liuzhengyuan@kylinos.cn>
I noticed this problem. This patch alone is not enough to fix it. I will send my patch
for this soon.
Thanks,
Song
> On Dec 4, 2016, at 12:44 AM, Zhengyuan Liu <liuzhengyuan@kylinos.cn> wrote:
>
> Currently, we choice write-through mode as the default journal mode.
> If there is data-only stripes, we'd rewrite it and add it into raid5d
> release list. However, raid5d thread wouldn't put those stripes into
> cache(full/partial) list but inactive list instead since the journal
> mode is write-through. More futher, later read request would get data
> from raid disk directly instead of cache stripe, that's not we want too.
>
> Signed-off-by: Zhengyuan Liu <liuzhengyuan@kylinos.cn>
> ---
> drivers/md/raid5-cache.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c
> index 07bce0e..0473b33 100644
> --- a/drivers/md/raid5-cache.c
> +++ b/drivers/md/raid5-cache.c
> @@ -2606,7 +2606,6 @@ int r5l_init_log(struct r5conf *conf, struct md_rdev *rdev)
>
> INIT_WORK(&log->deferred_io_work, r5l_submit_io_async);
>
> - log->r5c_journal_mode = R5C_JOURNAL_MODE_WRITE_THROUGH;
> INIT_LIST_HEAD(&log->stripe_in_journal_list);
> spin_lock_init(&log->stripe_in_journal_lock);
> atomic_set(&log->stripe_in_journal_count, 0);
> @@ -2614,6 +2613,11 @@ int r5l_init_log(struct r5conf *conf, struct md_rdev *rdev)
> if (r5l_load_log(log))
> goto error;
>
> + if (log->last_checkpoint == log->next_checkpoint)
> + log->r5c_journal_mode = R5C_JOURNAL_MODE_WRITE_THROUGH;
> + else
> + log->r5c_journal_mode = R5C_JOURNAL_MODE_WRITE_BACK;
> +
> rcu_assign_pointer(conf->log, log);
> set_bit(MD_HAS_JOURNAL, &conf->mddev->flags);
> return 0;
> --
> 2.7.4
>
>
>
next parent reply other threads:[~2016-12-04 20:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1480841097-21018-1-git-send-email-liuzhengyuan@kylinos.cn>
[not found] ` <1480841097-21018-2-git-send-email-liuzhengyuan@kylinos.cn>
2016-12-04 20:11 ` Song Liu [this message]
2016-12-04 8:49 [PATCH 1/2] md/r5cache: do r5c_update_log_state after log recovery Zhengyuan Liu
2016-12-04 8:49 ` [PATCH 2/2] md/r5cache: set journal mode according to log content Zhengyuan Liu
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=3C042EF3-9D5D-4CA9-BC9F-57DF51A84D91@fb.com \
--to=songliubraving@fb.com \
--cc=linux-raid@vger.kernel.org \
--cc=liuyun01@kylinos.cn \
--cc=liuzhengyuan@kylinos.cn \
--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