From patchwork Fri Jun 28 03:11:34 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: 13715405 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 24DEFC2BD09 for ; Fri, 28 Jun 2024 03:08:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AAE336B00BA; Thu, 27 Jun 2024 23:08:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A5CA86B00BB; Thu, 27 Jun 2024 23:08:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8D8CA6B00BC; Thu, 27 Jun 2024 23:08:04 -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 6D5246B00BA for ; Thu, 27 Jun 2024 23:08:04 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 2B1E4C12A8 for ; Fri, 28 Jun 2024 03:08:04 +0000 (UTC) X-FDA: 82278813288.24.DC56074 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf02.hostedemail.com (Postfix) with ESMTP id 29BD080019 for ; Fri, 28 Jun 2024 03:08:01 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Mk0Y3czk; spf=pass (imf02.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=1719544065; 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=Iv3iNXi/eIe9volJtnVPjvF8mgGNp8ouqEHlmLtpLEA=; b=vt4xmP7Qrg0JoZ232KFBLDzFtsez3Tf68AKwHv0knLs5JWt8FlLwMX3Lxn2gvSfoi913P9 h7XFcFS0B663L/9gfkrIMojBW9f2x+CdGu5BSLUR/1BSxC85ftbQyUyTTIDr2V6gm+mOWM EMyPPgtCvvP184gfXhPx4duP9mWkxUw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719544065; a=rsa-sha256; cv=none; b=d2YEVgfI1RUbvKwOwq9SvsBKONzU4F6ToqIwi2+kzzelcCvOIlqc+5yPHB/bK1ZCDZc5uW Ed3Hhc7cndA8vEe6CjjlmEVHPx0vlBzvdArXz8J/1GPfqsywQG1fagwWn6+53Axe1Zkj/L zfGqRZZOgKRz9gub81IrtjdRXhmR6Cc= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Mk0Y3czk; spf=pass (imf02.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 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 8F0F6CE33BE; Fri, 28 Jun 2024 03:07:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13BFEC2BBFC; Fri, 28 Jun 2024 03:07:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719544078; bh=1b2JRlKwTFXQCKXls2arw2ZYXd32r3yXKlFqVVcujQo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mk0Y3czkLU95tgGbkMh1dc7Ujh5UVx4rFxHwXuxVsgEsk/u+S4AReBO1g56nW+Nhh 3YmhlRIT03b0vDYM21OStct7U9LXxp1hcClg6Ir+2o7e3MxGkjqKbb5TODMs8B/69m s+9yoffNOB1dnVjRcLRz7Za2COjRzhajsk6g2M9mBVyu1yDZ0XyVjnPwzMhEO2SUBx oWnWAdZdNEGIBe+7XR2MbwfFfO024TyLiN67b3jo42V6s/nL20YHE/H5HsXiKGt9jr 6ax09zDtLSK7qDG6FRD4gBONZiiKEkcRz4bX6SQ4ufwhNd7vi0wDAs2fplpKZqB0GJ 479dAcAhfe1uA== 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 19/20] mm/zsmalloc: introduce __zpdesc_clear_zsmalloc Date: Fri, 28 Jun 2024 11:11:34 +0800 Message-ID: <20240628031138.429622-20-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240628031138.429622-1-alexs@kernel.org> References: <20240628031138.429622-1-alexs@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 29BD080019 X-Stat-Signature: hma74iju8t45bidockyas9k6hnta6p13 X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1719544081-763015 X-HE-Meta: U2FsdGVkX1/9864Gg0D53ucyuLi1VxGtOu6p/JPlgqGxfoZbA+e8Gq1IKRv4Z8/a89/wcvMU3W1GtWZhpdc0CiNPug9wfIGhnRDa8TNpgcJ4R7W/u8XAG6pRC455NilsZjKoMUzSs9ImPEWiUZJcynO5o6kss5n8BBzLwVG7ucvlT26lQazUxPo5xMlOICl7n/VD5du1fwFOCFFH952MXTet2ZntaKXKTlsJdj8t8pRt8ZdoZAuuTDeqmvA27nBETf9ENbNpV3EbjtC5yoluaP2LYKCRq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, 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_zsmalloc() for __ClearPageZsmalloc(), and use it in callers to make code clear. Signed-off-by: Alex Shi --- mm/zpdesc.h | 5 +++++ mm/zsmalloc.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mm/zpdesc.h b/mm/zpdesc.h index c6a44fe04f97..e346b39aba59 100644 --- a/mm/zpdesc.h +++ b/mm/zpdesc.h @@ -107,6 +107,11 @@ static inline void __zpdesc_clear_movable(struct zpdesc *zpdesc) __ClearPageMovable(zpdesc_page(zpdesc)); } +static inline void __zpdesc_clear_zsmalloc(struct zpdesc *zpdesc) +{ + __ClearPageZsmalloc(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 abecc8a5c566..eaf8dad04f2c 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -853,7 +853,7 @@ static void reset_zpdesc(struct zpdesc *zpdesc) zpdesc->zspage = NULL; zpdesc->next = NULL; reset_first_obj_offset(zpdesc); - __ClearPageZsmalloc(page); + __zpdesc_clear_zsmalloc(zpdesc); } static int trylock_zspage(struct zspage *zspage) @@ -1026,7 +1026,7 @@ static struct zspage *alloc_zspage(struct zs_pool *pool, if (!zpdesc) { while (--i >= 0) { zpdesc_dec_zone_page_state(zpdescs[i]); - __ClearPageZsmalloc(zpdesc_page(zpdescs[i])); + __zpdesc_clear_zsmalloc(zpdescs[i]); free_zpdesc(zpdescs[i]); } cache_free_zspage(pool, zspage);