From patchwork Tue Jun 11 02:45:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yosry Ahmed X-Patchwork-Id: 13692773 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 BADAEC27C4F for ; Tue, 11 Jun 2024 02:45:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 427426B0093; Mon, 10 Jun 2024 22:45:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D77E6B0095; Mon, 10 Jun 2024 22:45:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2C7516B0096; Mon, 10 Jun 2024 22:45:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 0CCE46B0093 for ; Mon, 10 Jun 2024 22:45:22 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id AEB521C1DF7 for ; Tue, 11 Jun 2024 02:45:21 +0000 (UTC) X-FDA: 82217066442.19.A4968D2 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) by imf07.hostedemail.com (Postfix) with ESMTP id 07D5940013 for ; Tue, 11 Jun 2024 02:45:19 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=Xbd1LLAb; spf=pass (imf07.hostedemail.com: domain of 3PrpnZgoKCIsD376Dpw1tsv33v0t.r310x29C-11zAprz.36v@flex--yosryahmed.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3PrpnZgoKCIsD376Dpw1tsv33v0t.r310x29C-11zAprz.36v@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=1718073920; 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: references:dkim-signature; bh=Gw2fVBeEZMK663ax5icKG8q0wolcMNh0B93tTF9ptJo=; b=iQh7oQw6w5S70uiyMwc5AvJsNBCi1S+kDuH0T8lbEvs1Nr6QpdfhZzyzmykWpq5MyhnjY8 ye15QXqAagd3CoOymf8u+q/AnLb0AmcNkSp2XAJa5lPPb2LpvFw/ObkySCeTC/qeT8uGa9 jmGkENhHJqYsnNUOK1qwWZfIrbvH8Zc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718073920; a=rsa-sha256; cv=none; b=eOO6Vi90rNfJz3xN/DZ/KCdVs+R2kT2Xe1p05LNEDHglot9ei+R2SzUkufHeuN4OtDhrDb gZDPydB3jSTMlJFenvYnzJ6WJg2Ucf+fnYyHpH4T8220CKDAoymaAI6GknWtjZN02Jltvg dYjCE9OwZtfwWEnMi4WzcadwhNRqvVs= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=Xbd1LLAb; spf=pass (imf07.hostedemail.com: domain of 3PrpnZgoKCIsD376Dpw1tsv33v0t.r310x29C-11zAprz.36v@flex--yosryahmed.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3PrpnZgoKCIsD376Dpw1tsv33v0t.r310x29C-11zAprz.36v@flex--yosryahmed.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dfb17fb0fb6so4546480276.1 for ; Mon, 10 Jun 2024 19:45:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718073919; x=1718678719; darn=kvack.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=Gw2fVBeEZMK663ax5icKG8q0wolcMNh0B93tTF9ptJo=; b=Xbd1LLAbh+lT1xUBC1sOP67m8v+rb/4+aAMsUZv1DSfPSx7oQ7T2+6U1pywTy2SXSM ESPRFM5Q0Xd79wycOo9Oumra9Cok87j0+OLPtklpBoS5cvlVzzUin0zK8bkLkEJGpB2P fV9zfL+wghfqrNj0Z05aEzRBlh8ObC8rjBZW6ZJlF5EumH4maH6v0V341YyuXYj9Az3W 2LrtKxdLXyu3lmprhVjfZUUpZFB7QlESz0FHxVHwjE/ycyQLu+ojpDBWH97sBPdFcEaM pCbUmTCf2Hm4FL+c7Uf0iTKp8Pn8MtDc9T3wQFJMDHi85n5VI7Ngs6Wg+aoiGZt4CzB3 Gr7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718073919; x=1718678719; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Gw2fVBeEZMK663ax5icKG8q0wolcMNh0B93tTF9ptJo=; b=KR0WT4RC365yBPWB2Ln5DSIBmLpYST46yAxUIiGE4xTrV8Kq06k4cWIRUzGbZ92OZk 0QTeHr17zaFGJWu7VpUZV6pzrB0EIpzaTnr0ZuFPnaxx+kZsBqEbV+CLqR0yVeULA1/g mfEZ8v6Z8qly4Z712FvCVcBiM1orHIlesV3UWeX6ZdAWMVS5AQz62xJZOFCBu+s/ILQV 9MINfIzpSU632vsGOFymEqsROYyqb0S6ol7sEsMiE3JCAGyazI9xdrlCVfZwJ4JR6Ul0 ZVYAVOb1lY+/k1jWjXafPE77C6TOnjqDJhzK9WX27Mc0olOlKQ0W3pGYkxRGnLxDbCyv pGtQ== X-Forwarded-Encrypted: i=1; AJvYcCWwMgio6+P4EvR1pVFA3gb1YlQ3QkVO/u4arMVYTepi7rBbWDeeRR+AbRUuoSfFzOe4r7F5+6cZIM72jICfBBlzNqM= X-Gm-Message-State: AOJu0YwEW3aXVOb96F9bzC2M32pF2si2LWL6os4U9nM60rwl3JBFfxmM 0ymBe4k7il9JAXLgMm/QKlk9s1xjuy/Hz9gn8n9nilgVVbI/7QK1u04LP/IhebcAWKyHrusWnp1 PCCtJ2sV4vG1MWh0loA== X-Google-Smtp-Source: AGHT+IErIy1eYfnrABkOmVD9J5eyfhJx+kNkb/sBrRXlcmpYHfut7tKeNb+mtfB4c//I0/TnhK97XtmSed3uvDPF X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:29b4]) (user=yosryahmed job=sendgmr) by 2002:a05:6902:188f:b0:df7:8c1b:430a with SMTP id 3f1490d57ef6-dfaf64ea35emr3779077276.3.1718073918970; Mon, 10 Jun 2024 19:45:18 -0700 (PDT) Date: Tue, 11 Jun 2024 02:45:14 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.45.2.505.gda0bf45e8d-goog Message-ID: <20240611024516.1375191-1-yosryahmed@google.com> Subject: [PATCH v3 1/3] mm: zswap: rename is_zswap_enabled() to zswap_is_enabled() From: Yosry Ahmed To: Andrew Morton Cc: Johannes Weiner , Nhat Pham , Chengming Zhou , Barry Song <21cnbao@gmail.com>, Chris Li , David Hildenbrand , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yosry Ahmed X-Stat-Signature: b76i3ayt7bx5nbhtbzkojxi93cnktath X-Rspamd-Queue-Id: 07D5940013 X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1718073919-549411 X-HE-Meta: U2FsdGVkX18KPQqYHJeXiJgee2V5mm1IR386qFY3ShVtZ0yXD9Z1Rn+b4p2mcdXTehHDOCygO2w1Q1cGwQ07m5oad2lJ0DLMGpxWxVzj2ZaOKyCU6fkGNUsZgxVw1x/IiVAX85VvDrRbo7nsObWi23BJTrybFrvVc2yfsjr3d8cf/YOidm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Lwezgvpj9C1RUfiCxzKhlFTZ9KTGgEAAhI+o5+n149Q/0qqeuXVp+ZObZukFdMlpe5BPHFG5DNjvaMGe9GVorRpLEexQ6m5k9aD4Frw71zTTi7j9Xt03j44kUMavnYe+WOoQch15ArNfCJqtx31XQtBDOWy1LG1D6iy2Vra5m3+QKfuVEc+jGVqHA0jflrkpZGkOZIw7YZvIsW4S5gkOntEKf8OdN12woN7B6OC3G7/0rt3YPSfTPngzzmCR2HetGp5yYqslgNbYymm3i5Fxzemj8mmOBQle15X++sv/+faV6qfTjMypkESvRatdfDQXjKeb/JQQTPFA== 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: List-Subscribe: List-Unsubscribe: In preparation of introducing a similar function, rename is_zswap_enabled() to use zswap_* prefix like other zswap functions. Signed-off-by: Yosry Ahmed Reviewed-by: Barry Song Reviewed-by: Nhat Pham --- include/linux/zswap.h | 4 ++-- mm/memcontrol.c | 2 +- mm/zswap.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/zswap.h b/include/linux/zswap.h index 2a85b941db975..ce5e7bfe8f1ec 100644 --- a/include/linux/zswap.h +++ b/include/linux/zswap.h @@ -35,7 +35,7 @@ void zswap_swapoff(int type); void zswap_memcg_offline_cleanup(struct mem_cgroup *memcg); void zswap_lruvec_state_init(struct lruvec *lruvec); void zswap_folio_swapin(struct folio *folio); -bool is_zswap_enabled(void); +bool zswap_is_enabled(void); #else struct zswap_lruvec_state {}; @@ -60,7 +60,7 @@ static inline void zswap_memcg_offline_cleanup(struct mem_cgroup *memcg) {} static inline void zswap_lruvec_state_init(struct lruvec *lruvec) {} static inline void zswap_folio_swapin(struct folio *folio) {} -static inline bool is_zswap_enabled(void) +static inline bool zswap_is_enabled(void) { return false; } diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 1303ed01bb5e5..a811dfff10cda 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -8469,7 +8469,7 @@ void obj_cgroup_uncharge_zswap(struct obj_cgroup *objcg, size_t size) bool mem_cgroup_zswap_writeback_enabled(struct mem_cgroup *memcg) { /* if zswap is disabled, do not block pages going to the swapping device */ - return !is_zswap_enabled() || !memcg || READ_ONCE(memcg->zswap_writeback); + return !zswap_is_enabled() || !memcg || READ_ONCE(memcg->zswap_writeback); } static u64 zswap_current_read(struct cgroup_subsys_state *css, diff --git a/mm/zswap.c b/mm/zswap.c index b9b35ef86d9be..a8c8dd8cfe6f5 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -131,7 +131,7 @@ static bool zswap_shrinker_enabled = IS_ENABLED( CONFIG_ZSWAP_SHRINKER_DEFAULT_ON); module_param_named(shrinker_enabled, zswap_shrinker_enabled, bool, 0644); -bool is_zswap_enabled(void) +bool zswap_is_enabled(void) { return zswap_enabled; }