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: dm writecache: add unlikely for getting two block with same LBA
Date: Sun, 11 Aug 2019 14:11:16 -0400 (EDT) [thread overview]
Message-ID: <alpine.LRH.2.02.1908111410590.13454@file01.intranet.prod.int.rdu2.redhat.com> (raw)
In-Reply-To: <20190811161233.7616-2-yehs2007@zoho.com>
On Mon, 12 Aug 2019, Huaisheng Ye wrote:
> From: Huaisheng Ye <yehs1@lenovo.com>
>
> In function writecache_writeback, entries g and f has same original
> sector only happens at entry f has been committed, but entry g has
> NOT yet.
>
> The probability of this happening is very low in the following
> 256 blocks at most of entry e, so add unlikely for the result.
>
> Signed-off-by: Huaisheng Ye <yehs1@lenovo.com>
Acked-by: Mikulas Patocka <mpatocka@redhat.com>
> ---
> drivers/md/dm-writecache.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c
> index 5c7009d..3643084 100644
> --- a/drivers/md/dm-writecache.c
> +++ b/drivers/md/dm-writecache.c
> @@ -1628,8 +1628,8 @@ static void writecache_writeback(struct work_struct *work)
> if (unlikely(!next_node))
> break;
> g = container_of(next_node, struct wc_entry, rb_node);
> - if (read_original_sector(wc, g) ==
> - read_original_sector(wc, f)) {
> + if (unlikely(read_original_sector(wc, g) ==
> + read_original_sector(wc, f))) {
> f = g;
> continue;
> }
> --
> 1.8.3.1
>
>
next prev parent reply other threads:[~2019-08-11 18:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-11 16:12 dm writecache: remove unused member pointer in writeback_struct Huaisheng Ye
2019-08-11 16:12 ` dm writecache: add unlikely for getting two block with same LBA Huaisheng Ye
2019-08-11 18:11 ` Mikulas Patocka [this message]
2019-08-11 18:10 ` dm writecache: remove unused member pointer in writeback_struct 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.1908111410590.13454@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®