[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <z6bgilhyxp77u2v75aaw3ep5hzhdrf6jwgeholt74vvkozszrf@m2up5a3q6cx5>
Date: Wed, 16 Apr 2025 11:33:53 +0200
From: Jan Kara <jack@...e.cz>
To: Davidlohr Bueso <dave@...olabs.net>
Cc: jack@...e.cz, tytso@....edu, adilger.kernel@...ger.ca,
brauner@...nel.org, mcgrof@...nel.org, willy@...radead.org, hare@...e.de,
djwong@...nel.org, linux-ext4@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-mm@...ck.org
Subject: Re: [PATCH 3/7] fs/buffer: use sleeping version of __find_get_block()
On Tue 15-04-25 16:16:31, Davidlohr Bueso wrote:
> Convert to the new nonatomic flavor to benefit from potential performance
> benefits and adapt in the future vs migration such that semantics
> are kept.
>
> Convert write_boundary_block() which already takes the buffer
> lock as well as bdev_getblk() depending on the respective gpf flags.
> There are no changes in semantics.
>
> Suggested-by: Jan Kara <jack@...e.cz>
> Signed-off-by: Davidlohr Bueso <dave@...olabs.net>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@...e.cz>
Honza
> ---
> fs/buffer.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/fs/buffer.c b/fs/buffer.c
> index 64034638ee2c..f8e63885604b 100644
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -658,7 +658,9 @@ EXPORT_SYMBOL(generic_buffers_fsync);
> void write_boundary_block(struct block_device *bdev,
> sector_t bblock, unsigned blocksize)
> {
> - struct buffer_head *bh = __find_get_block(bdev, bblock + 1, blocksize);
> + struct buffer_head *bh;
> +
> + bh = __find_get_block_nonatomic(bdev, bblock + 1, blocksize);
> if (bh) {
> if (buffer_dirty(bh))
> write_dirty_buffer(bh, 0);
> @@ -1440,8 +1442,12 @@ EXPORT_SYMBOL(__find_get_block_nonatomic);
> struct buffer_head *bdev_getblk(struct block_device *bdev, sector_t block,
> unsigned size, gfp_t gfp)
> {
> - struct buffer_head *bh = __find_get_block(bdev, block, size);
> + struct buffer_head *bh;
> +
> + if (gfpflags_allow_blocking(gfp))
> + bh = __find_get_block_nonatomic(bdev, block, size);
> + else
> + bh = __find_get_block(bdev, block, size);
>
> might_alloc(gfp);
> if (bh)
> --
> 2.39.5
>
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists