From patchwork Fri Jun 21 05:46:50 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: 13706865 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 6DEECC27C4F for ; Fri, 21 Jun 2024 05:42:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9DD928D0133; Fri, 21 Jun 2024 01:42:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9670E8D012C; Fri, 21 Jun 2024 01:42:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7B8BB8D0133; Fri, 21 Jun 2024 01:42:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 47C918D012C for ; Fri, 21 Jun 2024 01:42:40 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 046041408AE for ; Fri, 21 Jun 2024 05:42:39 +0000 (UTC) X-FDA: 82253801280.07.8AD803B Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf15.hostedemail.com (Postfix) with ESMTP id 04E26A0007 for ; Fri, 21 Jun 2024 05:42:37 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=IsjvEN5G; spf=pass (imf15.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=1718948548; 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=H53IT11WWEt3WPpURAkxZojEIUzsZ1uun/xVR3frAcI=; b=yuB/LyPyNcow6W1h6uLQO9G5LHujEodfredl7K84BXIOKRiMvxiJ17LLk8f+myXh9xDhVl RC/2Dn4/U6B26k+bJB0LH9Q/NVgLMcmdiMrd7prlT3VHpiD0SWUgxCRm/H9Bb2jdwZ6ajU 96xajzE+EWk2vKCnjPtTxDGzzYxrgP8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718948548; a=rsa-sha256; cv=none; b=1aBmAm47X9Q9Mf4yRkhnCVcmuEyz5dM1PZBlsmsu/nexl7JHLUqF9w8ucXggRPYbJSrhXk 97uaVrAIGWyrwahwbML0sK3X2tyJfc/peTbAa+hkBS4tqDG2hmUhMjOxxLWLArNzhm64yS 4ik0wN7j3/QZr8n84259TNJtx6Hy1Q0= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=IsjvEN5G; spf=pass (imf15.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 63F5ECE2B5B; Fri, 21 Jun 2024 05:42:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89007C2BBFC; Fri, 21 Jun 2024 05:42:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718948555; bh=Sd2Phg+JvwLSFmEURLUSKjCDab85FD2bJliNqmZmxJc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IsjvEN5G5UtwH5nf6m44K+yulQm1RsG8bHkIVkguFk1JvLe7qVG7hIdWTy4Kjs6Pe VAiFIQIHfPdS+46prNFdVC42cOugMQXDmwTViUO66+hLNc28yBDx172D/Esdp9mqyB tQ1rxcUrko5b+IiC101fBhNBvOcgzADOF/MTa6NS7Rq1aJXjNLgi6RyfKTiNUEPIzd ItWxesPk2knISOhVPZf1M8Z5+JvBXQG1WaNJki8upVSP04V1DDxv5DypiOBa1t7nE9 XTTxK9Nqj8U8AH8xM38UDDCQ6j1EQihjMZ6aEueUdq74JdFqt5WsYVwfBssqvfzOKK 2igffWYGHyERg== 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 10/15] mm/z3fold: use zpdesc in __z3fold_alloc Date: Fri, 21 Jun 2024 13:46:50 +0800 Message-ID: <20240621054658.1220796-11-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-Stat-Signature: t49gzsdud9comker6ny6hm85jbzr5y48 X-Rspamd-Queue-Id: 04E26A0007 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1718948557-658052 X-HE-Meta: U2FsdGVkX19j//5+1hx9zrMzVX4XC9fnTcbb4QZfCrpx77d6dQl2lktt8rkF6nxmbUgVmtKBmoA6f3PQuOTiP5fE1W1OC4xv6gXYZIRlX9MWOwERsqhDLaSinWN6LW8fCKzuetseV4Hyf8AfDmu5WDytpIr25hpBXykXR9ykjYPRAwsJPARN1/rWMm/UIv0dXQ0dXMXvH2sVve79P9r8odwU07TwdP9RdifuN05+RjEUrSHKqZn7yZHJMpUILrjApxFX8z9s8LyehW4991d9lMuarh9JW5hND4tQlzHiE96vKHVZOKHlOxONnyLLgQ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ender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Alex Shi The main purpose is converting page->private to zpdesc->zppage_flag. Signed-off-by: Alex Shi --- mm/z3fold.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 3d36448885c9..f164eb4e1139 100644 --- a/mm/z3fold.c +++ b/mm/z3fold.c @@ -790,7 +790,7 @@ static inline struct z3fold_header *__z3fold_alloc(struct z3fold_pool *pool, size_t size, bool can_sleep) { struct z3fold_header *zhdr = NULL; - struct page *page; + struct zpdesc *zpdesc; struct list_head *unbuddied; int chunks = size_to_chunks(size), i; @@ -823,9 +823,9 @@ static inline struct z3fold_header *__z3fold_alloc(struct z3fold_pool *pool, zhdr->cpu = -1; spin_unlock(&pool->lock); - page = virt_to_page(zhdr); - if (test_bit(NEEDS_COMPACTING, &page->private) || - test_bit(PAGE_CLAIMED, &page->private)) { + zpdesc = page_zpdesc(virt_to_page(zhdr)); + if (test_bit(NEEDS_COMPACTING, &zpdesc->zppage_flag) || + test_bit(PAGE_CLAIMED, &zpdesc->zppage_flag)) { z3fold_page_unlock(zhdr); zhdr = NULL; migrate_enable(); @@ -868,9 +868,9 @@ static inline struct z3fold_header *__z3fold_alloc(struct z3fold_pool *pool, zhdr->cpu = -1; spin_unlock(&pool->lock); - page = virt_to_page(zhdr); - if (test_bit(NEEDS_COMPACTING, &page->private) || - test_bit(PAGE_CLAIMED, &page->private)) { + zpdesc = page_zpdesc(virt_to_page(zhdr)); + if (test_bit(NEEDS_COMPACTING, &zpdesc->zppage_flag) || + test_bit(PAGE_CLAIMED, &zpdesc->zppage_flag)) { z3fold_page_unlock(zhdr); zhdr = NULL; if (can_sleep)