Commit 62421b38 authored by Huaisheng Ye's avatar Huaisheng Ye Committed by Mike Snitzer

dm writecache: add unlikely for getting two block with same LBA

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.
Signed-off-by: default avatarHuaisheng Ye <yehs1@lenovo.com>
Acked-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 58912dbc
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment