From patchwork Thu Dec 5 17:49:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 13895891 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 47788E7716E for ; Thu, 5 Dec 2024 17:50:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 295026B017A; Thu, 5 Dec 2024 12:50:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 268B96B0180; Thu, 5 Dec 2024 12:50:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E08B76B017A; Thu, 5 Dec 2024 12:50:07 -0500 (EST) 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 9C7706B0173 for ; Thu, 5 Dec 2024 12:50:07 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 2C3971610EE for ; Thu, 5 Dec 2024 17:50:07 +0000 (UTC) X-FDA: 82861643424.13.F786C8D Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf27.hostedemail.com (Postfix) with ESMTP id 7040140015 for ; Thu, 5 Dec 2024 17:49:46 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=GwW7d49N; spf=none (imf27.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733420995; 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=jRSmlyBZyfO/cN0lHKIx0H5Tn/myqOCAR0TLubJ1a9Q=; b=RoDM3/0pJWt3hUfdyi0fB37iIfC3RV1dYR+NW6VtuULCLzZP+zRJf1upk6rgGP/y0qtW5u Br6TdzV6tcEWm5S2B2zRSrU7/Bb8gnP6rf8RMN/+caghzi391jfUD6QaiqW3d2G75jgIM8 bv4BzKBCdn2Tl+C/nuXF0NCoqZBN11Q= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733420995; a=rsa-sha256; cv=none; b=Fh9Oj+FdmMEJjzT5Ox0r4f8tKCQ5PwOirLA98Gg0gyFSLUMskVPxQafNgFLoCkhkLF7p3s i8XrcaFhPeDhAIAa9U1NA1iHjzlhAiL7kg2dPlYs3McM4N25CuHGEsf0m54O9jhgcoGtso 3EDiqdNh1jrW6zq5xlmIUIJAgvqMGDc= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=GwW7d49N; spf=none (imf27.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=jRSmlyBZyfO/cN0lHKIx0H5Tn/myqOCAR0TLubJ1a9Q=; b=GwW7d49Nk/niKHN5xontrmItfE X6n13nJ0cusvgCdwX37GztGvg9PxSepFTg/9KMtAgJLw+cKCPEDGo4oAqboQbb+vNye39zsvIbjvE XE7nB4vw+Z1Vo1GLToKhUsPyvhOYL3OIsGDNsVnj284UFLBPc4tdaMaMszjp2xQfTARzADo9qu4dE 2l7n4JEwMYUKNQdzqXNToWNAImY+C7mHrE2M0w89K8whugCPNBHhPn9akhA5BlPtVUGcXYIcDZ1IO hBupPDrmE4TXe5oM3MMuk3CR/KfPLAsz6WchYPHHrKyvcSUPGbyHNmwQ4Qz7bAmG8TP+brXJlyQK+ DgjUNOnQ==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tJFzI-0000000DN9B-1VYx; Thu, 05 Dec 2024 17:50:04 +0000 From: "Matthew Wilcox (Oracle)" To: Minchan Kim , Sergey Senozhatsky Cc: Alex Shi , linux-mm@kvack.org Subject: [PATCH v8 18/21] mm/zsmalloc: introduce __zpdesc_clear_movable Date: Thu, 5 Dec 2024 17:49:55 +0000 Message-ID: <20241205175000.3187069-19-willy@infradead.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241205175000.3187069-1-willy@infradead.org> References: <20241205175000.3187069-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 7040140015 X-Stat-Signature: 8qhh3uxj9ha4q5yh8h3dhq77qfm5ztm1 X-Rspam-User: X-HE-Tag: 1733420986-715910 X-HE-Meta: U2FsdGVkX19PNir5ORnZA87RCN1ZJJw1V3L0QM3KBP05DzhL43OFUyQVWafCr1AgOjH6OQhLZSkoauW1acPGO3dp0x66tZ4Xt4QXbtdyV2WbxIJ57UhSzNVlPEWGPTPBf9LkGOadmDIkMnKiqG1Mlz1rkGNaL7yxTyZSDtPh7iT8lzhMycnX6stYFNY2eVoHN7AvyqpV/n1RUpgqkLNM4TOG46ReCR2wopps3JISQ5HBo39J37y879j/3ZOjvJdQXysTd3u/Lb9W+cd+ta+jWcvFW9jeIm+ru1nkrLJ33KjqL3c4+r50jcWhK/vmFXVUO4Upf4RsR/Zn60KKhVk218WeL7m8HDsZB80y/IRMj+BHaUOsbjpmw04GzEe7BuDFVeND6tP3aObvODMJCbUKv0rlZWe+rI90wTWmkVBf9F7rB54uwRBRBN11xmzMTZ8KImqihb7bJ2IvzZ/oDyYy+A3CWobexaz4yYyubWPLTO05A3j1vTbGpOLQhuTsJASHjLh2YyrUcj285+f1lDoZrHb1rNYTbgRepDro262cS+an7IKWsjRZZadfBBh3ik6G0nvnIPSVqlU48Yem4GFhJPUDq5ddHx7Ee31+Jzg2JYbv8oQSEbJbGRnYW2Io/5txH3COMEfSSkxISFdFtWNHMQM4NdxDUWQvpMiOJwWLP4+NHd3pExGm8SRZlaKS88cVONXUgILExmdsNUIj68QcNc2Hj7+T6nOHqrbpRD9nYId3YbuNmG1RlK9O6bY8JJKYPJxQtdGsk70/T9ko5ccTqnxP72elczNdpuhYm1l8ahjhsZyC8vNif+f+gBzIFoYERDF6JHbL1UF0rZUbyz1LnSTzoo5aGMTu/Kms5SzCZIo+pu364YRJYd4LoDj95hNUKcBP6N1b1q9pZzNOaAtYC/zXPZi8tdHLRGpVbdB5W/XUBjhMB7rgIYcKDPiRF8UZr+edO31Ai5UOEVcwe/h 86d5Np3K GViNpFdgw1sXpyDoSsWLVGezK6MikuC0U0nw38xI6RHajvv0RVP/rgyylFIA49ilSUfVVyVVsiXr+gQlE9WVWx6MLeyKp6BWzQ9AtdVCotyQBZbCpPhjFS5iPWk6VJZhAGu4yBJ8xK8fJ3WoJwBs8GDsvFVN1bZHqFINRkl7EbO1OhiF3ALJ3Yz4swi7FFwJ1ZmD45Q/3waNSjRR48o9P01M9g31XRalEZKwY46gPjIseAVdUmZLXyzXdkrdSMYToxmmr 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 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 89fe78a7f5ca..d468003c7ebd 100644 --- a/mm/zpdesc.h +++ b/mm/zpdesc.h @@ -117,6 +117,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 a15bdcc25bb3..bcd5f1b9f382 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -842,7 +842,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;