From patchwork Tue Aug 13 08:46:04 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: 13761567 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 9E99DC52D7C for ; Tue, 13 Aug 2024 08:42:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2AAE76B00BD; Tue, 13 Aug 2024 04:42:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 233086B00BE; Tue, 13 Aug 2024 04:42:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0AE646B00BF; Tue, 13 Aug 2024 04:42:24 -0400 (EDT) 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 EF3EF6B00BD for ; Tue, 13 Aug 2024 04:42:22 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id A4F0B406F5 for ; Tue, 13 Aug 2024 08:42:22 +0000 (UTC) X-FDA: 82446580524.04.7C20EB7 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf17.hostedemail.com (Postfix) with ESMTP id A70E740024 for ; Tue, 13 Aug 2024 08:42:20 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mxpHjX6D; spf=pass (imf17.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723538506; 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=D5AsasRwZQtsJ8WKNjhf3ld5eMYx0ChSPMHeS3q+gqs=; b=x2eylKXCkuNNUM53LtEE0itezp9NDHm11jbuztQe0+IeoHxL/UM5KjOB3t++88kmcmAkUs ISpvqHAA25p1CANkiHOJh4ujq6Y4P6Ia4yViohWMWOFUmtljdUhkavfH5bEI/25cOfdgTy ttIQPm3+UAqfVbedCzB6tK08eSn4iec= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mxpHjX6D; spf=pass (imf17.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723538506; a=rsa-sha256; cv=none; b=4USO1Z6yo1leeN1OeR48wOLmHO2VC/sW2OjRazLS37DhX4/pzaaFCKXuUv+7vQqCq2V1qT xNHHiCl0I/4Y+MJujzZc/gsThDXvYEKqAW65BS9n/9B2fEe3xMRLfudAoY+hBdHvyepEX3 Lw5+lasy2+ccIJKl+bkvyRbKJNfqSzY= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 1BAC2CE1232; Tue, 13 Aug 2024 08:42:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 053CBC4AF15; Tue, 13 Aug 2024 08:42:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723538537; bh=xc1UgoycHzcMSLrT87O9Jysr++5t0k6ZYOyK9RWDCgc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mxpHjX6Dipw7WJGW9x/CzrdZjjx3J2swcfh5GtuduL50FV7HjHZSe+ro4MjvMCUyA PcMTPHKXGAN19nP01URDq5t9Iau8uj9OiNhIq5TxCQZY2yn6OSUljkeCv2ZtSh4LTj u04TdFn20fcNRN0p5vZ+wuShi2vcaTbze1tOo/JWqVvoHy8OyGilw1ZzeTE1cSskNZ 4JHIFSL7oKHyZIeEv5GStb+5Rn3G3hQdbzyFDPCE5QIgtRD1iQFYBOSbujz//injjQ G8i7trnT5ZET9efzMHq8kwGTqu7jjEMeVLgB09lYALGXQLbWfO/eCg9vElqgQcPykN cD7JvS6W96uRA== 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 v6 18/21] mm/zsmalloc: introduce __zpdesc_clear_movable Date: Tue, 13 Aug 2024 16:46:04 +0800 Message-ID: <20240813084611.4122571-19-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240813084611.4122571-1-alexs@kernel.org> References: <20240813084611.4122571-1-alexs@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: A70E740024 X-Stat-Signature: zpxbdfjgoscdy31e4wc5rd18ugr34srr X-HE-Tag: 1723538540-481771 X-HE-Meta: U2FsdGVkX1/O4VzOftTky+1oCSlt3yWW2VaO9ngxDWAnPaGakHeMYI3u2G9lgGnBOjPZU2/Rye9soYjFklGiyCh5YDLURN2TPcbhQZ6V30szOe5wpsR/jLd4v9HRgaNy8uALdN/RXmeTp1yn2Ui42Mwj/qOdun1+uK11PxVs59O7e79hr+uyZD1AzlPWCt5ZynvIhvTNrb4qrAwg57RXfxxQiHuUqV0u+Yft79r3dJnnM3Ow25KG0iCB7dN07tzBFRAp0+QLTWTHsZMqmUZx0a+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l/lzxRZAs5T1bT6m1 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 a1834d36ccfc..747a2d410a35 100644 --- a/mm/zpdesc.h +++ b/mm/zpdesc.h @@ -115,6 +115,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 8553542edacb..64b9ea011111 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -840,7 +840,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;