mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 05:04:09 +08:00
buffer: use bdev_getblk() to avoid memory reclaim in readahead path
__getblk() adds __GFP_NOFAIL, which is unnecessary for readahead; we're quite comfortable with the possibility that we may not get a bh back. Switch to bdev_getblk() which does not include __GFP_NOFAIL. Link: https://lkml.kernel.org/r/20230914150011.843330-5-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Hui Zhu <teawater@antgroup.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
e509ad4d77
commit
775d9b1053
@ -1465,7 +1465,9 @@ EXPORT_SYMBOL(__getblk_gfp);
|
||||
*/
|
||||
void __breadahead(struct block_device *bdev, sector_t block, unsigned size)
|
||||
{
|
||||
struct buffer_head *bh = __getblk(bdev, block, size);
|
||||
struct buffer_head *bh = bdev_getblk(bdev, block, size,
|
||||
GFP_NOWAIT | __GFP_MOVABLE);
|
||||
|
||||
if (likely(bh)) {
|
||||
bh_readahead(bh, REQ_RAHEAD);
|
||||
brelse(bh);
|
||||
|
Loading…
Reference in New Issue
Block a user