linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: jack@suse.cz, tytso@mit.edu, adilger.kernel@dilger.ca,
	 brauner@kernel.org, mcgrof@kernel.org, willy@infradead.org,
	hare@suse.de,  djwong@kernel.org, linux-ext4@vger.kernel.org,
	linux-fsdevel@vger.kernel.org,  linux-mm@kvack.org
Subject: Re: [PATCH 2/7] fs/buffer: introduce sleeping flavors for pagecache lookups
Date: Wed, 16 Apr 2025 11:33:11 +0200	[thread overview]
Message-ID: <ns6d42ddh5m3tl3sxessebn6fjpydif6kjnjte6yrmogeahzux@5ssovrkhpnrz> (raw)
In-Reply-To: <20250415231635.83960-3-dave@stgolabs.net>

On Tue 15-04-25 16:16:30, Davidlohr Bueso wrote:
> Add __find_get_block_nonatomic() and sb_find_get_block_nonatomic()
> calls for which users will be converted where safe. These versions
> will take the folio lock instead of the mapping's private_lock.
> 
> Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/buffer.c                 | 9 +++++++++
>  include/linux/buffer_head.h | 8 ++++++++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/fs/buffer.c b/fs/buffer.c
> index c72ebff1b3f0..64034638ee2c 100644
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -1414,6 +1414,15 @@ __find_get_block(struct block_device *bdev, sector_t block, unsigned size)
>  }
>  EXPORT_SYMBOL(__find_get_block);
>  
> +/* same as __find_get_block() but allows sleeping contexts */
> +struct buffer_head *
> +__find_get_block_nonatomic(struct block_device *bdev, sector_t block,
> +			   unsigned size)
> +{
> +	return find_get_block_common(bdev, block, size, false);
> +}
> +EXPORT_SYMBOL(__find_get_block_nonatomic);
> +
>  /**
>   * bdev_getblk - Get a buffer_head in a block device's buffer cache.
>   * @bdev: The block device.
> diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
> index f0a4ad7839b6..c791aa9a08da 100644
> --- a/include/linux/buffer_head.h
> +++ b/include/linux/buffer_head.h
> @@ -222,6 +222,8 @@ void __wait_on_buffer(struct buffer_head *);
>  wait_queue_head_t *bh_waitq_head(struct buffer_head *bh);
>  struct buffer_head *__find_get_block(struct block_device *bdev, sector_t block,
>  			unsigned size);
> +struct buffer_head *__find_get_block_nonatomic(struct block_device *bdev,
> +			sector_t block, unsigned size);
>  struct buffer_head *bdev_getblk(struct block_device *bdev, sector_t block,
>  		unsigned size, gfp_t gfp);
>  void __brelse(struct buffer_head *);
> @@ -397,6 +399,12 @@ sb_find_get_block(struct super_block *sb, sector_t block)
>  	return __find_get_block(sb->s_bdev, block, sb->s_blocksize);
>  }
>  
> +static inline struct buffer_head *
> +sb_find_get_block_nonatomic(struct super_block *sb, sector_t block)
> +{
> +	return __find_get_block_nonatomic(sb->s_bdev, block, sb->s_blocksize);
> +}
> +
>  static inline void
>  map_bh(struct buffer_head *bh, struct super_block *sb, sector_t block)
>  {
> -- 
> 2.39.5
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR


  reply	other threads:[~2025-04-16  9:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-15 23:16 [PATCH -next 0/7] fs/buffer: split pagecache lookups into atomic or blocking Davidlohr Bueso
2025-04-15 23:16 ` [PATCH 1/7] fs/buffer: split locking for pagecache lookups Davidlohr Bueso
2025-04-16  9:32   ` Jan Kara
2025-04-15 23:16 ` [PATCH 2/7] fs/buffer: introduce sleeping flavors " Davidlohr Bueso
2025-04-16  9:33   ` Jan Kara [this message]
2025-04-15 23:16 ` [PATCH 3/7] fs/buffer: use sleeping version of __find_get_block() Davidlohr Bueso
2025-04-16  9:33   ` Jan Kara
2025-04-15 23:16 ` [PATCH 4/7] fs/ocfs2: " Davidlohr Bueso
2025-04-16  9:35   ` Jan Kara
2025-04-15 23:16 ` [PATCH 5/7] fs/jbd2: " Davidlohr Bueso
2025-04-16  9:38   ` Jan Kara
2025-04-15 23:16 ` [PATCH 6/7] fs/ext4: use sleeping version of sb_find_get_block() Davidlohr Bueso
2025-04-16  9:39   ` Jan Kara
2025-04-15 23:16 ` [PATCH 7/7] mm/migrate: fix sleep in atomic for large folios and buffer heads Davidlohr Bueso
2025-04-16  9:43   ` Jan Kara
2025-04-16 19:27 ` [PATCH -next 0/7] fs/buffer: split pagecache lookups into atomic or blocking Luis Chamberlain
2025-04-17  9:57   ` Christian Brauner
2025-04-22 11:25   ` Jan Kara
2025-04-17  9:58 ` Christian Brauner
2025-04-18  1:59 [PATCH v2 " Davidlohr Bueso
2025-04-18  1:59 ` [PATCH 2/7] fs/buffer: introduce sleeping flavors for pagecache lookups Davidlohr Bueso

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=ns6d42ddh5m3tl3sxessebn6fjpydif6kjnjte6yrmogeahzux@5ssovrkhpnrz \
    --to=jack@suse.cz \
    --cc=adilger.kernel@dilger.ca \
    --cc=brauner@kernel.org \
    --cc=dave@stgolabs.net \
    --cc=djwong@kernel.org \
    --cc=hare@suse.de \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mcgrof@kernel.org \
    --cc=tytso@mit.edu \
    --cc=willy@infradead.org \
    /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