From patchwork Thu Jul 13 04:20:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Harry (Hyeonggon) Yoo" <42.hyeyoo@gmail.com> X-Patchwork-Id: 13311264 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 81A8CEB64DD for ; Thu, 13 Jul 2023 04:20:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D1DBA6B0078; Thu, 13 Jul 2023 00:20:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CA6926B007B; Thu, 13 Jul 2023 00:20:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B6DE08D0001; Thu, 13 Jul 2023 00:20:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id A15086B0078 for ; Thu, 13 Jul 2023 00:20:56 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 49D1F160108 for ; Thu, 13 Jul 2023 04:20:56 +0000 (UTC) X-FDA: 81005288112.07.A08CBCA Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) by imf18.hostedemail.com (Postfix) with ESMTP id 9AD9A1C000B for ; Thu, 13 Jul 2023 04:20:54 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=kZPDfTp8; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.167.181 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=1689222054; 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:references:dkim-signature; bh=YPThBi3gLHbiMnxNJA8Pqg7+B1TGtxLdGO8OQZP+rPE=; b=JfssQvqz3zFa1eaCMuwmvlHX4WGG9giHOMpf7pmc9iVpAZnXP75Dobgu1OCGZVh5Oazy9a 8Afiu/xGpK/GPiRkglC+pP8cCP5dEjU6G6FoCidbdZavjHfgTCpj24iWus3G1RTXapZtF+ OIlljJtI7b7ZRcs8jADIWQc3egp44b0= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=kZPDfTp8; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.167.181 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689222054; a=rsa-sha256; cv=none; b=v3yArUBGQtqsWHwaG2IePTekE8OA4A5c+6Kd1i8cybffg5QEHQ7KPP8OjPApXAjkkyzYCQ rFfyu5OiHu4HG5BVqqQbhP09MxlGSHFIbulZdv1HZzaEbdZnfsep98Q0hta/stpSGXE95U 2tHqTK4tDcE9X63v7fyHi0tgmo9lHcw= Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-3a3fbfb616dso258617b6e.3 for ; Wed, 12 Jul 2023 21:20:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689222053; x=1691814053; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=YPThBi3gLHbiMnxNJA8Pqg7+B1TGtxLdGO8OQZP+rPE=; b=kZPDfTp8BiBR6nr8WXBNq/Q0pG0Jj/xtqusNHh+GQB/o1+8mYiboEeIDaKy4oTDCaX m0KbGb1TzIiljMKK5ecWb0kViWUeZV2R797gxnFo6+8imC+dLU+UECElCCtJL7vnR6y4 jUJyurBGHJcWQ38PoVhHxoBS4hXToDnZ9xubwSOPm2NGnZqzb+9kIMJN/xNj0PaB1K5R HXgmxuwxbcPjmzN5eIT43t+HluklQTar/sMWaOE4MEBtNk84zA5Y14aVVhuAsmlfKwfK 3IFEnmFQeSTP1E/7nxPsTWWv0/c0/ZA7IZJQMapCu/YPDw2sN98paPG0h2DJ2XhCLKNL KGZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689222053; x=1691814053; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YPThBi3gLHbiMnxNJA8Pqg7+B1TGtxLdGO8OQZP+rPE=; b=Vd2rPNie/Z0hWIPPuCLRnQHRC6udDzC5rptyRN+CW06U3h5sDEiBBN068N2MYPNU08 wH9SHGJwiXOuaZOUZWgIMbjRSZBBBqHKmgfcZPTIOWH6o378EdKglpavgzP11cyzIama n+Vw1DLblhNQHOKFJJA+688O9fKJONBYEqya83vZqopzA+UJbTUUGQVGZehwI1PuqMmi O551PlSsZX2nGRMC0V+6QVY1wTgJJkwd29WY5ykYTM7ou2I7FlteZs+LXN2sOJ1XkyY8 SUfNmAMfWlCT6hB1jr+s2ShYG8LVaifRyZZyM55WXZjmrsQE8w2TQnrqxzefdg5djKlu Bc1Q== X-Gm-Message-State: ABy/qLb4m0I809iOjAA2tQ4VjYEQ7fWWuEM/exCM0fvB1sCAwYJjvhHg 64gWOwEV5DcFDBvRa6VxYVg= X-Google-Smtp-Source: APBJJlEVeO6bzD9JRQ8lZ4+gjyfbYmqIa4dFDm7lRrzAYkMXt3pCuCK4fqd2c6VMnQYLZNQX3GlUCQ== X-Received: by 2002:a05:6808:148d:b0:398:34da:daad with SMTP id e13-20020a056808148d00b0039834dadaadmr648193oiw.51.1689222053542; Wed, 12 Jul 2023 21:20:53 -0700 (PDT) Received: from fedora.. ([1.245.179.104]) by smtp.gmail.com with ESMTPSA id u18-20020aa78392000000b006827c26f147sm4346601pfm.138.2023.07.12.21.20.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 21:20:52 -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 00/21] mm/zsmalloc: Split zsdesc from struct page Date: Thu, 13 Jul 2023 13:20:15 +0900 Message-ID: <20230713042037.980211-1-42.hyeyoo@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: qpk94nu3k33bfuyrhknnabetn9ffhm86 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 9AD9A1C000B X-HE-Tag: 1689222054-267330 X-HE-Meta: U2FsdGVkX19CEx0bs7Pi+PKPeSPw6X7tVAJzIOj2c1R+0nyFEiKxnPsXYm019OutJqgpQzolm+xx7n9L4BNmnMZ/FjQ3kZz9GN0Bo35HfWAcfKY6scBifvV4BWBAXBrLd8OyKaKp6b9he95d9f2SdLveaV5Icir5JnrgdmXg4KgJKuuxDDzr9DHq9sX1luWSwl7d+zr7rlc4525AyOuzNpNY+9GPsip+nfPv6BASJxIxzHMtNFvbmppcFhFTX6vFcAgJ97ZbqeV3Oo1zWEtlEyFb0qFuhtmptnAHA4kPG61OCh7u0+bvHr1YwKV88jNCHLFI/XgPeqfj9/u1VIUe+C1DXs2pwYvsmD4Y1HGYFA0ecnM+De09MQM4wWUM7tvHJWGvse2/EXfO4FnUejNATAQ+k8/FNDcNdOQY/Wj7YGVUjQMnJdrJF97CbRY/v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UU78NhaoGgsN85debB+CP4BKXPi4jmA== 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: v1: https://lore.kernel.org/linux-mm/20230220132218.546369-1-42.hyeyoo@gmail.com v1 -> v2: - rebased to the latest mm-unstable, resulting in some patches dropped - adjusted comments from Mike Rapoport, defining helpers when converting its users The purpose of this series is to define own memory descriptor for zsmalloc, instead of re-using various fields of struct page. This is a part of the effort to reduce the size of struct page to unsigned long and enable dynamic allocation of memory descriptors. While [1] outlines this ultimate objective, the current use of struct page is highly dependent on its definition, making it challenging to separately allocate memory descriptors. Therefore, this series introduces new descriptor for zsmalloc, called zsdesc. It overlays struct page for now, but will eventually be allocated independently in the future. And apart from dynamic allocation of descriptors, this is a nice cleanup. This work is also available at: https://gitlab.com/hyeyoo/linux/-/tree/separate_zsdesc_rfc-v2 [1] State Of The Page, August 2022 https://lore.kernel.org/lkml/YvV1KTyzZ+Jrtj9x@casper.infradead.org Hyeonggon Yoo (21): mm/zsmalloc: create new struct zsdesc mm/zsmalloc: add utility functions for zsdesc mm/zsmalloc: replace first_page to first_zsdesc in struct zspage mm/zsmalloc: add alternatives of frequently used helper functions mm/zsmalloc: convert {try,}lock_zspage() to use zsdesc mm/zsmalloc: convert __zs_{map,unmap}_object() to use zsdesc mm/zsmalloc: convert obj_to_location() and its users to use zsdesc mm/zsmalloc: convert obj_malloc() to use zsdesc mm/zsmalloc: convert create_page_chain() and its user to use zsdesc mm/zsmalloc: convert obj_allocated() and related helpers to use zsdesc mm/zsmalloc: convert init_zspage() to use zsdesc mm/zsmalloc: convert obj_to_page() and zs_free() to use zsdesc mm/zsmalloc: convert reset_page() to reset_zsdesc() mm/zsmalloc: convert zs_page_{isolate,migrate,putback} to use zsdesc mm/zsmalloc: convert __free_zspage() to use zsdesc mm/zsmalloc: convert location_to_obj() to use zsdesc mm/zsmalloc: convert migrate_zspage() to use zsdesc mm/zsmalloc: convert get_zspage() to take zsdesc mm/zsmalloc: convert SetZsPageMovable() to use zsdesc mm/zsmalloc: remove now unused helper functions mm/zsmalloc: convert {get,set}_first_obj_offset() to use zsdesc mm/zsmalloc.c | 574 +++++++++++++++++++++++++++++++------------------- 1 file changed, 360 insertions(+), 214 deletions(-)