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: 13051788 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F8ABC43219 for ; Tue, 22 Nov 2022 01:33:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B0BBF6B0073; Mon, 21 Nov 2022 20:33:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id ABB1A6B0074; Mon, 21 Nov 2022 20:33:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 983206B0075; Mon, 21 Nov 2022 20:33:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 89E2C6B0073 for ; Mon, 21 Nov 2022 20:33:55 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 5EB8B14090A for ; Tue, 22 Nov 2022 01:33:55 +0000 (UTC) X-FDA: 80159356830.20.3DF8ECC Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by imf17.hostedemail.com (Postfix) with ESMTP id 0381540002 for ; Tue, 22 Nov 2022 01:33:54 +0000 (UTC) Received: by mail-pl1-f175.google.com with SMTP id p21so12199257plr.7 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=ZQKTFwSMLzB4qeQLavY8+A8QH+jPkLjMTf1yD2VSa5q12RXKGJvaqyXh3XaoyQpjsz cABbZatEZifc16ha6twqYI2SIf70hxYSgjQJ+922Z0FKUx3TYq9Mjl9CpgrmCqFuqaKI zrc/p+eCTTiHZ0/eaakd6UUU9vSkOJGYRkYj3qmuT+WugQ4fBt+NRd735Jncn85WntaK JF4dQrnxVxUl5SWZQ9hH2I2Ir58Sb/wZttTQuA+mBhikL7ujOwdToZGYbBOVLcs4bJcS FwAbW+1FB8aSmLf3BkvDUTOlDKx9I59TZEk1Wi8AhBSTPl5ERQkiUI60hDXV4DLQ28f+ xGDw== X-Gm-Message-State: ANoB5pn5zO+ai2ej11+6FSm/9mDUvNXE75gPy23x0uq1E6lwgwnqv3rB lzlJq5JzC+7lJjhaYu579Gz30w== X-Google-Smtp-Source: AA0mqf6zJWogoV5nxKMvF6nyC8Z6yvR1VPsIHS4jgbNLHnlHUKp6nQ/kja+nbliKuq1b2daPYDrBaw== 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669080835; a=rsa-sha256; cv=none; b=7l92jcFY6rV5VjLzdfZ5fDcmxi+mKsqftL9UFfb/23AFC05GFhKLXmECTZtvGV72nxnhBY 4m7ajxcTtjsN4a278ts15gyj9nkJq2CURCeKKLq4Njv04fF8mNZsk/yYMdWIGVTpsOoahL 3neyAsvjpfsIeovskHzujRMS1nVfwDQ= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=YDCgA5iL; spf=pass (imf17.hostedemail.com: domain of senozhatsky@chromium.org designates 209.85.214.175 as permitted sender) smtp.mailfrom=senozhatsky@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1669080835; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=SUuSpc6C+EWicKThxRXH7zHFoDctbTavto9TGkNgwqg=; b=bL/x0qkRCaW5pxkgHj3K4ME1KZFzNqQ0seGl7/57X0vabPcDq0u65I3+NBhmhc/5kWfiT5 S4f/UioBJZpj5LKf6ISX0ARaY8/TXf0Nn5cDPyrIrWvGmmWoc+OobU5yeNP7spAjz7MTrt q93e8njW/UEqxpoMCOqLj3/EqOEIlLA= X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 0381540002 Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=YDCgA5iL; spf=pass (imf17.hostedemail.com: domain of senozhatsky@chromium.org designates 209.85.214.175 as permitted sender) smtp.mailfrom=senozhatsky@chromium.org; dmarc=pass (policy=none) header.from=chromium.org X-Rspam-User: X-Stat-Signature: 4uwxhznz4sp7wt6ob4xq8japj15be489 X-HE-Tag: 1669080834-114873 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: 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;