From patchwork Tue Aug 6 02:23:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexs@kernel.org X-Patchwork-Id: 13754335 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 8F62BC3DA4A for ; Tue, 6 Aug 2024 02:19:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1B36D6B0092; Mon, 5 Aug 2024 22:19:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1626B6B00B9; Mon, 5 Aug 2024 22:19:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 002E56B00BB; Mon, 5 Aug 2024 22:19:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id D49636B00B9 for ; Mon, 5 Aug 2024 22:19:07 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 8DB50A1D04 for ; Tue, 6 Aug 2024 02:19:07 +0000 (UTC) X-FDA: 82420213134.22.A70BD4C Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf07.hostedemail.com (Postfix) with ESMTP id 93BEF40002 for ; Tue, 6 Aug 2024 02:19:05 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=GJ4wy4eK; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf07.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=alexs@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722910695; a=rsa-sha256; cv=none; b=bf5RKBEck+poq1h6vPYKRAodUHpI8M9c55fZTJvoMmcsYOMQXIaBqWPbrBUMZODZMvKJ73 kyqUFEJlohBdmDc0JGRWHiSTJ51nhOzlJ/ZO9LsUk8kQHlJ5ZkYqcThPwKyFEHJShlFkPh v2pgtp25f0DWprzPQ6YGfpqE13B3dg4= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=GJ4wy4eK; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf07.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=alexs@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722910695; 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:in-reply-to:references:references:dkim-signature; bh=uBWX8k6Fc/SXtf9GHhfeSJeVUi+MHdfG0m92u/YR1lU=; b=Mlb6Qvm8Us3AEiJAH1U2a8vSWaEs2Sfnd5nQ1lBXqHDXEiJ4/Kp9/4vI3iCQSG0p7RFJAr i9LZ9fAucVfetRmAXcgUmPgkVfPBLjCAtEddPF63olLAP7HJSn9ZoVgHqbGsGYzwUXKJBm pyBbjSKQRwjwm6vlco3MOABi1/grnNM= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id D77F4CE0BBD; Tue, 6 Aug 2024 02:19:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C9B0C4AF0C; Tue, 6 Aug 2024 02:18:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722910742; bh=gO5yNLlLwsCfZqvTP2RVzms7OfZiyAMCAW6p5U5JaUg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GJ4wy4eK4qW7kRgbBTYCXZtWl8AumXoo42ILqjgP/YgqVhQuJCoip2c2h9Nz7JxV/ Y+POjNOqPqoYGnzttSb8PWI6rk2905cz6tpbM6fPqqHkcZAESSGqoduGWf9qcJC5uy fdj1He4fUsZ+XfS2s6kIB6S2Vcb7Bxox8DH2QYPvI1HsZZTySzchbOkR4W7LNgBlzA VMUbijwI55mKeVswvC6FPobdGxl25MGMZkfiag52ZV5yHMqh0c+r1IyRmuyzBvSkot lmUQeCUa0om8RhsQedOxNuawS8lii5OvwvYr7I3/LzmSnTIKMnm+jenS/B2PwIE8So gKZLae5Vm8ryQ== From: alexs@kernel.org To: Vitaly Wool , Miaohe Lin , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, minchan@kernel.org, willy@infradead.org, senozhatsky@chromium.org, david@redhat.com, 42.hyeyoo@gmail.com, Yosry Ahmed , nphamcs@gmail.com Cc: Alex Shi Subject: [PATCH v5 18/21] mm/zsmalloc: introduce __zpdesc_clear_movable Date: Tue, 6 Aug 2024 10:23:05 +0800 Message-ID: <20240806022311.3924442-19-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240806022311.3924442-1-alexs@kernel.org> References: <20240806022143.3924396-1-alexs@kernel.org> <20240806022311.3924442-1-alexs@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 93BEF40002 X-Stat-Signature: bufmrdfoqmkh97hsjqc6kw8duaysuqwd X-Rspam-User: X-HE-Tag: 1722910745-93501 X-HE-Meta: U2FsdGVkX188jkNdHLIDDc2OV2sHZFB0t03jDSteqm6oJywyWtIljbzf0bLYX3IOsomw3t0ZOcI4wZOiU5yXKRnKQ4CnA5AIc6ZM+K+HH2uW1zubaHcwlGbqZ5lq+bY+PA4aDp9QlEsESDug67BfEpZ2M/k6NJMr0S4Jv7apkM1oNMxJMJROFKlkMSRyLgL7PEMLDsBSO93vr+S9csUIM1PrtT40Ejf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9f4t3n0fXDDAI+uxBhrTQBmPtDXRrQLdaChs2Oj 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: From: Alex Shi Add a helper __zpdesc_clear_movable() for __ClearPageMovable(), and use it in callers to make code clear. Signed-off-by: Alex Shi --- mm/zpdesc.h | 5 +++++ mm/zsmalloc.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mm/zpdesc.h b/mm/zpdesc.h index 640f33b5c8bd..1ab47faed49b 100644 --- a/mm/zpdesc.h +++ b/mm/zpdesc.h @@ -114,6 +114,11 @@ static inline void __zpdesc_set_movable(struct zpdesc *zpdesc, __SetPageMovable(zpdesc_page(zpdesc), mops); } +static inline void __zpdesc_clear_movable(struct zpdesc *zpdesc) +{ + __ClearPageMovable(zpdesc_page(zpdesc)); +} + static inline bool zpdesc_is_isolated(struct zpdesc *zpdesc) { return PageIsolated(zpdesc_page(zpdesc)); diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index e2cfee57a39a..7c7432a00a07 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -826,7 +826,7 @@ static void reset_zpdesc(struct zpdesc *zpdesc) { struct page *page = zpdesc_page(zpdesc); - __ClearPageMovable(page); + __zpdesc_clear_movable(zpdesc); ClearPagePrivate(page); zpdesc->zspage = NULL; zpdesc->next = NULL;