From patchwork Tue Aug 13 08:46:00 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: 13761563 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 D9185C52D7C for ; Tue, 13 Aug 2024 08:42:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 828296B00B4; Tue, 13 Aug 2024 04:42:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B2D66B00B5; Tue, 13 Aug 2024 04:42:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 519256B00B6; Tue, 13 Aug 2024 04:42:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 31ACC6B00B4 for ; Tue, 13 Aug 2024 04:42:04 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id DC5DA40712 for ; Tue, 13 Aug 2024 08:42:03 +0000 (UTC) X-FDA: 82446579726.28.679D5D5 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf23.hostedemail.com (Postfix) with ESMTP id 41AE9140026 for ; Tue, 13 Aug 2024 08:42:02 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=FD7LH1Td; spf=pass (imf23.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 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=1723538466; 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=R1Tc/xK+L9PQjZoUv+mESG9WEY9SW/PgJ93dHMXkRYM=; b=1L+rErdRhLZZa4FhLj9kSaPXvBQ2iIqFar3+tYLzHi2bggIcYYEWZbbqnjqjJYa60B0+lM mJq3z6R6lECBj8XHyyQ5qKoN4zany3aj6dJoz/KuJdlJnNHDqO/G9VlMDb41Q+5YTF1RPW dH3dgSRC4QOkOCNX6pwm9uyTatLj2Q0= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=FD7LH1Td; spf=pass (imf23.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 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=1723538466; a=rsa-sha256; cv=none; b=O0DpO+VPRGpRNo4NG8jGZQO5KtBAy1ShoOHFtp7E0t+bauk0SB/oqonTXnogVFUpVw/Uq8 wv0CwDEzDyli0XdPs6Bq/zvVms+5Vcq0eSxSL7CiBIFzZ5Y502ah5Grsr4jdEjCM/3VcaZ rx3VMXBshX7Crjgb0sX+s82nZ7N4UZ0= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 855F4615A2; Tue, 13 Aug 2024 08:42:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12BF9C4AF10; Tue, 13 Aug 2024 08:41:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723538521; bh=lwqsbsNLYr/NAY4uxgyMtSwAZaoCij/qukX2cmqm4rY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FD7LH1TdysUcP3n1SbAE6auP5bdtAyVHXf3rUWPZVQR1EC39qS51lMmMomKTs3fvy 7fsB8mSnAG/hgU65T4GMmYCDPKayYBgRSRtWVmfvdU5gEtZA+kPGlUaeTzdQRp8vjf 4U7tvJjBF5qFb9kSP0xZrNyJTFcF8lSvOl0NmegGoWZBVevdSVEHorHaBIh5yFkCr4 3ob6BNnneg8KHjTpnx2o2raeE/wob3UTFXVqrK0UqM7kJtjrkHE12Xj9jXvQhYoeyQ ktd8xeRN0S6JfPDRmiWXuDQ0JLZs24fIZ42/mgUTS4NExhZ8tTjn+QBkifl5Mj3Nam btW7bLc+cfArw== 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 v6 14/21] mm/zsmalloc: convert migrate_zspage() to use zpdesc Date: Tue, 13 Aug 2024 16:46:00 +0800 Message-ID: <20240813084611.4122571-15-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240813084611.4122571-1-alexs@kernel.org> References: <20240813084611.4122571-1-alexs@kernel.org> MIME-Version: 1.0 X-Stat-Signature: ddj3xr5766zew4rhxkeq1p1cu7gsosg8 X-Rspam-User: X-Rspamd-Queue-Id: 41AE9140026 X-Rspamd-Server: rspam02 X-HE-Tag: 1723538522-693964 X-HE-Meta: U2FsdGVkX1+3rELWuXxiSd+0z89mhWS4s6U6G71jjVwX48VSiDXqimaeE7yB0m3zZeJ38KtMfuYjmUCZ0xsstWuFq/kOuwXDfcAF3VM7Z9sn3cefHzgwez5Rt3BlhEInFlrNssiJ3TX33hEgYJaHs3dcF3IsH82M/zeRfy0fCHQK5OMJuKg4LPctS8h9tqBAKO3w8/kiRwYydlHWcfyFoQLL72ltFlNiQ96Ohf/1VDCdjHDhXMv0fO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GBVdIDHaeUWMogUYhcvYnfuRGRyTEVIYahjt39UX1AgwFGu 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 9218f1e6e8ef..f93af6e10c3a 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1630,14 +1630,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;