From patchwork Wed Jul 3 04:06:08 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: 13721227 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 81BF8C30653 for ; Wed, 3 Jul 2024 04:02:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1262A6B00B1; Wed, 3 Jul 2024 00:02:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0B06C6B00B2; Wed, 3 Jul 2024 00:02:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E6AB16B00B3; Wed, 3 Jul 2024 00:02:23 -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 C1DAE6B00B1 for ; Wed, 3 Jul 2024 00:02:23 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 7872E4022F for ; Wed, 3 Jul 2024 04:02:23 +0000 (UTC) X-FDA: 82297094166.17.8EDA6E4 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf16.hostedemail.com (Postfix) with ESMTP id 79B6C18000E for ; Wed, 3 Jul 2024 04:02:21 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=SClcJWWi; spf=pass (imf16.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=1719979329; 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=5+mq8l0P/h1ceq93DGl+UGxVgmYgd1vtsPsWyFFfnTI=; b=DctbWmu2rb0XDrZQSynBQ+0gWlcP7oCrjg0ssRVujBRSM9vnahaaL4Y3Ps36i/EYcbKKjT LqBKhDy0PkeAJSfXiryEcPlgkmLKLG1MBYOYFbDJ4hRQ4QQJu4Dh0WAz8HrN/kf5AMaUfe JHHMzp27YdGrZYwxxu+Zsgvf5NAtPWQ= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=SClcJWWi; spf=pass (imf16.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=1719979329; a=rsa-sha256; cv=none; b=LV8X1BV1qzi+dY4y72XThtPqoUQoes+c08jkOZE734oCkhx9qoucZzcoSeetb9Q/Ujhv2Y yVXbykzNywQKkwmGKBabPpMZMeoH10NWgpdKPF22+QA4gGk2EqT58XCmodrXRzES+WRtle /KnFupN3psgkiFWcI8WfcDLSXpGdYsU= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id DEEE1CE28A3; Wed, 3 Jul 2024 04:02:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BD1DC4AF0B; Wed, 3 Jul 2024 04:02:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719979338; bh=WADQG+KFeKRI6MYgRuTdfJ+b1YmyjJ4toh2DCgrdz3U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SClcJWWiEa+5YwdOV0tQyYXItfPMvdIJTAnwNUIfop+4H0HQMX6ZlDZTA9hyInDUt n474nw2Xna1yNdCGIxwVeOL+AsXksKOajIh2vblG663lUPirNCunRmA1yrrPDSvY4t tAKnQr8OFrdsHf20r/qE1JXENe2kMo+E51gUSfzDg6a/UXszSkdWHn34wdnr1yKv1R kF12ECffDFlANRMIMJ2uT+QygpKzV52sLDqzBCGLDPV5aJ6Wt98lGqf5iak5vpEClN dcelnlI5gfXuQnyhUIPfGTQxg211qR96KWLBHvR4OwbGn8W4VGlyU6VOIxCFdv9j9B w2mMYKGx6JW7g== 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 v2 18/20] mm/zsmalloc: introduce __zpdesc_clear_movable Date: Wed, 3 Jul 2024 12:06:08 +0800 Message-ID: <20240703040613.681396-19-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240703040613.681396-1-alexs@kernel.org> References: <20240703040613.681396-1-alexs@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 79B6C18000E X-Stat-Signature: 5zqrd3nhx4uthafixamsm8eraehcg73u X-Rspam-User: X-HE-Tag: 1719979341-448507 X-HE-Meta: U2FsdGVkX18wieW1LMDUjOC3P0KvNmVdxR0dwvMmez8ghd2z+Rpsq6g3EAGbvXHwVMrdwvCHYgguoJFM+MMjskc5yqVAC5iyZrUGIGSYVZGGRIUBQmyJKoNwTo0uJMpglDRYu1aD6poMOm+XXlFUViBQU6289P3Kgblp8KLCX92IuhbgH3cy6slHg9qnRLNC3phJP5DJKf+bhRkEWncMt+jKbgVZQlio3kr6tjXrBYmzPyDWjFaHU26sbYGYZekPg3RaFhlTXKqpQymAAU4j0KU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ilter, 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 296cb1ff944b..4780d7015267 100644 --- a/mm/zpdesc.h +++ b/mm/zpdesc.h @@ -111,6 +111,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 0493f953fcb5..08ab22f0ab7f 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;