From patchwork Wed Jul 3 04:06:04 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: 13721084 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 CA59BC2BD09 for ; Wed, 3 Jul 2024 04:02:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 545A06B00A9; Wed, 3 Jul 2024 00:02:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4CD876B00AA; Wed, 3 Jul 2024 00:02:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 346046B00AB; Wed, 3 Jul 2024 00:02:08 -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 111556B00A9 for ; Wed, 3 Jul 2024 00:02:08 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id BBCBE1C1787 for ; Wed, 3 Jul 2024 04:02:07 +0000 (UTC) X-FDA: 82297093494.06.9102DE3 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf25.hostedemail.com (Postfix) with ESMTP id C1183A0013 for ; Wed, 3 Jul 2024 04:02:05 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=UAi8VdfB; spf=pass (imf25.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=1719979302; 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=C6FyzEKOSWI6MCvUbbMT9Jgk3QqCa38I6z6Mp91Wydc=; b=foq4mGcJWCSP1oK/3wwC+En/Bn0NI1CBkipUtebpen7gu+NdZe4Li83lt9wGVxkUFmUHaL xTRHHmPYLYMPCa9mj8ypIZjtZDbKd3MTEKY3GpHm2coDdZyhHE0pH7eqpWuUBnLHaLhF6V AwBmya50eLydUXOFUQo1ecczkCuD834= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719979302; a=rsa-sha256; cv=none; b=eHe4ZYwo/3rubxGH982aieTUcbQbcRUgdSKUWAkCN5IKbn35dsvDw8I3qTg7r+T4DxTNL1 2SlaXzEcZ/BcIRiVkn4DfERYp07VEy17kVg1aB5ZvNCyhMosO/BgzQIVyWssubxOXrydFj hIDmr4yOOv8FGG+/J3HkxoK3oc4OGE8= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=UAi8VdfB; spf=pass (imf25.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 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 37D77CE21B2; Wed, 3 Jul 2024 04:02:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D940C32781; Wed, 3 Jul 2024 04:01:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719979322; bh=K3GUIiHemMLy8fa8RNH072Iq/pXEu/mTjv8z/3myXkU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UAi8VdfBMIZrg0juq8txVEnN9W0EIBUjwpsOIiZcXYiKs8oR980Yy+uHO+fcF89px gU3DFwUpEt4cZuy68LLq7XCBh43WC3tWvg/b4RPgShtXhVSLkiqtHB6Cw08GmHBaVy t6TqfuihXAZJUFK2cGbb3I5U/kDa7LC25OR2aSeCr9jAJietiU90ZjWEIYzzKKbxcN IWqeUfxpYZiX8g7ytLWs+EQNJ2gLMuYGRelGem7bQ9Fgma33GDoN8rvUrqdybqMNJr Ao86j0XjV9Ea2MaRgEYnIk5y5CDjM9z8tG8mHiz0IxMP9HeX7MTYQa268tc5x3zpae OkY1Nxw+l3/6Q== 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 v2 14/20] mm/zsmalloc: convert migrate_zspage() to use zpdesc Date: Wed, 3 Jul 2024 12:06:04 +0800 Message-ID: <20240703040613.681396-15-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240703040613.681396-1-alexs@kernel.org> References: <20240703040613.681396-1-alexs@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: C1183A0013 X-Stat-Signature: 91bhiupzqaheahgdwh51inb99jh4odep X-HE-Tag: 1719979325-10968 X-HE-Meta: U2FsdGVkX18Dvg5Nimtkm4ySLQbZljxuZlJjhX7pJ8c0kkDd+boizGrmPw78HwjE+SYELzkXdXnq8y+xmdbEDKgRBUiZtIlu6MjxrbOY5xcOAA3PhPpuI/4GaHYi6gYVxdD6Fyzy+ffmpoBa0a3boW2AT6EzhJkdQS+MW9SWFn+i9My7GgSKBBxeQnZUC2zbsJV8gMq7OgxsuOSTJxLdT2jlC/u6IO/ntLt6N1u4Lg7ViendFIJny9AFPlV1ipImk+6ILM3WpGy9kZ68dV1B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gbDfXGZpfvRgA== 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 e291c7319485..7d039b0c66db 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1636,14 +1636,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;