From patchwork Thu Jul 13 04:20:32 2023 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: 13311281 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 3131BEB64DD for ; Thu, 13 Jul 2023 04:21:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BE50C8E0001; Thu, 13 Jul 2023 00:21:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B94F1900002; Thu, 13 Jul 2023 00:21:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A0E3E8E000C; Thu, 13 Jul 2023 00:21:47 -0400 (EDT) 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 8BDCE8E0001 for ; Thu, 13 Jul 2023 00:21:47 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 68183A0100 for ; Thu, 13 Jul 2023 04:21:47 +0000 (UTC) X-FDA: 81005290254.08.330CD90 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by imf24.hostedemail.com (Postfix) with ESMTP id 98B74180011 for ; Thu, 13 Jul 2023 04:21:44 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=HhBiTuA3; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf24.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=1689222104; 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=aqbwv8O+lxJHxid3fsI/4aDUJzUIFl2vk+EDGGzJMlE=; b=ieBYVpSwlC2pVVttmBac7DDNn4tPQe0uArPsWttyX+1OfjW6ynCBi92H2UzxRS9rR2uGQL Th9IS4JvKtqZUuXZDwPxuXzmLqxCd4IASQ4//PON0WZr8ql/O64JITigEWCJI4iZgHQann e05Q93SdHL0CcIUp6ctsy6lMeqnMGKQ= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=HhBiTuA3; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf24.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.210.177 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689222104; a=rsa-sha256; cv=none; b=ABT4Ib9PjgrIbVPLyJKOODW3Cr+cHa1VcFeJBijVYp/BrnNjgPsOJSrC6RtNkAm/xgzQsT 0dXbY/noSTG7OhlVeFUZ+FlJLvRoqwit2zWGUpM7OQkB9+SyGIkSDyqj5Teqr/NDodCHXs +WfiNScfxk7INOop39CSiD6sQhvEo5o= Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-668711086f4so152300b3a.1 for ; Wed, 12 Jul 2023 21:21:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689222103; x=1691814103; 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=aqbwv8O+lxJHxid3fsI/4aDUJzUIFl2vk+EDGGzJMlE=; b=HhBiTuA3YRFVYYtX8/M0YJ6lb1HKlwUn3kN2x4yXQkPMRexnTuCNWiRQsxPM4Z3iot K/7cVMrpdqnXwqA69sfPQzAirtFx3g33cYzX2PZR8LeFPkVsNkqyf3a+CqglzU6PT7VN lzTikbIsFgelxLz6BdKj+2ew5u6NbqpOO3A8TU+aT+87uJAmc1FaYlwxI7hX4YIecnWB 8MrcygZ1GUYj35Q/AdYZJYSlQ55TU5BtSv5zHrWoTbOL/rt43IIq8zzrExczRxc1Chwm VN3KzXoIEVrT5+2xolvk0RaRzKulzYpRW+TbtM4OQXgGLLRrFe2PG8vfUgcZH9O5BTyb UqIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689222103; x=1691814103; 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=aqbwv8O+lxJHxid3fsI/4aDUJzUIFl2vk+EDGGzJMlE=; b=lhhkhw75n4sXfRFbyffKAMOZmhYtvZ1eFnKAlvWsFpJi59GIogl0oLPBdY5yB5G9cx WclknhtFnI6rynCwnXU4asuEj1ZSVbHVHq0addTs3d9H804uZhFnSHvbVzHrUktpy0wC C2f1nx12pW3G8tQElJ2ETl4UVVkQDneZyj+oXg5ztm6kswFirNvGGlwZKgCbPthSrRen Wy3R5enTtJ1DSWa0xjDISJudYkZscPaM4sddGbJD8h4Eqvd5utrrJnWxt9dK8FIxL3rI UKBHlujy41qax1elDDIa5yZK8PGnIFKcMubHMU0WLcUv/NY3F/vhLRpWdexUDlD1X/X5 RQow== X-Gm-Message-State: ABy/qLaT483ShOkMtYapJ+sloBbQeL1MIMSkJU2rvPQJoJ+34xsMCTzc pU3UkOo9eBDVyNbYEehbk8s= X-Google-Smtp-Source: APBJJlGOrtV5hOsHEJUq5S+q2K6dI2JgqQtu82o3Vjh0U5YJbxX6e/q+RqfdVpeSjj/rqTPUsXDwYg== X-Received: by 2002:a05:6a00:1582:b0:681:4274:eef0 with SMTP id u2-20020a056a00158200b006814274eef0mr1212636pfk.1.1689222103209; Wed, 12 Jul 2023 21:21:43 -0700 (PDT) Received: from fedora.. ([1.245.179.104]) by smtp.gmail.com with ESMTPSA id u18-20020aa78392000000b006827c26f147sm4346601pfm.138.2023.07.12.21.21.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 21:21:42 -0700 (PDT) From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Minchan Kim , Sergey Senozhatsky Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Matthew Wilcox , Mike Rapoport , Hyeonggon Yoo <42.hyeyoo@gmail.com> Subject: [RFC PATCH v2 17/21] mm/zsmalloc: convert migrate_zspage() to use zsdesc Date: Thu, 13 Jul 2023 13:20:32 +0900 Message-ID: <20230713042037.980211-18-42.hyeyoo@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230713042037.980211-1-42.hyeyoo@gmail.com> References: <20230713042037.980211-1-42.hyeyoo@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 98B74180011 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: xjo1wytzm5g86p78n3e1k7fqfomt4k64 X-HE-Tag: 1689222104-55510 X-HE-Meta: U2FsdGVkX1+AgIhA2tzxfEvHJs1KnFzYggvWWXIMjhZ0XvRP7ArJ2oT9Bqx53eyCc3Ey91hMl7swIiik7/ciWllG1singyW+MUuSz9zk4/iQa5vJsdPYGySIrgZ/bphyOeYtzNFn8LVV78QRz+9FnU+tVxOSYZMsKkla2VCwNTazLUm5SbahwUXOyhYOjlcVD9pbakQYcnAVk0p48OdzfMlSsotfVTg2nExu/vOkk1oj0P43POm4xDA6t0jRRtnPs4aV+HDOcWPpg/J8BaKXj4/uKflNoy5N9Z7zwdeoQjHWniY6gSx1tATBchAgTBRzVJa8Ze/AMXOQzZpzUwsAYnabhodsPUayHwfLtpBanZ2SU8RK4j0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SdiiCMYiF1oCWGmzLMT8funWuVazk1AS5z1303BUx0bOr/E6xhfaCcj8eh2994sALutpeLvndmJ70oTu/PgtSL3mIabmdfmSIHb62B939BEjckr1mYtjrjdco8crmaa8c4ICbV7Ys9YTKw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000009, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> --- mm/zsmalloc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index fd920b659b1d..db43a5d05233 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1746,14 +1746,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 zsdesc *s_zsdesc = get_first_zsdesc(src_zspage); struct size_class *class = pool->size_class[src_zspage->class]; while (1) { - handle = find_alloced_obj(class, page_zsdesc(s_page), &obj_idx); + handle = find_alloced_obj(class, s_zsdesc, &obj_idx); if (!handle) { - s_page = get_next_page(s_page); - if (!s_page) + s_zsdesc = get_next_zsdesc(s_zsdesc); + if (!s_zsdesc) break; obj_idx = 0; continue;