Skip to content
Snippets Groups Projects
Commit 6c91795d authored by Yang Guo's avatar Yang Guo Committed by Yang Yingliang
Browse files

fs/buffer.c: add checking buffer head stat before clear

mainline inclusion
from mainline-v5.12-rc1
commit 4ebd3aec3842662300979dacd6fb38e3e8edf7f4
category: performance
bugzilla: NA
CVE: NA

--------------------------------

clear_buffer_new() is used to clear buffer new stat.  When PAGE_SIZE is
64K, most buffer heads in the list are not needed to clear.
clear_buffer_new() has an enpensive atomic modification operation, Let's
add checking buffer head before clear it as __block_write_begin_int does
which is good for performance.

Link: https://lkml.kernel.org/r/1612332890-57918-1-git-send-email-zhangshaokun@hisilicon.com


Signed-off-by: default avatarYang Guo <guoyang2@huawei.com>
Signed-off-by: default avatarShaokun Zhang <zhangshaokun@hisilicon.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Nick Piggin <npiggin@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: default avatarZhang Yi <yi.zhang@h...>
parent 0d6189df
No related branches found
No related tags found
No related merge requests found
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