From patchwork Mon Jul 8 06:33:39 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: 13726206 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 3131FC3271E for ; Mon, 8 Jul 2024 06:29:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 880016B00B8; Mon, 8 Jul 2024 02:29:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8314D6B00B9; Mon, 8 Jul 2024 02:29:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A9E66B00BA; Mon, 8 Jul 2024 02:29:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 45CD86B00B8 for ; Mon, 8 Jul 2024 02:29:51 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 036E1A1150 for ; Mon, 8 Jul 2024 06:29:50 +0000 (UTC) X-FDA: 82315609782.01.120D9E1 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf08.hostedemail.com (Postfix) with ESMTP id 67ACA16001F for ; Mon, 8 Jul 2024 06:29:49 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=jWOtxdXd; spf=pass (imf08.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 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=1720420174; a=rsa-sha256; cv=none; b=RPUk7UXrmNuX93eL+E+kfAJnNxycGYK5Y6H9upWPEfYys/lGiokLjauplblVdvKSItHVHJ b90fDL6XUqShffmUg4ZyWhhgA+Gpkp/BAc5Rh5Va/r4zinXeH8C8y2d3sWFLpkqHLv5og+ UQ4UwEiKDNB7tuTBRm465VzrY6Sx56E= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=jWOtxdXd; spf=pass (imf08.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 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=1720420174; 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=xRpGx7pbvCfhSG5wQGxOYh2B5tfxNNOrim9iy+8VdlU=; b=K48m3knzy7gTp27tWe9O5nl31Dp+SX9BDDSiwMY3PQ8cGzaOgdstx9MfqyILm3Rf4hlVM8 iYhXBe9vW+GNWam0DSEgDracgw7koALkPgnrjAlfJ3sBsJe5IIfL75/18ykHF8PDobWtVn bDzqPrWrA1wdWRTno6/FVV3SHQPRg7o= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 9F9ED60ACD; Mon, 8 Jul 2024 06:29:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66EF4C4AF0C; Mon, 8 Jul 2024 06:29:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720420188; bh=H24xLCJMLoMGxtoL02JioPie/ckhzBt773ZzPhU2CSg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jWOtxdXdW3pAl2WmrOj1bOnrw+gHOrlhH3zXwNH4eP7cA0yNru3LwOhi4tzn80Rbx cVD76ITdy6l5ySTmIFusfFSQBHDl8J2VB4jbf3A54xhBGhKvlLpl8LWFsbDN6yqiiW s2n8BudgTiO2TsxYnXK3NQY9OpoBTNB5iGwrGOdRxzmGT8ouZKbT+91GBd49d5aNq4 l09v7kThk+LyOa6yi3Rt5tTRG8o5GcSjP6xGzOshEy/RdkCcZhw0faZV7UOxRLyCzt dixnOcM1H9x7wG3WYr7joJy86clgn16ANgHuJ4rzG9xZ0sTJu/7N4idkcziq+vkXnp VaalbA+QoqWpg== 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 v3 18/20] mm/zsmalloc: introduce __zpdesc_clear_movable Date: Mon, 8 Jul 2024 14:33:39 +0800 Message-ID: <20240708063344.1096626-19-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240708063344.1096626-1-alexs@kernel.org> References: <20240708063344.1096626-1-alexs@kernel.org> MIME-Version: 1.0 X-Stat-Signature: y97kmg453fnfazxg9p8rykefm8pgjpc6 X-Rspamd-Queue-Id: 67ACA16001F X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1720420189-908729 X-HE-Meta: U2FsdGVkX198TLNAj5GmznuOfglxQPxgXyY6ZQMgGScPRd0PUdz1aDD6qoOSSK6RZJWm8/9h4Q9A0m9/ff9Pl7UNyTh0a5YjPXlB9kq+75lPi6FnJ6cTJgBBLbvq5TKfsXJPKtlN7ra10OzXQ/Y5ng+O9x5p15DbeGHDKOlClI35NRgTPoG6oEVPK9kFW81YuxV5f0wYD+3RCxXzS8G1v2KGm3w0PzLA2XG+72C13VvUaoFzSP02d29bvYfg+hP635rE7jV2rFox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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 (Tencent) Add a helper __zpdesc_clear_movable() for __ClearPageMovable(), and use it in callers to make code clear. Signed-off-by: Alex Shi (Tencent) --- 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 f64e813f4847..5db4fbe2d139 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 bb8b5f13a966..e1d3ad50538c 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -846,7 +846,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;