From patchwork Mon Sep 2 07:21:29 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: 13786842 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 13BC4CD13CF for ; Mon, 2 Sep 2024 07:17:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 93E7C8D0095; Mon, 2 Sep 2024 03:17:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8F1BF8D002D; Mon, 2 Sep 2024 03:17:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 78FA38D0095; Mon, 2 Sep 2024 03:17:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 5578E8D002D for ; Mon, 2 Sep 2024 03:17:38 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 0D6451419C6 for ; Mon, 2 Sep 2024 07:17:38 +0000 (UTC) X-FDA: 82518942996.08.881E7FF Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf21.hostedemail.com (Postfix) with ESMTP id 72CD21C0006 for ; Mon, 2 Sep 2024 07:17:36 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=EXNl4KFK; spf=pass (imf21.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725261409; a=rsa-sha256; cv=none; b=IsR+P4Hg8slThIx644ZBSBD62p0tYgtf5akbnZ/NNKMSxFCHLCJ8kl00QfwQ3Jd8XYhL7L NCMUmdmAG9mfnxbHuJS4cCx1BF1mbhPBgFFtGTkTXnRV9ndqhszZwPeAEa6AUCAmrYHVXk 704kEakWDvEmVbUazrZxUJUwgY9kEYI= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=EXNl4KFK; spf=pass (imf21.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725261409; 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=LBIeXBRTvXSCauqKCSkeR5P4f1GeDGT3ZnPzM5xR0Wg=; b=TZN8i4QhRYaNghlgMIoP83RpfgpsUC9p2vwXw4YnG/ZclpByj8PRY5O90Va0fYbsShuNhI 1F+SkiH2H+LjKscrF/V/bI9QpwoRvfBcZdjy8OUTqxNcLQO+iPP5YJKOl3ds9SjNOPS0qo J+rW9Kch6H1O6916tg96IQqaccYKWTM= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 4AB405C1002; Mon, 2 Sep 2024 07:17:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3294C4CEC4; Mon, 2 Sep 2024 07:17:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725261455; bh=kXYRElA12DbhEH97D9heS99VK1p14zBkU2t+ZW1MGTY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EXNl4KFKTK0kmfyfg0PFMIaOD3FttgGZCH0MnmSSo5zAW04bquMAE2xDfbjMNNVIR xyOchytZAcoeIyzGiM6gh7DHnGBRVYsm0uukeKA7UiBdDmv3Bna/wVYMnlbvQ/wF2G mHIEqY6gnf8yj3FLghQIzw7pDazFPq9rtnwYI/Oxk7Lc9kLqjGKxucW3wXOgHl5Ox+ 1Oe3QJVe/XVTHUZlHu9WVghZq/41pyRXmUhbaLI+563RJskdW+XeKdRFKxczmafI+1 VJ3pKjjHnlgQRmX8cbEnLMbzcoVpRjFIEki8S7ZigdUbQW9rPHfj4lPtEWfk+s2mrS Zza1TaewLy57Q== 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 v7 18/21] mm/zsmalloc: introduce __zpdesc_clear_movable Date: Mon, 2 Sep 2024 15:21:29 +0800 Message-ID: <20240902072136.578720-19-alexs@kernel.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240902072136.578720-1-alexs@kernel.org> References: <20240902072136.578720-1-alexs@kernel.org> MIME-Version: 1.0 X-Stat-Signature: bmmktu1rrxwbr5jazk4cgmuozypihsyj X-Rspamd-Queue-Id: 72CD21C0006 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1725261456-163566 X-HE-Meta: U2FsdGVkX1/galL6AWs538wGoUrT2kVtJh1ugF2FWspl0XzfGKV3baAUYcDecqz/SUrlNA5zs7HJiNU1pYbf3I3/pkjnweUx+Yjp5QatHrp7np9slUqwguYCK8djyZej32EpVcuc24/amJB/IXd65bRhHDdn3QpuzuhegX/5ZooDvREzlDveH+4OtGZT3uktiXkstqW1lSamEKPcP0MBy0HgKUlE+5JCRme+jeJwXpzFpRPNaeg9+2j2rqKRlX5rLyJxtqGdgV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ity: 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 839fe7eaca8a..107973a2a36e 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -834,7 +834,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;