From patchwork Mon Feb 20 13:21:53 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: 13146428 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 B196CC05027 for ; Mon, 20 Feb 2023 13:22:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4F1376B0073; Mon, 20 Feb 2023 08:22:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4A2DE6B0074; Mon, 20 Feb 2023 08:22:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 368BA6B0075; Mon, 20 Feb 2023 08:22:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 26FB36B0073 for ; Mon, 20 Feb 2023 08:22:37 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id DC9501601F7 for ; Mon, 20 Feb 2023 13:22:36 +0000 (UTC) X-FDA: 80487734712.08.AED1DEF Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by imf15.hostedemail.com (Postfix) with ESMTP id DF348A0002 for ; Mon, 20 Feb 2023 13:22:34 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Z7NazipP; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf15.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.214.170 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=1676899354; 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=jJnK5heXZmKJsaWj1bbQGUU5r/wNAPvqSc62FbFMapc=; b=NdZviu30CNPSchl24Cs5TuZahOGHi0C0meWFXc5AlW53DeCpPSjAs5nOUSCDkWVv12NdKn XxYeVKoUE7hLT3L3oUlyDV79P9KPF2FZqIPX0WsLVvYvYqShv4RmsbFQP1HZnKLE+disuQ MSLMOabqeMMtTZWbLwtEaK6XG4PWTQc= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Z7NazipP; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf15.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.214.170 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676899354; a=rsa-sha256; cv=none; b=5NL1T+UxlmPYQg90lTkgB57gNb0p7OSW9UgqlYAy75viSXwCyCU1U1RuY0gE9bN6K7OuXS /HkTzDl7nq5uZoPCw4x/CFTUBRIg383otG/H7jB52bCjbvSMjdYEUemeWqwQUU3dvs5R3c ejl2BVXBRjqWXOlbzl1JPV/8ns5PPq4= Received: by mail-pl1-f170.google.com with SMTP id bh1so1338869plb.11 for ; Mon, 20 Feb 2023 05:22:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=jJnK5heXZmKJsaWj1bbQGUU5r/wNAPvqSc62FbFMapc=; b=Z7NazipP8PDFUAU3wK7Q0G0XPiXs/NK+VRkgWyEj058glqVplm8vS3dV4wcddMTQkq UllfXA5kKj7S0m577HMiEOQlBADTCiUx9qdqDwhVKznX6mMDfOUYv+nntdyNyvUPH49h l4PGwDSMNAMWzgiHGuQqK1do7qEbVC7Ww7dhxJZhOHDo/FaJQ6wF9jnoRcIVcYJj+vnL snjztJVwKGQWAHP8K1UNGV1x/VmF9gkI+p5UNMVbxYV0niDtsRLnWD3yYpOPgK9H+UdT 9YBXZFmbBMAuapKh/g48eslfoMnL3hwCnVpVHTIbspEdXdbWF9fIB6kJi/eGF7+pux8Q MViQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=jJnK5heXZmKJsaWj1bbQGUU5r/wNAPvqSc62FbFMapc=; b=GGKuLn3REND/Ov/LiJH5/Mbmp0GgFWw05BQ+bE1B1Dg6WZT5eygX9KbZz5mEMLk03S B7fRONlyt+H4ZSiOECcHamfZ7FVlDvMp7Ez7oPHRUKCtjhNYSp0pM579RVeqVEfVgT0H /AMVYC3TtUJAmI2lSPlLjov7ubopcOE05EiTlE+GjWHzkbKiRU/G5afENYDFyzQopS3a qrAavLxEvxRXix/18HaiGrD5+ybhlX/rPGY/aKuk+Z6A5G9QLStjCnuVXuCXQAJrZnf9 cYIwzXh+RFVLTRCAGdH4SgxmbB5QHebHw6HzWIN9p8Ho5hFeXdfA6g1H72HKfplTlPNJ sRGg== X-Gm-Message-State: AO0yUKVfzyyEGdmHtPym6gBDx1pxprE3bNoIu0Wt3ptdNalJeC0J9FPf U//FyK9EKmYYxBRuprtfBCbj0PK+UaACzg== X-Google-Smtp-Source: AK7set+JftNS1iBzpYbCvJxczPyPt0xCZpCGGfD8+IUL5RLjmDwPJv5pS2QE4uKaa2BxcnY1ZScEsA== X-Received: by 2002:a17:902:ecc4:b0:196:d05:bac7 with SMTP id a4-20020a170902ecc400b001960d05bac7mr872415plh.58.1676899353515; Mon, 20 Feb 2023 05:22:33 -0800 (PST) Received: from test-ha.kr-central-1.c.kakaoi.io ([210.109.63.229]) by smtp.gmail.com with ESMTPSA id x2-20020a170902fe8200b0019c13d032d8sm6125436plm.253.2023.02.20.05.22.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 05:22:32 -0800 (PST) From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Minchan Kim , Sergey Senozhatsky , Matthew Wilcox Cc: Andrew Morton , linux-mm@kvack.org, Hyeonggon Yoo <42.hyeyoo@gmail.com> Subject: [RFC PATCH 00/25] mm/zsmalloc: Split zsdesc from struct page Date: Mon, 20 Feb 2023 13:21:53 +0000 Message-Id: <20230220132218.546369-1-42.hyeyoo@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: DF348A0002 X-Stat-Signature: 84yhhah7atj8eu9kbp899o4udkiz3ihn X-HE-Tag: 1676899354-677754 X-HE-Meta: U2FsdGVkX199syg5H9xVGQ88NbhI+hij998iil5AuGE8Wn1T7Zxl3OXjzg1RJVAzPjef394W4lKY5Cme3eskWaMq+eQihIWQdNkSjcBzg1UhFQaTBdtRdhvQHbFoJjyjjy9LibRUzAfZyuECselPPQzyRe+AeOq6eDCGS7hGRcXQIkMYYDjKQfDI7Q1LuTAhOJ9Aty9cTXD7DszH6CDG99EKa1JTCY694CWAfObUoINu7GOf239K7awTf99ZwSaF3CZumQvhYeAOghAbNkYnyhM5DpjQcasL0PB1dzKspQnMi1BRrEmD49PXvEAMEW2+6ip6jU0Bu3JJtNCkeLFL/K1OfBtBSRPfme0QRBaXSR4CzYjKFcwExWFTMWnmKz/QNU6hBZbhIy19alWhiYC82Gtnwn1DdL7pkjZb5ip0I6tmWKGMpqJDcuSsZxuQFFMqzYNFfJ//Yw7ex3In48sjRz1CI99m0SHbYiuOQKKIuyk4zzUCVMcwlp+u2iBxNHzbpkDjFQlhHfT25myLT45C7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1Mi/nNmRYkiaqrW7LitY8fl6a4gmY= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000013, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: [Maybe not the best time to send patch series, but just wanted to get some early feedback from zsmalloc maintainers] 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 interdependent, 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. I have no strong opinion about its name. I was thinking about between zsmem and zsdesc, and wanted to be consistent with struct ptdesc. (which is AFAIK work in progress) This work is also available at: https://gitlab.com/hyeyoo/linux/-/tree/separate_zsdesc_rfc-v1 Any feedbacks would be appreciated! [1] State Of The Page, August 2022 https://lore.kernel.org/lkml/YvV1KTyzZ+Jrtj9x@casper.infradead.org Best regards, Hyeonggon Hyeonggon Yoo (25): 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 users to use zsdesc mm/zsmalloc: convert obj_tagged() 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 unlock_zspage() to use zsdesc mm/zsmalloc: convert location_to_obj() to use zsdesc mm/zsmalloc: convert free_handles() to use zsdesc mm/zsmalloc: convert zs_compact_control and its users to use zsdesc mm/zsmalloc: convert get_zspage() to take zsdesc mm/zsmalloc: convert SetZsPageMovable() to use zsdesc mm/zsmalloc: convert restore_freelist() to use zsdesc mm/zsmalloc: convert zs_reclaim_page() to use zsdesc mm/zsmalloc: remove now unused helper functions mm/zsmalloc: convert {get,set}_first_obj_offset() to use zsdesc mm/zsmalloc.c | 707 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 429 insertions(+), 278 deletions(-)