From patchwork Thu Dec 5 17:49:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13895899 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 D467AE77179 for ; Thu, 5 Dec 2024 17:50:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 638DA6B017E; Thu, 5 Dec 2024 12:50:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8D1376B0180; Thu, 5 Dec 2024 12:50:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 132956B0175; Thu, 5 Dec 2024 12:50:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 00CB16B0173 for ; Thu, 5 Dec 2024 12:50:07 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id AC377A15AC for ; Thu, 5 Dec 2024 17:50:06 +0000 (UTC) X-FDA: 82861643508.30.C59B97C Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf07.hostedemail.com (Postfix) with ESMTP id CEC804000C for ; Thu, 5 Dec 2024 17:49:48 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=lrzOXJaO; spf=none (imf07.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733420994; 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=f9iCiFRqV3HwmoRr2YS5Im3FVGBNrODuI7pmeIvlk8g=; b=D5UlXoS2LJEN1gDhAn0OLZqPrxv8RcJMlTfTwuTv6cKvnOmyUxYV6ttmC6NYBzm6XVtZpU No5ZoCW/XTOIPTLQEouufiO/ZDUYTtAs8MEged3Ni8ZbhYLac3UykrRJrUc8W8Oyc7Ddu8 SQEyFPD9XbsmBkjof+DJ1LU9rv77Z5k= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733420994; a=rsa-sha256; cv=none; b=TuAOVSWPTNJBIq4B8MvTY5Ji51W4/vcmcK66K+SPmmRzL2OEQ7xKDdQbHmBZhLE/bBonVs kXgIbwonpQM10wuumLCCmnUbQfnx1UdltVo10C1tmKXp5jT8g3nbBuXUgDYV8tF8bJeRBf VzJ65r7ujeH1Nn0isBoheMD8qZyBojg= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=lrzOXJaO; spf=none (imf07.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=f9iCiFRqV3HwmoRr2YS5Im3FVGBNrODuI7pmeIvlk8g=; b=lrzOXJaOEbmyRI2EPx98aASDUo rBwBePTubdOlgckSeyIlvKOj1rUkJJvBQ9N82hMfC2tj2gJRdH47d+E4otZv9DbbBMETkXL2dhKy1 ElZeLTMDSCQb+Kbm1EeaRZiIi4hqqmJuFCD3HwqsXAToWHyRvWguZ+SUlbjOPNuE/4XH2z60wTgjk YBeg8XVh1bkWOGGg/dKB0lqKxR+NuZm8zqhr1zpbDO7UV0LBBy/tXRV+ZcZNUfAn/HbYyPqTHtGc9 iJBOXSHInQ2hHjHXGufPNAW7L5Etw7NHSggYtvKJeS+XXeurCYGAliY9zTuZY3IJqEJ/RyWeoxZI9 OrmY+2bQ==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tJFzH-0000000DN8m-3wci; Thu, 05 Dec 2024 17:50:03 +0000 From: "Matthew Wilcox (Oracle)" To: Minchan Kim , Sergey Senozhatsky Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>, linux-mm@kvack.org, Alex Shi Subject: [PATCH v8 14/21] mm/zsmalloc: convert migrate_zspage() to use zpdesc Date: Thu, 5 Dec 2024 17:49:51 +0000 Message-ID: <20241205175000.3187069-15-willy@infradead.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241205175000.3187069-1-willy@infradead.org> References: <20241205175000.3187069-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: CEC804000C X-Stat-Signature: mbounycjgm5hjhff516yx6yokswgcz1x X-Rspam-User: X-HE-Tag: 1733420988-717085 X-HE-Meta: U2FsdGVkX1/0hTQHJDOjbXHJ1d/KoB1kVI0o/RUXIm50yIIPfYsrXBigB/ya9c5a8KGs285+wMcVaOyRe2zJrPMTdDNQl3KeW19iWDKrh1/trbLE3jGXZTfIHKohn4MnYWbBwBO9qq9rFsUyUZIwG+5Ex3Oc7D7cVqznyVHhN4/a8ruifSFSGhYt76PIPfqxcVWbGf0aiYKIjZDJFnQEQ1ynzf0tTmCIPeZPSAC23DFc2wV0frOOqapoX22kXlNeEF84Ngk0ThPsbx2tQSTQLZI8uf8RA458aPqVPOpB66ppVJkWs76fghnfPGqxLJ4p2mp1l9W5DZsYusYpryvv6Sf9X7qsXC1zj8jN/MAxbNCosk/hkUV8jRNn5/X7OKPBuF7idYPlBRRN0LPnMGH5FfcwYXCqP78KFyuH7uGuMoJy/Uhr+X/VKOTR+nuUbine2hJH5jiAYqQDDIJY6oRY00y0rTR+fC57SHc/eSekmj3PAOfe/sGbcn33nDrmgd2XUSoFqotiRvoNzgsNj0NWHUbVnBiQOK1sVDOvlZ1NnnFUAcPAAm7AnB8F+Y3/LRehTX9/kjKvDT1nLTg8tGOx+G208A7sslD+tsA8Y0Zbl94u+3oX8h+hKNp4MVKyus6RtlIU1BnnORacD9DfnR514ocMWL52kPC2v0HUS69fMGjC5Q76zkXzwq+sKekz9oyneOTuEjZkUrvSWT9DMNgGfjE6IvcE6z9IhYT4TmpznN3PG7Qi+qdnMf1pTka0yJ3jWIkI5FKDwVbamkLlJNDLoDARzQmQYSLcd2/ccXUL2ofgMgJL1rDKnfJ2cn7UMnEbOdWeBHQBNf9mQ8JG4cmqUgaKv9WYj5MQ6R6QiVs/paaauRp1QcceXZ/1HTueN3XGuLmdxNmRz6Dk/RGgMJ1EhZWIJc+IwtFcd1yAoeLT5q3cNcu8ccxJwsgev4l3onTH1G7A5VmFwbJkRG50i1W Yn8hzNhS NeOS8akMBb7VXtw0BLhELnxmB/b9KTCRSf7duZWlKdsigKBbHB2NXZn9p3JocJq6WgywoHZBb7b5A2DJc17/WI7uW0YEVT2zlxw/rsCX1xgiXndwF6GyqTstLYQusFPOhoKwZ+pG4t8OmeCkerXjt0IYMOYSOHtAb0IL82DJ17ivhiIm3w/8Vjq1kDzw8iTjLx/o7bpuByidv8wm8ZcLD+wRJd+vH61fro+eRT7GfNPtrl15/1YkRIDd7UQ+1jqQUNmqYkPoz0tnnYdsld05OJSQrOJfTdELu5aVCR7u+KVoHOa+Gng5CYl5IYRW2nv96nSF7HQJmRRNsFkuskUcM2E5T4Q== 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 2960258c9cda..6b05d0a47ed7 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1621,14 +1621,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;