From mboxrd@z Thu Jan 1 00:00:00 1970 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 70497C3064D for ; Fri, 28 Jun 2024 07:26:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CAC556B009A; Fri, 28 Jun 2024 03:26:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C34FD6B009C; Fri, 28 Jun 2024 03:26:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AAE3D6B009D; Fri, 28 Jun 2024 03:26:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 866846B009A for ; Fri, 28 Jun 2024 03:26:35 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 4C30EA2295 for ; Fri, 28 Jun 2024 07:26:35 +0000 (UTC) X-FDA: 82279464750.29.A50132D Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by imf28.hostedemail.com (Postfix) with ESMTP id 6008FC0016 for ; Fri, 28 Jun 2024 07:26:33 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Vpgd4V8F; spf=pass (imf28.hostedemail.com: domain of seakeel@gmail.com designates 209.85.210.173 as permitted sender) smtp.mailfrom=seakeel@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719559585; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=L4fsXPA8V8mapSVEUxysocSmDOq0wah1u6Wk1zqZsUM=; b=P4/NitG/wTt2FSigl/sp5CRD9YlaLcEFN+Y2kOa4f9md1eJGll07kMVqvWFVYfLyoefkpa kNoCvYgGFRnsMWQH7uS19Mo6dfawORp2oQKosuXKhljKRzpBZOjf5dDQdXT+QDSL4jqjJW LcNpzMUbJ+sh2Q7qnATR9BgIU0P0up4= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Vpgd4V8F; spf=pass (imf28.hostedemail.com: domain of seakeel@gmail.com designates 209.85.210.173 as permitted sender) smtp.mailfrom=seakeel@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719559585; a=rsa-sha256; cv=none; b=MLmbR/yANc3mTYD0kYqpn/+t5DOIXheoZV3a1hz4odxDYtwsIGZ0bc1WvIRWakt7oic2fy A3LR8eeHobwJkRCTs400gDOEeZghOhG/63F8xFMaq4iAC5qT3uPfucNWhw+IoDku3xFpWN GTg5bTJZ+eYAhy/JgrHIGiFRJZIipiU= Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-70685ab8fb1so222848b3a.2 for ; Fri, 28 Jun 2024 00:26:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719559592; x=1720164392; darn=kvack.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=L4fsXPA8V8mapSVEUxysocSmDOq0wah1u6Wk1zqZsUM=; b=Vpgd4V8FiJe4s5B0GIaHQegYMucGuFvKvaSw4usoeczkodO9/bf6se63otTb+hgsNp /KN5xiMc2kZvrxIyI/t/NdI0KKThR1uln6dCpSzAVjsrzQeorAoA+/D0forM65VBAdCs xwM/tuHz+y8INyMkYPVWvky3nb9dDw1r/1qWTVbSdzj3vO60dKCKA+MVOFWu7ut99pWX XJOriuGGJ2Cs2MmrFRX275m9rjSJtNCPeaJZRHeg4CmfYxsAlegzVtsPeenz6knPxAVc AGXRwbUrgiJSTVIMd/BCZVcEevNGDSimXlojd3xxCctonqPfPQKhn1AcBkG8/AzItEYi uO1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719559592; x=1720164392; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=L4fsXPA8V8mapSVEUxysocSmDOq0wah1u6Wk1zqZsUM=; b=wrDgM24GiRrobIZ7SsB9WN7TTQUdbKbVNAAPXP9G2mJWpc6XCF2FXePKfQbcngmvD4 xzAQWHfUmKyYV1yrLU6bON552hWZvhDXl1qeQ7cpcoVfOJUFIORapxfL6hp/1az/jWWZ YC5P1VIc3rOjSRFdGJwFEed9Kqk+//LMxStJowSqUorILymz9Y1PvCnmiQkMGXy+ypQM KxRjkFxvgGBsKFNkyEfL9hmrL3juxGtNEZNs/cbBcN7D1BiPyVRsvMmEEgyAkJ1nsDmu PnuG/t1FAUvJQMb1p+HzhzeF/TjGHeeChACtvMYfEdNrvhLElxtoxHvKTNlqF/gg1Q/0 DnIw== X-Forwarded-Encrypted: i=1; AJvYcCVdtQSBnPycDgpEZQp+612isJQ/+vPRPTebvn0EGKKGR+lx94RaNddi2Q7y4ppXnZTSJu8xwCY2y0rf6G52dLaExBE= X-Gm-Message-State: AOJu0YwIIQOTst4q8VWxUrWLE8KtamjoViQXD5Z3XT0IOlYFQQwYiPnw DhmmsOKD0iUlE+xXNPPuf/RyZ6GE63PqqkJi1bQboiw6Db20ZaYK X-Google-Smtp-Source: AGHT+IEjPesnUlLmfZnPjNF3zT/ywZ0po4AnFcw+LL+6foBH+MxpH9kowpSiLIZfkGOgc0xZnMJ33w== X-Received: by 2002:a05:6a00:38c4:b0:706:6824:9c53 with SMTP id d2e1a72fcca58-706745b43c8mr15687883b3a.10.1719559592014; Fri, 28 Jun 2024 00:26:32 -0700 (PDT) Received: from [192.168.255.10] ([43.132.141.24]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-708045ac8b2sm890075b3a.183.2024.06.28.00.26.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Jun 2024 00:26:31 -0700 (PDT) Message-ID: <22ffc2f5-4bca-4665-91f3-82840f23f33a@gmail.com> Date: Fri, 28 Jun 2024 15:26:27 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 00/20] mm/zsmalloc: add zpdesc memory descriptor for zswap.zpool To: alexs@kernel.org, Vitaly Wool , Miaohe Lin , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, minchan@kernel.org, willy@infradead.org, senozhatsky@chromium.org, david@redhat.com, 42.hyeyoo@gmail.com References: <20240628031138.429622-1-alexs@kernel.org> Content-Language: en-US From: Alex Shi In-Reply-To: <20240628031138.429622-1-alexs@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 6008FC0016 X-Stat-Signature: 38rcjq74qts4t9g39i3afes8d3oo3qzq X-HE-Tag: 1719559593-302244 X-HE-Meta: U2FsdGVkX19veiIVlBYRuSpCZbWlPrP3bC8Nj0XoX7S6WzloXkAaqHkwGh5Sx5CWDbGiCAe4mmcuFBsPJZhnuwgmkMtG1VkwOJgObdeSRcxpZIE6bDALJTFfpAcN5LJ0V8f2u9VePsUwtv26oIGKS+5tunK68/8IkoUJXRqtIHC+CMyHRJpVGVj9P9ZSlFmuceBAGCF5FxEKXWYmtcGH1GfoMoMyP0/RWouSUdeJo7/qgNyvPdpBYBh0juoyEbMrepo9oSu3mCy0RJ3E4Xkr5g9tT/2w/6YuweE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U0w+Mp2gSjbRMU3536Xj96W3U0QPVKOHH3bCf+darcH40ibaDI0WH85w+gBAyKEML9oPwHjlOCEQ/xX+A3L5q5COuyWcCeb9X6BHzMAvX50BX660/B8vEI84a5cFkDreXosRNVUCQ8AqR7+gJo6WX84xe+56KatmnUnjoepmNDk6vJcK+fqK/czcYmDr4A== 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: On 6/28/24 11:11 AM, alexs@kernel.org wrote: > From: Alex Shi > > According to Metthew's plan, the page descriptor will be replace by a 8 > bytes mem_desc on destination purpose. > https://lore.kernel.org/lkml/YvV1KTyzZ+Jrtj9x@casper.infradead.org/ > > Here is a implement on zsmalloc to replace page descriptor by 'zpdesc', > which is still overlay on struct page now. but it's a step move forward > above destination. > > To name the struct zpdesc instead of zsdesc, since there are still 3 > zpools under zswap: zbud, z3fold, zsmalloc for now(z3fold maybe removed > soon), and we could easyly extend it to other zswap.zpool in needs. > > For all zswap.zpools, they are all using single page since often used > under memory pressure. So the conversion via folio series helper is > better than page's for compound_head check saving. > > For now, all zpools are using some page struct members, like page.flags > for PG_private/PG_locked. and list_head lru, page.mapping for page migration. > > This patachset could save 123Kbyetes zsmalloc.o size. This patchset is based on next/mm-unstable. Thanks Alex > > Thanks > Alex > > Alex Shi (8): > mm/zsmalloc: add zpdesc memory descriptor for zswap.zpool > mm/zsmalloc: use zpdesc in trylock_zspage/lock_zspage > mm/zsmalloc: convert create_page_chain() and its users to use zpdesc > mm/zsmalloc: rename reset_page to reset_zpdesc and use zpdesc in it > mm/zsmalloc: convert SetZsPageMovable and remove unused funcs > mm/zsmalloc: introduce __zpdesc_clear_movable > mm/zsmalloc: introduce __zpdesc_clear_zsmalloc > mm/zsmalloc: introduce __zpdesc_set_zsmalloc() > > Hyeonggon Yoo (12): > mm/zsmalloc: convert __zs_map_object/__zs_unmap_object to use zpdesc > mm/zsmalloc: add and use pfn/zpdesc seeking funcs > mm/zsmalloc: convert obj_malloc() to use zpdesc > mm/zsmalloc: convert obj_allocated() and related helpers to use zpdesc > mm/zsmalloc: convert init_zspage() to use zpdesc > mm/zsmalloc: convert obj_to_page() and zs_free() to use zpdesc > mm/zsmalloc: add zpdesc_is_isolated/zpdesc_zone helper for > zs_page_migrate > mm/zsmalloc: convert __free_zspage() to use zdsesc > mm/zsmalloc: convert location_to_obj() to take zpdesc > mm/zsmalloc: convert migrate_zspage() to use zpdesc > mm/zsmalloc: convert get_zspage() to take zpdesc > mm/zsmalloc: convert get/set_first_obj_offset() to take zpdesc > > mm/zpdesc.h | 134 +++++++++++++++ > mm/zsmalloc.c | 454 +++++++++++++++++++++++++++----------------------- > 2 files changed, 384 insertions(+), 204 deletions(-) > create mode 100644 mm/zpdesc.h >