From patchwork Mon Sep 2 07:21:25 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: 13786838 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 417C5CA0ED3 for ; Mon, 2 Sep 2024 07:17:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C9BEB8D0091; Mon, 2 Sep 2024 03:17:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C24DC8D002D; Mon, 2 Sep 2024 03:17:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AC37E8D0091; Mon, 2 Sep 2024 03:17:24 -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 8C47B8D002D for ; Mon, 2 Sep 2024 03:17:24 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 4960D1A1949 for ; Mon, 2 Sep 2024 07:17:24 +0000 (UTC) X-FDA: 82518942408.06.6817453 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf04.hostedemail.com (Postfix) with ESMTP id A2B6540026 for ; Mon, 2 Sep 2024 07:17:22 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=uTv2JYWK; spf=pass (imf04.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725261368; 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=ngiJ3h5ouGc7MrS+IIK7pMitHaf15uQXmnYzxL428lQ=; b=a+UtSVlFIP8vu+EcU4llgcq8zFYzTZUYDPsADtX4dsmms7k2FpMRSwGlepOLwb5ZmWbQ5w 7GiiCp8bIid2MYKv2846czHhKWE4LsAQUC6Jt+oUYqw6++fbPBlpdKet9/7SrvDsGEMGYz v0ijd6QBRR13Qplv+6BIHqb0imGIKOk= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=uTv2JYWK; spf=pass (imf04.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725261368; a=rsa-sha256; cv=none; b=UN4qjTSha6zTzeMruQzb3fsAhW3FVM8Cwq707OIT4t/KOcmNAXjZhif9o1xBu9t3D+CzS5 iP3BRP5ABAs4wRViQIpZqID6iEnBn0UnQ4w584eapoFRSZ51ed4Wv+jBq9RZhh2nmJZY7n XQ+nBFadMJmw/jpS7BvstfPk65p7L8U= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 84D3B5C55C5; Mon, 2 Sep 2024 07:17:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ACE76C4CEC2; Mon, 2 Sep 2024 07:17:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725261441; bh=oMrU85lTLRKqEwjZvX+/RAn/IsBRgGpZpbsgEGeKZYk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uTv2JYWKBWs/eY3vQwV4b7d46Dw+8FnfttVYa627PvUXCjgj8YFZiXNE2cONgQ2vD JkgfML6hEagHjvBeo08sMYm5L9jLkSjtkTdRS7T2LkNHQcFsDx2bVCHMuvp3eznYve SC/wsNxQ0jT08WxCgk5l1VnUbaEx4JcQxRDMcaxevO06zXMJubQ+lKPSu3nErUeF92 QQGh6bVLa6es1W1dR3HomaK6ZvUGMjggVhm7u6kO/swf/AcMtavkx6lsFCqJXQU6Mi 1Vo67rxmdi0vb2Ei+Mo06rE6WDhBAFTKNqdPX1iPelhAwfZsjP4PMzXFTcnadVGpX5 LyF4L2q+hsbNQ== 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, Yosry Ahmed , nphamcs@gmail.com Cc: Alex Shi Subject: [PATCH v7 14/21] mm/zsmalloc: convert migrate_zspage() to use zpdesc Date: Mon, 2 Sep 2024 15:21:25 +0800 Message-ID: <20240902072136.578720-15-alexs@kernel.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240902072136.578720-1-alexs@kernel.org> References: <20240902072136.578720-1-alexs@kernel.org> MIME-Version: 1.0 X-Stat-Signature: ts15rpptuzjiptnzk5zhj3i3i6464iig X-Rspam-User: X-Rspamd-Queue-Id: A2B6540026 X-Rspamd-Server: rspam02 X-HE-Tag: 1725261442-383296 X-HE-Meta: U2FsdGVkX19ZotfMNVxdJR/g8jdl9HoZXz6AO0ZjU2ahy9HW3R6EjFKWfJNgcC9T1uLE4PjfjTLNOxCw9NYeRJnMKH+KPOr4WHl4QokbEn8aVM0fB6HBfZs67UWjI2ATpZg0p6WVFNG8SalZ1AY8XtNRlwhbDiyW/gOk6ZDW/cQwmWuMh05xAcEiw6/canjYSp+yEjyGp/BNMCF7CHfjIy594jC83FuFkJ4dy1BOapkyFWlBzMSCz7wsYC+OSA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M67Gc56swbr+PnTZr/EfHTzZzakuLF6orCvOwUg4dh 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: Hyeonggon Yoo <42.hyeyoo@gmail.com> Use get_first_zpdesc/get_next_zpdesc to replace get_first/next_page. No functional change. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Alex Shi --- mm/zsmalloc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index f94c3a6653c7..aeb8cab5767b 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1623,14 +1623,14 @@ static void migrate_zspage(struct zs_pool *pool, struct zspage *src_zspage, unsigned long used_obj, free_obj; unsigned long handle; int obj_idx = 0; - struct page *s_page = get_first_page(src_zspage); + struct zpdesc *s_zpdesc = get_first_zpdesc(src_zspage); struct size_class *class = pool->size_class[src_zspage->class]; while (1) { - handle = find_alloced_obj(class, page_zpdesc(s_page), &obj_idx); + handle = find_alloced_obj(class, s_zpdesc, &obj_idx); if (!handle) { - s_page = get_next_page(s_page); - if (!s_page) + s_zpdesc = get_next_zpdesc(s_zpdesc); + if (!s_zpdesc) break; obj_idx = 0; continue;