From: Andrew Morton <akpm@linux-foundation.org>
To: Shaokun Zhang <zhangshaokun@hisilicon.com>
Cc: <linux-fsdevel@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Yang Guo <guoyang2@huawei.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Nick Piggin <npiggin@suse.de>
Subject: Re: [PATCH] fs/buffer.c: Add checking buffer head stat before clear
Date: Fri, 5 Feb 2021 15:45:48 -0800 [thread overview]
Message-ID: <20210205154548.49dd62b161b794b9f29026f1@linux-foundation.org> (raw)
In-Reply-To: <1612332890-57918-1-git-send-email-zhangshaokun@hisilicon.com>
On Wed, 3 Feb 2021 14:14:50 +0800 Shaokun Zhang <zhangshaokun@hisilicon.com> wrote:
> From: Yang Guo <guoyang2@huawei.com>
>
> 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.
Did this produce any measurable improvement?
Perhaps we should give clear_buffer_x() the same optimization as
set_buffer_x()?
static __always_inline void set_buffer_##name(struct buffer_head *bh) \
{ \
if (!test_bit(BH_##bit, &(bh)->b_state)) \
set_bit(BH_##bit, &(bh)->b_state); \
} \
static __always_inline void clear_buffer_##name(struct buffer_head *bh) \
{ \
clear_bit(BH_##bit, &(bh)->b_state); \
} \
next prev parent reply other threads:[~2021-02-06 3:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-03 6:14 [PATCH] fs/buffer.c: Add checking buffer head stat before clear Shaokun Zhang
2021-02-05 23:45 ` Andrew Morton [this message]
2021-02-08 6:12 ` Shaokun Zhang
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=20210205154548.49dd62b161b794b9f29026f1@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=guoyang2@huawei.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=npiggin@suse.de \
--cc=viro@zeniv.linux.org.uk \
--cc=zhangshaokun@hisilicon.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;
as well as URLs for NNTP newsgroup(s).