lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed,  8 Sep 2021 09:52:41 +0900
From:   Jaewon Kim <jaewon31.kim@...sung.com>
To:     minchan@...nel.org, hch@...radead.org, akpm@...ux-foundation.org
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        ytk.lee@...sung.com, jaewon31.kim@...il.com,
        Jaewon Kim <jaewon31.kim@...sung.com>
Subject: [PATCH v2] zram_drv: allow reclaim on bio_alloc

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.

Reported-by: Yong-Taek Lee <ytk.lee@...sung.com>
Signed-off-by: Jaewon Kim <jaewon31.kim@...sung.com>
Acked-by: Minchan Kim <minchan@...nel.org>
---
v2: use GFP_NOIO only
v1: use GFP_NOIO | __GFP_HIGHMEM
---
 drivers/block/zram/zram_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index fcaf2750f68f..081e77d595d7 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -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;
 
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ