From patchwork Fri Jun 28 03:11:29 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: 13715400 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 BFDF7C30658 for ; Fri, 28 Jun 2024 03:07:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 509466B00B0; Thu, 27 Jun 2024 23:07:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4BB036B00B1; Thu, 27 Jun 2024 23:07:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 33E086B00B2; Thu, 27 Jun 2024 23:07:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id F1EF06B00B0 for ; Thu, 27 Jun 2024 23:07:43 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 778F6815C9 for ; Fri, 28 Jun 2024 03:07:43 +0000 (UTC) X-FDA: 82278812406.20.840FA9A Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf12.hostedemail.com (Postfix) with ESMTP id CF9D340008 for ; Fri, 28 Jun 2024 03:07:41 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=aECRD5kR; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf12.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719544042; 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=+bkD7jUtGiZOZPGmOXqtYdB1Yh2uJS4UWLM8jt2hvrk=; b=7ODnG7Efw5p/WP6WnjWsZt17TSTZtLqgyUnPXwdI7/Yq4RpAX+ywqkOfGmlAYYW20ZS6Ak cIBp92Emm0dpBvGbWxB+vcZmNV+nQdshHrDDSFq4cbOq7uvyI16oCpGWAOqCA0p6lyJo+V dNNzI1YPMTxMbrYUroKuINbRjtCWMXs= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719544042; a=rsa-sha256; cv=none; b=ZrzyOYLY0CfmXfVvPMl7l2EX9TE9nFLznjpKMpclfrgQBzjbJfYoGKPrK8PiTcgdxctAWA pJVk+F7/gCWtoYzxRbTwqfnIkekrqiclpQMSoNWugnkOFJF+1TCjMtHBW+CP7MEU/y4+OX DzP9E7RVWQW0C0aLFq5kPMOZl/5+nNU= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=aECRD5kR; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf12.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 078FA6205C; Fri, 28 Jun 2024 03:07:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6B02C32789; Fri, 28 Jun 2024 03:07:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719544060; bh=6AxrbjsULXI2U/XKKk6mycuO4iJeWrzhsSGBcy6kdOQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aECRD5kR9xoAvSpndBIFlgKo2JqqxBip4pTFrYHYczi9pt2fEs0YDBL3FL9ihGLPN dglkNp8v2wVgW4fRUFamWff3pQLICuo6u4rcQytZJhWVKePCQKo2Z1pc4Keqr24Min kCxKz85MfgScoKYa8Jmkhm5LUaoIo6ll2NeyVgC8MU1CIjZATofW4L/z07K/VsOoNp Hg0xPuVEK8REdGAmwy7pa3YxAZ/RfCoVSfYm+87q30iT1p6LByqLPnnSQGNB3DHnmn L5Ph4XaeiMvUxy/hGgtGom2xh/BcTHyMdCpa9KAncBtu+ct1oNvBGLFPyrramw0rrJ Gi41UA6Yh6veA== 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 14/20] mm/zsmalloc: convert migrate_zspage() to use zpdesc Date: Fri, 28 Jun 2024 11:11:29 +0800 Message-ID: <20240628031138.429622-15-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240628031138.429622-1-alexs@kernel.org> References: <20240628031138.429622-1-alexs@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: CF9D340008 X-Stat-Signature: zmb6mhy4bx5qwzbxf9cnbatitn9kr8xk X-Rspam-User: X-HE-Tag: 1719544061-459113 X-HE-Meta: U2FsdGVkX18UFOHyNDNTQiNu1accEZyBS0QZVruM0fEoof9X/TQR9O4VfsJrP8oqmqdMageFKrs2BY6UT/2ZHwKv24KEYCIUZgYgZxQi0AWe1dtRcrb9vfK4vI+YYLoDbDOxCzjCtf3GXniN6S6JStQvYSi+XeUo7QXI+uEMaQZHBqjZjZBfQQWaEhx5DuqzFMViFU07xcVIDQUZ+YB57fzpV5DvFg3toiA06jJSk7WvicGmdNZxo8ZwSB1N4PUdQsDBbO7kQyIGG0VvvqLFnsouWS6rJRvZhKsIRS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CH 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 e8af01768ae0..a10af49d8d08 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1640,14 +1640,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;