From patchwork Tue Nov 22 01:33:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 24105 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1942139wrr; Mon, 21 Nov 2022 17:36:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf4CLJFpTzIljicNlpaMI/DGH4yrQcQz+GkxmFQEgbIK+Gk9iFYypQCteitmKrGA4AqfUkv+ X-Received: by 2002:a17:906:130b:b0:7ad:92c5:637a with SMTP id w11-20020a170906130b00b007ad92c5637amr17762799ejb.87.1669080968416; Mon, 21 Nov 2022 17:36:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669080968; cv=none; d=google.com; s=arc-20160816; b=MAUGoaLLujsDMF35GTz2SV31SWqZsbVxhTm3ZTAxM7Ke3xdOFDwhZ8qZp/IMEsBQbL DHaYuVRxI/wz8RbPa6j6Rc0N6Kd6FdynS1UE2yL8FcWMGj+Qslj8YDgDK3cF/foecBqf NWM9h6zq2xCQCzSqxYR04YpaKsNZc4K6Qi+zEfE3397H9uS/TCpdgn3HMcr1Ic2D+Nzz gj1yj0q8t9lWAMy+zxG5Ju9V5ZvJWo7kwfqYcBc5w0PWh0MKLxtg2kaXluph08Ahhnzd JBkO4px33B24UryvvwybXvzfrO/3stKZdQvwx/L+kwqVh7KdPG+sqDK2YOObT+g/1DIW JNaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=SUuSpc6C+EWicKThxRXH7zHFoDctbTavto9TGkNgwqg=; b=ItD9AR8ZeO2L7fTDo74SoWL6byLkZNd+zIfKu8zqLw0z9pB4gYlHg0KRnrZPoFjPUO kAokSzRXKwuIkvWZADPV4cqRMW7ZmBUrCt66SvPB0NzcxuqWWcyeba2FbHv54pL5jG5H QDTdoKT63nDv5t4LmUPmXp3ipzEm0jYnyS2VUzlvcFT0VDc8Z/rLKC7A8jO2H2vfRZ3w fWdgNQz/sTJnt4thXlEK2B6aeh6Sj1fUo/aehWBvu7R3YozTK7VBHUX1M7NU7O1phoea UC2S2/h0KmzaQvxUtvKamJLP22paKL5OLHFTqWdG6EFC+/e/FRAGWpCEsNUgEshf4Cl1 wuDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YDCgA5iL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i21-20020a170906251500b0078da3218b54si8045571ejb.171.2022.11.21.17.35.44; Mon, 21 Nov 2022 17:36:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YDCgA5iL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232281AbiKVBeI (ORCPT + 99 others); Mon, 21 Nov 2022 20:34:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232276AbiKVBdz (ORCPT ); Mon, 21 Nov 2022 20:33:55 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB4E8E06A8 for ; Mon, 21 Nov 2022 17:33:54 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id p12so12206135plq.4 for ; Mon, 21 Nov 2022 17:33:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=SUuSpc6C+EWicKThxRXH7zHFoDctbTavto9TGkNgwqg=; b=YDCgA5iLVRHov7CSFOzKyS+DAzYZ+IvJ03MR4Sv4SfTmjSMDNZHUUzCIBVUVmFT8uv JKfDo3JrYanqKt0RTFkeqYj5Xjo4DBrmSVvRJ5wQxDqvUUOAUjRDPWUmuyTB3qkQmO0D TfDuOJkS0w5/G+upcxqS2TjbFjppHHryLmxW8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SUuSpc6C+EWicKThxRXH7zHFoDctbTavto9TGkNgwqg=; b=cInZVNf3ukrSbid4Cp3Kz+O9DvwS4e+CYCGmxU2lPGc0vx0uMld1g2+9ANSj81OFxP 8AOb3Sas+gJuYiNhfcP/t5vZAwv1wNncSPbArb3uvndm4KCf38AfCHaJgA8zsjFyyBlh rImRJMA05wNWLtJmZdxtEV8+CcwL0KSFCtwYQve/C/raIg+GdP0f21D0eOqXN3cEgh3u A0UPoc0V2XjjqUJILvNSONJ6oMhZn/pWS/X/sQ4r4umEgfRj9UA+maIqv6ByCMWjDJ1Y 4iTlrKMkfLZKScrbDSXzwJVxWvuqjA0QnGIm6NWtll3mNRbVqkzUqQmr2mIVnQmYMiu4 pozg== X-Gm-Message-State: ANoB5pksXqUTgu74X1nm7t5yUY2fZot4PgyKoR5e7WeD0jdoJlF41G/T 8ovRIwDpOs4eCDmE4gpFGPzwqQ== X-Received: by 2002:a17:90b:364f:b0:218:b6d0:2529 with SMTP id nh15-20020a17090b364f00b00218b6d02529mr7023070pjb.75.1669080833896; Mon, 21 Nov 2022 17:33:53 -0800 (PST) Received: from tigerii.tok.corp.google.com ([2401:fa00:8f:203:9797:eb69:44a4:a633]) by smtp.gmail.com with ESMTPSA id z22-20020a63e116000000b0046ec0ef4a7esm8099914pgh.78.2022.11.21.17.33.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Nov 2022 17:33:53 -0800 (PST) From: Sergey Senozhatsky To: Andrew Morton Cc: Seth Jennings , Dan Streetman , Vitaly Wool , Nhat Pham , Johannes Weiner , Minchan Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: [PATCH] zswap: do not allocate from atomic pool Date: Tue, 22 Nov 2022 10:33:38 +0900 Message-Id: <20221122013338.3696079-1-senozhatsky@chromium.org> X-Mailer: git-send-email 2.38.1.584.g0f3c55d4c2-goog MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750158245311845787?= X-GMAIL-MSGID: =?utf-8?q?1750158245311845787?= zswap_frontswap_load() should be called from preemptible context (we even call mutex_lock() there) and it does not look like we need to do GFP_ATOMIC allocaion for temp buffer there. Use GFP_KERNEL instead. Signed-off-by: Sergey Senozhatsky Signed-off-by: Johannes Weiner Signed-off-by: Nhat Pham Signed-off-by: Sergey Senozhatsky --- mm/zswap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/zswap.c b/mm/zswap.c index 2d69c1d678fe..f6c89049cf70 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -1314,7 +1314,7 @@ static int zswap_frontswap_load(unsigned type, pgoff_t offset, } if (!zpool_can_sleep_mapped(entry->pool->zpool)) { - tmp = kmalloc(entry->length, GFP_ATOMIC); + tmp = kmalloc(entry->length, GFP_KERNEL); if (!tmp) { ret = -ENOMEM; goto freeentry;