From patchwork Mon Jul 29 11:25:30 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: 13744741 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 4047FC3DA4A for ; Mon, 29 Jul 2024 11:21:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B16166B00B3; Mon, 29 Jul 2024 07:21:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AC7266B00B6; Mon, 29 Jul 2024 07:21:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 940B06B00B7; Mon, 29 Jul 2024 07:21:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 6F5F56B00B3 for ; Mon, 29 Jul 2024 07:21:22 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 260E71C1133 for ; Mon, 29 Jul 2024 11:21:22 +0000 (UTC) X-FDA: 82392549204.25.55460C5 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf23.hostedemail.com (Postfix) with ESMTP id 1D1AF140009 for ; Mon, 29 Jul 2024 11:21:19 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Zp7crNGG; spf=pass (imf23.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=1722252053; a=rsa-sha256; cv=none; b=GornukETBXgE2ZxD9n6oo00tglcab1Deeid3711T1DGWE1UEqcRKLfuS+XTb/Xq1U24t3n ee5h8IOWfiAXuYyW1W63j7lYTQJ70/BUP4SgVssuMoufzukbqZ9OJi6KpF7MSYX0VDUYoH MKr1j80kNH7rRRTsFgsYnZ5vmdNrd6c= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Zp7crNGG; spf=pass (imf23.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=1722252053; 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=GxEF9VZeHHCS8Akv9FK/sm+o7tLlAYtFkOntzK8ODB4=; b=fReRCma0d58MGUh13q/3euQUd3RjW9si10VsRUQ3FMRtKeKzieKHNy19bFZxUnbKYjkmAo rx7r02KeVjqLm6L3p8VH0Z6jOrnjOs0syCuvgQo0YVWXcHZ6XSbcWzyHdmdAmiYoqLGpd6 +T4yjicR3dsu6WCN72FbcbhIe9zWRqQ= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 32D06CE0AEB; Mon, 29 Jul 2024 11:21:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABF10C32786; Mon, 29 Jul 2024 11:21:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722252076; bh=WC1zVtU8HoKTgwyGG1oBnxz/TQGKFBik73v06jNNZ/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zp7crNGGj8tFuQ+KKFsA4x+ASc1R4kKGuxUypiz+7x5QReIhm0x2m4fG7Jjw/wU+2 8asbu0zMOQYtzwO97Hj1gyyuvmxrSeh3uHcz1xtom7DMR1m4wA6K2gKnUWMi44cLC9 4RsUSKHEarV7mkuTqCVzvlvPMh9hpvgdyVTqCbqSIzcbTBHmMMk83DNuMPyA1s37Yw HgeUQ654r3M6IAG2fRbj+a5gogYPOcjTax9pkat/I3+H6NocMAmoG8dLxWd6Ke1Fmd TAyY1llDoLoeJjnLyQASqhE6ahUVKMGbJsipzXyx5hy5YgFAomQu8YaHzpo3BHs5Rz 8/Ugyd+q+VGcA== 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 v4 18/22] mm/zsmalloc: introduce __zpdesc_clear_movable Date: Mon, 29 Jul 2024 19:25:30 +0800 Message-ID: <20240729112534.3416707-19-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240729112534.3416707-1-alexs@kernel.org> References: <20240729112534.3416707-1-alexs@kernel.org> MIME-Version: 1.0 X-Stat-Signature: mh1h749uxf1f9as61xiueears8g11tq1 X-Rspamd-Queue-Id: 1D1AF140009 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1722252079-992260 X-HE-Meta: U2FsdGVkX18V5YxNajG9U2aF4Alag8ca7Xm2xMABK78igOGGyff/uoQkHXGDqKazfAfX1sjHKLGtoOQU0Ec2UqnF/gHL7B73v3RMtS29OkZRifuSGyd+1zM+OcCsVWjrMsz3/e82+HMsGU/iBA4vNtjn6PCOMkFaI9J/yE01Q+SEUNDXnjEOkgZDd6d9YnHe/M2VddWT8yjjuLrv9M+AhqJPJCZdwYcvvxM6c3MsJYlBPvv41wd7qntQc5CxjzBqbbDWtVlNnCaAk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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 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;