Skip to content

Commit

Permalink
zram_drv: allow reclaim on bio_alloc
Browse files Browse the repository at this point in the history
The read_from_bdev_async is not called on atomic context.  So GFP_NOIO
is available rather than GFP_ATOMIC.  If there were reclaimable pages
with GFP_NOIO, we can avoid allocation failure and page fault failure.

Link: https://lkml.kernel.org/r/20210908005241.28062-1-jaewon31.kim@samsung.com
Signed-off-by: Jaewon Kim <jaewon31.kim@samsung.com>
Reported-by: Yong-Taek Lee <ytk.lee@samsung.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jaewon Kim authored and Linus Torvalds committed Nov 6, 2021
1 parent d2c20e5 commit 4aabdc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/block/zram/zram_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ static int read_from_bdev_async(struct zram *zram, struct bio_vec *bvec,
{
struct bio *bio;

bio = bio_alloc(GFP_ATOMIC, 1);
bio = bio_alloc(GFP_NOIO, 1);
if (!bio)
return -ENOMEM;

Expand Down

0 comments on commit 4aabdc1

Please sign in to comment.