From patchwork Tue Aug 6 02:23:01 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: 13754331 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 65CCBC3DA7F for ; Tue, 6 Aug 2024 02:18:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E5C056B00B1; Mon, 5 Aug 2024 22:18:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E0D4D6B00B2; Mon, 5 Aug 2024 22:18:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CD34C6B00B3; Mon, 5 Aug 2024 22:18:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id AAB136B00B1 for ; Mon, 5 Aug 2024 22:18:52 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 5F01CA0830 for ; Tue, 6 Aug 2024 02:18:52 +0000 (UTC) X-FDA: 82420212504.15.897A291 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf14.hostedemail.com (Postfix) with ESMTP id 48ED6100008 for ; Tue, 6 Aug 2024 02:18:49 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=QC1dagSP; spf=pass (imf14.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=1722910682; 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=rgwNPyWZEA1v6Q304XUxXEQlyQ7bgtgwHhwp+EhAfp4=; b=xMjqoMah7AOrutJymEqHwpUoD6a+du6Fll7nHMGoQ1X6hq46Uy78T6DHGfVxNn8UtOb+PZ Di+IozDx8V7/yZN/XUGkyw7Lq2bGWSFc497d7iNpvRj9m01dCzd6GyEKtOKNg90NU/zlq3 oX4WFoufL5dWZIjqlHaciu21yZmhwOk= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=QC1dagSP; spf=pass (imf14.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=1722910682; a=rsa-sha256; cv=none; b=adC/eSbMnRMQCPVxBoishVifc6Jw7QhU+cjSmZhYPP5nOheSVFMU8HTrH4FEMsT1KXhx3+ s3NiHwteg1goPxb+gIFrypnTuICr5MnrZ+X/goW1KZ2DRxvBHSgKNmTKGvHyHHZ6fJi3We /qAZ72umsgdM6n3TaPBNg6Dd8vb4fBY= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id B2D16CE0BBD; Tue, 6 Aug 2024 02:18:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0788FC4AF0F; Tue, 6 Aug 2024 02:18:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722910727; bh=UE8t+seeM35rl2H7JTm6eRVAxobMBm5PBazGBdplkkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QC1dagSPDYyeNnZc8QopLpLhTX37estqkQpAdmcGKNJbVDWh/qqd4LXDnB9rPkwo8 a5aYS0P0SofZMckIif6UjPr4WkZzfpHrUzYIMglACX2iFlDgqrD7MmCC1PSWaPV2XR 4s7xbWyqt0Pf2yz0mPj8FaMGg0br36C84Q2I2Sc6N0UVKDmLr9mQ91j5HduyA7RXQf AJgeqEdBcb0yfzmxjDNiltYEvbGvoZFOfiIJiYLj8FzzUrjCgp90Qm3abdIcIP1/U7 vHzJUWdv9NoTlwyaXv/hHPPUokBHRBunGFV9102zXdOcI3xZq4MGWE5tUhw0uLYS/A Koq9n6XXYdWFA== 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 v5 14/21] mm/zsmalloc: convert migrate_zspage() to use zpdesc Date: Tue, 6 Aug 2024 10:23:01 +0800 Message-ID: <20240806022311.3924442-15-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240806022311.3924442-1-alexs@kernel.org> References: <20240806022143.3924396-1-alexs@kernel.org> <20240806022311.3924442-1-alexs@kernel.org> MIME-Version: 1.0 X-Stat-Signature: 15dz6pwdnifccjqa4fdusedm7ub83y4x X-Rspam-User: X-Rspamd-Queue-Id: 48ED6100008 X-Rspamd-Server: rspam02 X-HE-Tag: 1722910729-827064 X-HE-Meta: U2FsdGVkX18DOAM8SEKEcvGmlYujuRkjPkuQSdz0gInHLLbiERi9pBk+szB10feA3LQoP3lCiCH6HUsvJ6pVsfBKO6XyWyC+Qgcxa1QG062JF2t6eeVSvnglkDq49SsU7afa6VUSZtwcNwl5DcGPqPg4SDxLVdjteCzzgosmPJ8/GnvJbgVk+DjuLheXormluJHoUyGgZJgqWv6EdnG5JNabBnwFEa/oA0q3FQWDgJm/EXXrgGKUj1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vF/Exeune7KcnwLrACQeDKA0StpBdxbM2nX2oWzoEAsTd/gKkKetd+j 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 e6d1bd8969e5..c8a533b516ea 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1616,14 +1616,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;