[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210205154548.49dd62b161b794b9f29026f1@linux-foundation.org>
Date: Fri, 5 Feb 2021 15:45:48 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Shaokun Zhang <zhangshaokun@...ilicon.com>
Cc: <linux-fsdevel@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
Yang Guo <guoyang2@...wei.com>,
Alexander Viro <viro@...iv.linux.org.uk>,
Nick Piggin <npiggin@...e.de>
Subject: Re: [PATCH] fs/buffer.c: Add checking buffer head stat before clear
On Wed, 3 Feb 2021 14:14:50 +0800 Shaokun Zhang <zhangshaokun@...ilicon.com> wrote:
> From: Yang Guo <guoyang2@...wei.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); \
} \
Powered by blists - more mailing lists