From patchwork Fri May 24 03:38:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yosry Ahmed X-Patchwork-Id: 13672650 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 671D0C25B74 for ; Fri, 24 May 2024 03:38:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A1A6C6B0098; Thu, 23 May 2024 23:38:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9A3866B0099; Thu, 23 May 2024 23:38:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7A7046B009A; Thu, 23 May 2024 23:38:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 5A0466B0098 for ; Thu, 23 May 2024 23:38:28 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id C57D51406CF for ; Fri, 24 May 2024 03:38:27 +0000 (UTC) X-FDA: 82151881854.01.0DC2354 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) by imf20.hostedemail.com (Postfix) with ESMTP id 09A2F1C000F for ; Fri, 24 May 2024 03:38:25 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=sLp4trXd; spf=pass (imf20.hostedemail.com: domain of 3sQtQZgoKCEI2swv2elqihksskpi.gsqpmry1-qqozego.svk@flex--yosryahmed.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3sQtQZgoKCEI2swv2elqihksskpi.gsqpmry1-qqozego.svk@flex--yosryahmed.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716521906; a=rsa-sha256; cv=none; b=g+Fw223wz09MYOcMTGJZiC714btoGx5qTmRIeQMpQ0MSgWoo94PA+oRcgO+48KtQXuKGOb Svn7bOF+rl6g1lN1nusBnuTqy+/dCGqBtLExVGc9UXshbVH8hkRJVMzyiOc7WvXWCSch36 5bfK/5DbEnBhqd/2hsXUarTBqR9zZhI= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=sLp4trXd; spf=pass (imf20.hostedemail.com: domain of 3sQtQZgoKCEI2swv2elqihksskpi.gsqpmry1-qqozego.svk@flex--yosryahmed.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3sQtQZgoKCEI2swv2elqihksskpi.gsqpmry1-qqozego.svk@flex--yosryahmed.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716521906; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=UZUibxVL0p5mU+STizIl+rgA3qpvNVqFQOc0JP+qiMU=; b=S+se6VQkzc0mD5TKWICSvpSqpWUDiqOyFcC8wDNwNd/TBGwzEJoEr1j7+76mAG5O58EfVV 0P3Iw5YJU+cKCZhgKuh4nK3GJqldlOfTak00GdYLLWh/4b7UYH0jbsbMkGFJ+uMtoEPzGX IMgr+/3b8w83Sopl+hF/xDCsSp8aM0I= Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-62a084a0571so7706877b3.2 for ; Thu, 23 May 2024 20:38:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1716521905; x=1717126705; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=UZUibxVL0p5mU+STizIl+rgA3qpvNVqFQOc0JP+qiMU=; b=sLp4trXdIaAdWzoLnsFMjlVeCK+kG8PJnV4leuIUpAWj7vMf9NSu1vkhqTYvoK5hGK l+hY886kna1XuySlbDA7zGVUcOajEyJYMq9YuGyFEXhwKCXugEworHl3LBHwzhaLeog8 td16UsmN07wwAXdZMx0Lo2LCEQowEe1V627OFR070fCJp/CeNqY2mb09jGoRPZH5WIkQ qTkGdD7XIF/GVab6g1HOOR9OswR6dy4QMU8fogxrrm7g5vAlNdYFPC0G+twnqgm/4mU/ ghp/abUxp4zm51wDI4awS8rAWv/OO45c6YFN/ctUntw4IrVS/+kZTMFS8sf68mTmEBfU lWvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716521905; x=1717126705; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UZUibxVL0p5mU+STizIl+rgA3qpvNVqFQOc0JP+qiMU=; b=bcWEKr9Ke/lXwg50PnpNDJrnFL7idzfD0zUXnp7nagsQckGD2ttGfQ8JUixVCOBJ2T oL8XXVJKhXCwwVXiA5E5EhfSHCCnew2DSzDhqgMauwamMDW8sA3zFrOSPHLng0MxEJNF d1blPLOZ1lrHrxZdsqBXFxBgQbNXMuTI8LGRb7gYQtmo97sHZe/0BBtSl7zW5V/Zg3Vq /AXWOO3UfrCyguPHDJ1BWowH7MCCb+Rf8Cgq7WWo6AgiF0lcJVT1ks9xcj8heM+AWZSr FvWiA434bGGegC3e2wxOyrU6f2bV0eUwaD5grr+s5pf5PoZRYMQiDodyjmWqflkd8DiB 1a4A== X-Forwarded-Encrypted: i=1; AJvYcCUwCb59/4eaiXU8vcTBU/FmMI6PHiza1B6RgAfH7qXFT2kgvEcBcriLmhLjbMFWbXhL4MbGioC0voyR4maKhzO0KZw= X-Gm-Message-State: AOJu0YzakhdgLnaMpWr+AB05fJTMTSPUCiC5gK4QaimJVD278nr38/1v 5xdSWeNr1o+RimkSylAoZRe0/N/1hytU9fm99GwVyo7nfWkj4DHyq9kwUtB2YyLmVwCNvWlC8M3 GwvQEUkKAvkYhFs1sAA== X-Google-Smtp-Source: AGHT+IGWEmQAlnhdEPzZ6uPO7aNv6DYve/yJL32x0ERZjFBY1Aa9d8TiVJtvgVdN3KsvGrSvISEQ8eqaozyd47PG X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:29b4]) (user=yosryahmed job=sendgmr) by 2002:a05:690c:368d:b0:61b:ebab:ce9b with SMTP id 00721157ae682-62a08e60886mr2541307b3.3.1716521905191; Thu, 23 May 2024 20:38:25 -0700 (PDT) Date: Fri, 24 May 2024 03:38:17 +0000 In-Reply-To: <20240524033819.1953587-1-yosryahmed@google.com> Mime-Version: 1.0 References: <20240524033819.1953587-1-yosryahmed@google.com> X-Mailer: git-send-email 2.45.1.288.g0e0cd299f1-goog Message-ID: <20240524033819.1953587-3-yosryahmed@google.com> Subject: [PATCH 2/3] mm :zswap: use kmap_local_folio() in zswap_load() From: Yosry Ahmed To: Andrew Morton Cc: Johannes Weiner , Nhat Pham , Chengming Zhou , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yosry Ahmed X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 09A2F1C000F X-Stat-Signature: g7jqiq676zfrie7pxz657hbokfci6dyo X-HE-Tag: 1716521905-536284 X-HE-Meta: U2FsdGVkX188/ZbHzrLGZHKhcbESOcANJ+odHgry2NNrltFvN5FEjmfVuempl7vYhkIz6P6xq0h/8hli2oeRxGxu/O6tIWYMTEhaziq4yJG7X7AYprhL8rDjp9fW0AHWJDebzcgAuUlAlb8FeXt+JvbZBqitCS5mshGJ7O3sQL+ETZdkSgShAQYmY2PW11sblZT1owoGFqhlPkBZ5lW5n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Z5eJHs4O0xEAJ01zpRIASwnz9W+RuHpAFYlF4KyHAHLw6J4dkKNDiA/x8vMmghrXCKYFSiMvswjbe2xl8ePz9Qzjh/XJQxiSb19skSBRfXz3Osw/Ql/uQIkyImKp1D12LVKBQX/fn3qfpgHR01MJbVH0h6+fs0oGzszELnU0yjb6e3wcI8bzlXq1eHJhrKrWQJ6LbdcGlLMKUw5HCDV/zanNsbI+B+ZoFxMKAm0SUlzGUYct4W3mHRUJX+xcLNNerRuOtRIRLxB3NTdwYiOSs7trjCMkkJBGjDE45BUCkyNNFruGQANnaE2JNyLiz1pql9csx1mtChKQPdS/4V6l23D/yUE8v5l9qgOnyeG1X2xx6T6Ka8RqaT9Kogi34LskEGnyFDet9UFVgaA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Eliminate the last explicit 'struct page' reference in mm/zswap.c. Signed-off-by: Yosry Ahmed Reviewed-by: Nhat Pham Reviewed-by: Chengming Zhou --- mm/zswap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/zswap.c b/mm/zswap.c index 3693df96c81fe..bac66991fb14e 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -1551,7 +1551,6 @@ bool zswap_load(struct folio *folio) { swp_entry_t swp = folio->swap; pgoff_t offset = swp_offset(swp); - struct page *page = &folio->page; bool swapcache = folio_test_swapcache(folio); struct xarray *tree = swap_zswap_tree(swp); struct zswap_entry *entry; @@ -1582,7 +1581,7 @@ bool zswap_load(struct folio *folio) if (entry->length) zswap_decompress(entry, folio); else { - dst = kmap_local_page(page); + dst = kmap_local_folio(folio, 0); zswap_fill_page(dst, entry->value); kunmap_local(dst); }