From patchwork Fri Nov 5 20:45:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12605797 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 448FCC433EF for ; Fri, 5 Nov 2021 20:45:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 118B66136A for ; Fri, 5 Nov 2021 20:45:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 118B66136A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 95FE89400C0; Fri, 5 Nov 2021 16:45:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8E7FA9400B3; Fri, 5 Nov 2021 16:45:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7AFA79400C0; Fri, 5 Nov 2021 16:45:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0248.hostedemail.com [216.40.44.248]) by kanga.kvack.org (Postfix) with ESMTP id 646379400B3 for ; Fri, 5 Nov 2021 16:45:11 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 260A076BBA for ; Fri, 5 Nov 2021 20:45:11 +0000 (UTC) X-FDA: 78776056422.15.74FD4AA Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf18.hostedemail.com (Postfix) with ESMTP id D37CD40020A2 for ; Fri, 5 Nov 2021 20:45:10 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id F3C8761362; Fri, 5 Nov 2021 20:45:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1636145110; bh=+cFhMeIkiQ0YyKzyFTisK6aWa7VYMwkftw6QfEjSUQ4=; h=Date:From:To:Subject:In-Reply-To:From; b=InqgpbBfpBs8PKNuzjJGvGsQDI9/OiyfL3560mEyueLvQRR0BMwClekc1ACo/b8G/ 81RgOoA7cTwtzhJXpups9e5IQ6HBJ7bqnkexiYxFE7YaV95TFibZo36Dsf0a+0IJbU /NvMwVNJ0zR3XjOBFenVsMYdanSlzwe+F2n6RdwM= Date: Fri, 05 Nov 2021 13:45:09 -0700 From: Andrew Morton To: akpm@linux-foundation.org, jaewon31.kim@samsung.com, linux-mm@kvack.org, minchan@kernel.org, mm-commits@vger.kernel.org, torvalds@linux-foundation.org, ytk.lee@samsung.com Subject: [patch 200/262] zram_drv: allow reclaim on bio_alloc Message-ID: <20211105204509.9t6bFXpJT%akpm@linux-foundation.org> In-Reply-To: <20211105133408.cccbb98b71a77d5e8430aba1@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=InqgpbBf; dmarc=none; spf=pass (imf18.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D37CD40020A2 X-Stat-Signature: ymtzsw6ytpwk7jak6fnzzmzoyq9k6xpm X-HE-Tag: 1636145110-789732 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Jaewon Kim Subject: 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. Link: https://lkml.kernel.org/r/20210908005241.28062-1-jaewon31.kim@samsung.com Signed-off-by: Jaewon Kim Reported-by: Yong-Taek Lee Acked-by: Minchan Kim Signed-off-by: Andrew Morton --- drivers/block/zram/zram_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/block/zram/zram_drv.c~zram_drv-allow-reclaim-on-bio_alloc +++ a/drivers/block/zram/zram_drv.c @@ -587,7 +587,7 @@ static int read_from_bdev_async(struct z { struct bio *bio; - bio = bio_alloc(GFP_ATOMIC, 1); + bio = bio_alloc(GFP_NOIO, 1); if (!bio) return -ENOMEM;