From: Mikulas Patocka <mpatocka@redhat.com>
To: Huaisheng Ye <yehs2007@zoho.com>
Cc: snitzer@redhat.com, agk@redhat.com, prarit@redhat.com,
tyu1@lenovo.com, dm-devel@redhat.com,
linux-kernel@vger.kernel.org, Huaisheng Ye <yehs1@lenovo.com>
Subject: Re: [PATCH] dm writecache: skip writecache_wait for pmem mode
Date: Wed, 4 Sep 2019 04:48:30 -0400 (EDT) [thread overview]
Message-ID: <alpine.LRH.2.02.1909040444440.11252@file01.intranet.prod.int.rdu2.redhat.com> (raw)
In-Reply-To: <20190902100450.10600-1-yehs2007@zoho.com>
On Mon, 2 Sep 2019, Huaisheng Ye wrote:
> From: Huaisheng Ye <yehs1@lenovo.com>
>
> The array bio_in_progress[2] only have chance to be increased and
> decreased with ssd mode. For pmem mode, they are not involved at all.
> So skip writecache_wait_for_ios in writecache_flush for pmem.
>
> Suggested-by: Doris Yu <tyu1@lenovo.com>
> Signed-off-by: Huaisheng Ye <yehs1@lenovo.com>
> ---
> drivers/md/dm-writecache.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c
> index c481947..d06b8aa 100644
> --- a/drivers/md/dm-writecache.c
> +++ b/drivers/md/dm-writecache.c
> @@ -726,7 +726,8 @@ static void writecache_flush(struct dm_writecache *wc)
> }
> writecache_commit_flushed(wc);
>
> - writecache_wait_for_ios(wc, WRITE);
> + if (!WC_MODE_PMEM(wc))
> + writecache_wait_for_ios(wc, WRITE);
>
> wc->seq_count++;
> pmem_assign(sb(wc)->seq_count, cpu_to_le64(wc->seq_count));
> --
> 1.8.3.1
I think this is not needed - wait_event in writecache_wait_for_ios exits
immediatelly if the condition is true.
This code path is not so hot that we would need microoptimizations like
this to avoid function calls.
Mikulas
next prev parent reply other threads:[~2019-09-04 8:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-02 10:04 Huaisheng Ye
2019-09-04 8:48 ` Mikulas Patocka [this message]
2019-09-04 15:18 ` [External] " Huaisheng HS1 Ye
2019-09-04 15:36 ` Mikulas Patocka
2019-09-05 5:59 Huaisheng HS1 Ye
2019-09-18 10:23 ` Mikulas Patocka
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=alpine.LRH.2.02.1909040444440.11252@file01.intranet.prod.int.rdu2.redhat.com \
--to=mpatocka@redhat.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=prarit@redhat.com \
--cc=snitzer@redhat.com \
--cc=tyu1@lenovo.com \
--cc=yehs1@lenovo.com \
--cc=yehs2007@zoho.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
all inboxes | Powered by JetHome®