From patchwork Fri Jun 21 05:46:55 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: 13706870 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 43B96C27C4F for ; Fri, 21 Jun 2024 05:43:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CC3C18D012C; Fri, 21 Jun 2024 01:42:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C4C2A8D0138; Fri, 21 Jun 2024 01:42:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA07B8D012C; Fri, 21 Jun 2024 01:42:53 -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 7DC938D0138 for ; Fri, 21 Jun 2024 01:42:53 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 35A3F160941 for ; Fri, 21 Jun 2024 05:42:53 +0000 (UTC) X-FDA: 82253801826.05.18A7A2C Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf26.hostedemail.com (Postfix) with ESMTP id 92271140004 for ; Fri, 21 Jun 2024 05:42:51 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=fiYuYRr7; spf=pass (imf26.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=1718948566; 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=O4grW4BWVfJLvdJ5iDlyvwWe35jP4b82YdchEsX2tFE=; b=JT9AGZGiJhcYDcWW0jafbkiP98jeG+4hdBG3+fy6bnGbmXN+hmwzsdGcJKrJ57b9Aw3gdQ C9raHdzfIda9u1FMQ40Hywn353z7bDIlCx9DqYLuibQZVUyAvZQYbhWhnO1qDNTy87wQYJ mM6D+P5R8dxgiQ788vNTuwEWk5rE8kk= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=fiYuYRr7; spf=pass (imf26.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=1718948566; a=rsa-sha256; cv=none; b=oqv2yEMfFJ6RpZ8Rmg4kdRkDAlK2SqtE8ctT9Vmk9JBr9sX8uT/GbpDIOeLyJ12OJgrMaQ UJXDLwwTHOr/VCm406SajPrnZ4e3pbHshPj4rkpbgwD+Ri6cJu/LnQYd1wMSpCjsQ0nefc K8RSTZJFk/qfJuBcckiS0u+qljNyQ6I= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id BF717623EF; Fri, 21 Jun 2024 05:42:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 005ACC4AF0A; Fri, 21 Jun 2024 05:42:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718948570; bh=8UKqY3YZXZR0aUnfYfC3JUjUQBkkwh7XEloB41aBdHg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fiYuYRr7TQp0GCGNgZH88c7pREIwo5/3qN3AIwrtns1l+dudvt+tFgoUVKq89TKyo snExeZWvBIrJREOD7QT35f6EX4JapxfIAgg5B6Sx6sjis+GMfr8SkGndW+9RtZ0TsF 5iuRxriNkO5bDJtffxS9vW3ofHEI3ZyYIYGJbFlRGORoDyZnSK4kn3GXmNYyTPM6Oz gMsTqYpy2JUKfNelSOh95H/jOdtAd+QPOBTQrWHQDstm9U894OjWvPuAzmoGkOOse9 EPDkIaAE/YTiIkhb32EhxY50or0Iin8djeYzNKtChW6gJNoW8To2gLSidmMn9ywxi+ s5yhy6YbOy6rw== 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 Cc: Alex Shi Subject: [PATCH 15/15] mm/z3fold: introduce __zpdesc_clear_movable Date: Fri, 21 Jun 2024 13:46:55 +0800 Message-ID: <20240621054658.1220796-16-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240621054658.1220796-1-alexs@kernel.org> References: <20240621054658.1220796-1-alexs@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 92271140004 X-Stat-Signature: qgag695nymubhp35ea5ws4fpkws3syxg X-Rspam-User: X-HE-Tag: 1718948571-783438 X-HE-Meta: U2FsdGVkX1+RcNuUMEmZ+1b7zmwUQq+1Xzf25iGok3O8k5XJ+fDD55BcA0Ip+VbXhrdqN7c/pW9HcSxt4d+7bZfmlSm9xb2I14ayhGPHv9640jE/3EEZZSIsoxSefzbnrH8s7QMIZCKELE0xmile457Sfksh8bBHZq885OrW1CIcLGxvoUMZ37LytmH+UeUxEoaJdoJV7kv88PfnNCWthmPvRZFi9wfWAxrZaLBrQS6xhFcWJ+rTXLBODMkf+sAcrlm7xFZmU+kwliBgvnHt2Gii3+1yxMpb2l94xIuLHsGRS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icity=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, that make code clear. Signed-off-by: Alex Shi --- mm/z3fold.c | 4 ++-- mm/zpdesc.h | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 35e48440c517..e23d56f46760 100644 --- a/mm/z3fold.c +++ b/mm/z3fold.c @@ -352,7 +352,7 @@ static void free_z3fold_page(struct zpdesc *zpdesc, bool headless) { if (!headless) { zpdesc_lock(zpdesc); - __ClearPageMovable(zpdesc_page(zpdesc)); + __zpdesc_clear_movable(zpdesc); zpdesc_unlock(zpdesc); } __free_page(zpdesc_page(zpdesc)); @@ -1322,7 +1322,7 @@ static int z3fold_page_migrate(struct page *newpage, struct page *page, * so we only have to reinitialize it. */ INIT_LIST_HEAD(&new_zhdr->buddy); - __ClearPageMovable(zpdesc_page(zpdesc)); + __zpdesc_clear_movable(zpdesc); zpdesc_get(newzpdesc); z3fold_page_lock(new_zhdr); diff --git a/mm/zpdesc.h b/mm/zpdesc.h index 44473382f2cc..1319575dc31a 100644 --- a/mm/zpdesc.h +++ b/mm/zpdesc.h @@ -79,4 +79,9 @@ 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)); +} + #endif