From patchwork Mon Dec 16 15:04:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyeonggon Yoo <42.hyeyoo@gmail.com> X-Patchwork-Id: 13909892 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 221AEE7717F for ; Mon, 16 Dec 2024 15:05:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 971266B00A9; Mon, 16 Dec 2024 10:05:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8FCC66B00AA; Mon, 16 Dec 2024 10:05:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 74D096B00AB; Mon, 16 Dec 2024 10:05:55 -0500 (EST) 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 4BD126B00A9 for ; Mon, 16 Dec 2024 10:05:55 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 097CC121118 for ; Mon, 16 Dec 2024 15:05:55 +0000 (UTC) X-FDA: 82901146398.05.5BB3FD5 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by imf05.hostedemail.com (Postfix) with ESMTP id 95358100027 for ; Mon, 16 Dec 2024 15:04:56 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="jejRY/lM"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf05.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.210.177 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734361539; 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=XO1TL9t9sEITLWXz/LO/dGGG6UxP4KNUE2euE6Hbb1A=; b=15+ff7iXGjwuIPqCyRfhLXjnDxEbDiaQ4f1y/Dn/8ghQqS0uIvgnkty9hmOc7c6ayZQr2F kvQ5gIeONpvtq/rVbvgOQc4m6kGLKDCbBEwhHQ5x0q9SyNUpfoHDmP+h3Lwa0Fb4QSCoQ1 N/jTPgTYEunZBNbGNvB6/PIydCd2YLU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734361539; a=rsa-sha256; cv=none; b=bBnbfqydADWFjN6HU4PCZdr85IvrLZMFCxx1dMq/avYBf8c137D4SAA0wwJR8Ly+HFT6Sy os0jAfZsB9PGP2NsD6Q4hgv/dY/4mi9R5WdQ1KYmMxChM83781pVVbkj33a5cKXSrlbU68 q+TUoKloqW3kfYibGG4Eu3Prc47Fvms= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="jejRY/lM"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf05.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.210.177 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-725c86bbae7so3496998b3a.3 for ; Mon, 16 Dec 2024 07:05:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734361551; x=1734966351; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XO1TL9t9sEITLWXz/LO/dGGG6UxP4KNUE2euE6Hbb1A=; b=jejRY/lMLvwTxdx15sfZ3TGs5T6hZ0+cHxx5pSHStBXgTDWRr/oifN0sBouvnuz5fE E6FtIAOjY6iLv+K+XK0Xx3NF0D8gbAqGih2DXkBM0mKt+xAJ2EBDLTY1LvQb8EAjjByZ 3lmaVfZeOiEK9sLunjgDOpV+V1Xno5bo8yd7m09gEwmH5xQxIEWki0p/4n67BGDuFklz obrxPi8xFT2s3k9O4MKV8cSwyufg5JCtqHx5wtu5JKjrPPOSFs6jJccG9DTwr/d1wxsl Nw/pFt/qJxIiUpUhmYnRzLoKLUJqb+wo3BgV73nopv9TqtVE7wfgB6OB2QaqKHo471sT C+ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734361551; x=1734966351; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XO1TL9t9sEITLWXz/LO/dGGG6UxP4KNUE2euE6Hbb1A=; b=nh8XW69UcJSvhvFzcb6b4xehf5cHinhLO6tPO9wVCLdZtp07IrxTRJbtmhajYq63Zl k8GDwTqqyPfUgjxK5OzhNeM3SobqbC53qrXvyNESI6g2Oq/6Vg9Ou1i/5f0Y7gGDknFW dd4PR06MngaVwvUPwXfWxi3J8epUEV6TUCKk9eZim7hIj3l3tPOvUN/GiHUn0vbCvSWT 3H1RT0hvtQuy4o6GaIciA+uvCOSFyOJbaVPXnz5ELGT/WcWINs4Af38D3NaYycC/S2q3 AcsP+kqS7lzP7h+ZaNCf/qkMxT8QxCszA10KRKfDbug6vMMchzYCCIaYSPMWb2VoLkt0 zrkA== X-Forwarded-Encrypted: i=1; AJvYcCVJzZ0fb/xGBWbqy6yje+Rk+kpdqYYN9fw9wkd+hEpYWVHq4Dq9kFkzWC+12BNeKuEssIfBLJobaw==@kvack.org X-Gm-Message-State: AOJu0YyVFM1/L4anhoazk21Ux4tqe2+P+biagqov4s5vkTPnUW5byv6P bUnsDyd0WHmG9kSOw4EI7d9050Vv1s45BeCH/dc7BiZQ4GqFHs8d X-Gm-Gg: ASbGncsN3+V1JjQbbXPda7fF0sIHL7AfRe+hCVizzbThexVVcS73Ukn+YFxVGu82dyE gntlAK4KR/XekAQHqYOKTUxSdlrh9yhvCsEVF7GEyId0b4DOmVCylHnbfjgyj2/06Bvu1oJ2zb6 erMXUJTIzxm5fErdNamYlr1qLqy9SCPZyY6TDfWhhX1jCpSGfVdW/6n7lzC2/VyO6j/yDGJzrGg J8Fdjt+DXTw+elfTqM83akZEQ2V7HkaBsmUkg9qm8GZJzHCB/vsO8rm9ub0jhgq2mI= X-Google-Smtp-Source: AGHT+IG5LuvGfGpaig1ary1c465JvqAs5Bu04SPm4PsX2qjUDco2WwufG64gaNPOuGAhiuIzS/zBag== X-Received: by 2002:a05:6a21:33a0:b0:1e0:ca1c:8581 with SMTP id adf61e73a8af0-1e1dfd60b37mr20606589637.21.1734361551510; Mon, 16 Dec 2024 07:05:51 -0800 (PST) Received: from localhost.localdomain ([1.245.180.67]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72918ad5ccdsm4845518b3a.74.2024.12.16.07.05.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 07:05:50 -0800 (PST) From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Minchan Kim , Sergey Senozhatsky Cc: Andrew Morton , linux-mm@kvack.org, Matthew Wilcox , Vishal Moola , Alex Shi , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Alex Shi Subject: [PATCH v9 mm-unstable 14/18] mm/zsmalloc: convert migrate_zspage() to use zpdesc Date: Tue, 17 Dec 2024 00:04:45 +0900 Message-ID: <20241216150450.1228021-15-42.hyeyoo@gmail.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241216150450.1228021-1-42.hyeyoo@gmail.com> References: <20241216150450.1228021-1-42.hyeyoo@gmail.com> MIME-Version: 1.0 X-Stat-Signature: aawq9f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oWWFO eQVdFNmk IeSxLFLb5StggBSVHXLt7Cd4pMLEJ+AJK+Ds3yLsWZj3bH1+F9u1aSctq+OsHo5Y/8xffu2lKR4sG/WOHdHzF+nPpU7TI4XZnr18pb85zV6dURCyMj1eYWwrfD57aTjU6+dCIintyJ6PbIBLAFT/Iym4iPt3IHtZVnVEu2m0lbZLlXvLLtC9JXJ64s5lrGhkhYxLc+OFSbrCrKlaLfI6b7iInEm5b9QswgpA+KuJ8WtH0ntlsT26sLu1vrGAf9ARQMiMo0q7y95RGAAhXJws0ClF6zDU/XQL5gv1bu7qAZBp5qKH+HQ1MWGK5DVj1a6Upto7ELz9uj1Z2o+ZC5tRB50jeBiEKDJmsTtLvyl2NqVey7BdT7tG+16yqQz0ZbEBEk307G2vD9iBtthn8RCoLR0VaM9TGjB0cU79KWrdKLFPgoRiEhcA1fLGzK0PdaCItL+DmRuUoW91v6MEvRpAYkU4X6tCOo9gPdpETTduxdXRM3Ew8tPeuxGW/Y4H4HbupKMxzzgIb21RyzsHrlexMjPJyVSC9lTxxx+J178z/6ISv8oc= X-Bogosity: Unsure, tests=bogofilter, spamicity=0.499355, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 37212964a365..19c1ca3957f2 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1602,14 +1602,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;