From patchwork Fri Jun 21 05:46:44 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: 13706859 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 46B66C27C4F for ; Fri, 21 Jun 2024 05:42:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AD33B8D012E; Fri, 21 Jun 2024 01:42:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 794E08D012C; Fri, 21 Jun 2024 01:42:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 45CAF8D012E; Fri, 21 Jun 2024 01:42:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 01BF88D012C for ; Fri, 21 Jun 2024 01:42:22 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id B0710160942 for ; Fri, 21 Jun 2024 05:42:22 +0000 (UTC) X-FDA: 82253800524.04.232BE2E Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf29.hostedemail.com (Postfix) with ESMTP id ACEB9120010 for ; Fri, 21 Jun 2024 05:42:20 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=egYyPlAu; spf=pass (imf29.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=1718948533; 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=wOwEp6mCnEWbSRgPCkBcUapv4Ws6mgjoU2AcLoDBd38=; b=HL5T7zzvXZofbIX8a0dP9N5dhS+9pbAmiKw1orJc6c8bj37Bpp22HGRCZWANOoo1MrsPp0 1jq3IdP8njepNNVDOKSRfOsBjLQBvxNYJrNMtfSrtYixB3qtOWmjdQEtSrDTcZdF+mXEGg Hlv4Cd31xkqScTKYb32dhpqzJaJ3x1w= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=egYyPlAu; spf=pass (imf29.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=1718948533; a=rsa-sha256; cv=none; b=J8K41BEZfVO5ITNCoaMF2wrMfyS8PznQUVadtGEsi6st72HNgWQAZmVSG4w+2Zr1CgI1yw /8HH0mMzw+rKdlp+Sxz2yMOVJ/740zOucbok3/cTFrGbV+6dwGrKMIbwIqppry8LrWAhFx mb9xEDuCtU/M6uhqlyWqpz/L1kpHHK4= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 01062CE2B51; Fri, 21 Jun 2024 05:42:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26DE5C4AF0C; Fri, 21 Jun 2024 05:42:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718948536; bh=qXj63AgP40NUpl4XlwRzrIm8KuNAVcRpUKRIp23PaNE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=egYyPlAu2juH8SLzVU+rYnNIQS1jHZS8wx2DLqMXQyz3DVD45Y0KyAZE+CzBDrV3J bwGHV0nFL+UoZwbljfBrDLCxvQVfsP8kxb3DOscMi+QicjSb6hN4Sbsh5mjGQjQPlC IGbnFyZdDdnFh7j+9fKhGIL6PRo2weH7KoUYwkE2E2yS4qkG5EInsDTDLngIyrIhNZ agfViVHiyJfvSZhd15I14UKzVJa8mcs7JrIdj36iq1chQ8uZKYJj97w2Kw3k/2GzJ0 FDnQOknl6afuuRG4a+UsSji+sd8oWb+N4YgVkRCYbRo53xU4iI4+0RIBUR8SSXfBkQ oOwZQ+7+xJkXw== 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 04/15] mm/z3fold: use zpdesc in get/put_z3fold_header funcs Date: Fri, 21 Jun 2024 13:46:44 +0800 Message-ID: <20240621054658.1220796-5-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: 3qz65a5rmjwgxst7b88cnio1yamzgraf X-Rspam-User: X-Rspamd-Queue-Id: ACEB9120010 X-Rspamd-Server: rspam02 X-HE-Tag: 1718948540-222402 X-HE-Meta: U2FsdGVkX18PCijf9dCloLYxVjj7/m515ziMRCesrGvqtpGfUpOymAWbeQ+cp3eBwyTHPYIM5AvuUOddupKrS8bVSrAA360XHTLSLgNRduh/f1mdEJIJhUyq5y5jqGUc/KJ6KATNOz0m2B7rrqPgi/2xcj/uvuoAGbij0Olh5sGh9C8nn2PuYzAEbaF9sz7BeVnN0kYbj/jIIszcBZDcHspUcDd9760e7Mg0iCftPJYIqw/n58FYVxs0w2yVWQUegsVAyItGsfFb8GdK8/ufAdiQk9oDiF5+qCUvt/zvYHR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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 Convert the get/put_z3fold_header funcs pair to use zpdesc. Signed-off-by: Alex Shi --- mm/z3fold.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 5cb156fc03be..bfbc9f9fdfd4 100644 --- a/mm/z3fold.c +++ b/mm/z3fold.c @@ -254,9 +254,9 @@ static inline struct z3fold_header *get_z3fold_header(unsigned long handle) locked = z3fold_page_trylock(zhdr); read_unlock(&slots->lock); if (locked) { - struct page *page = virt_to_page(zhdr); + struct zpdesc *zpdesc = page_zpdesc(virt_to_page(zhdr)); - if (!test_bit(PAGE_MIGRATED, &page->private)) + if (!test_bit(PAGE_MIGRATED, &zpdesc->zppage_flag)) break; z3fold_page_unlock(zhdr); } @@ -271,9 +271,9 @@ static inline struct z3fold_header *get_z3fold_header(unsigned long handle) static inline void put_z3fold_header(struct z3fold_header *zhdr) { - struct page *page = virt_to_page(zhdr); + struct zpdesc *zpdesc = page_zpdesc(virt_to_page(zhdr)); - if (!test_bit(PAGE_HEADLESS, &page->private)) + if (!test_bit(PAGE_HEADLESS, &zpdesc->zppage_flag)) z3fold_page_unlock(zhdr); }