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 B4C73C2BBCA for ; Fri, 28 Jun 2024 07:30:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2ED866B008A; Fri, 28 Jun 2024 03:30:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 29C0D6B0099; Fri, 28 Jun 2024 03:30:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13CC96B009D; Fri, 28 Jun 2024 03:30:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id E98306B008A for ; Fri, 28 Jun 2024 03:30:53 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 7057641669 for ; Fri, 28 Jun 2024 07:30:53 +0000 (UTC) X-FDA: 82279475586.09.32298FD Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) by imf23.hostedemail.com (Postfix) with ESMTP id 8A31F140011 for ; Fri, 28 Jun 2024 07:30:51 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=MIY+Fe0k; spf=pass (imf23.hostedemail.com: domain of seakeel@gmail.com designates 209.85.166.172 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=1719559842; a=rsa-sha256; cv=none; b=KAmKwNQzh1YktgVL621vSitkA3AWzxwp0mxHx2bb3ny6FqmIJVLm2nojCwBMzkDnVf7cxm b/TPnJvldv1SlsYbN8fJPdwFaUuFkUs/GnXEHSxaqCMbiJPRgXdF3xwNCE8uwEMToXDurf wgJ3T5fAvtEBYqYp9Bt/wSlkvChIy1w= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=MIY+Fe0k; spf=pass (imf23.hostedemail.com: domain of seakeel@gmail.com designates 209.85.166.172 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=1719559842; 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=S3COrcGNqmtomZujIy8pN6XlwTlaJPfly7FSE+QE3l0=; b=G2w3Bhf5ISlDwFbqzQ9gYEUNymLP2RhO6Vz7rxZW7usiy/Mm89pNJurhoQ9XV/ZBdw/mYi A2LnP6EB2q+9jm9n4FEY3SKRWWfV2u9tHOqnabJvVqzXhOVnWN3X34Vm2tuHNXmd3HhVJO nQlV6l3GoVujJcRU09LeFBYN0Cmi6Qg= Received: by mail-il1-f172.google.com with SMTP id e9e14a558f8ab-375df5af253so1489555ab.0 for ; Fri, 28 Jun 2024 00:30:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719559850; x=1720164650; darn=kvack.org; h=content-transfer-encoding:in-reply-to:content-language:references :to:from:subject:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=S3COrcGNqmtomZujIy8pN6XlwTlaJPfly7FSE+QE3l0=; b=MIY+Fe0kWEBoBDzinhfsh3u2psz55bZ7I7Psn3uN1QZS0b9yJKAIcabj3bXJUbnN6z 4nPvDLsxuQnDTbZTDGQ7j1YwbMMCoBU98b4rFR+6uiH6L+caV7KEKsV93tEA7sW0NDV9 DCMF3yWAbA6hXX34URUJbr+GeA2+oINASeqbG4p9KqhGWFe/wAemr8Q0QVevFuBFDK7Z TC+yybEYiq2LbQpjbPHdt+m5r6kKlakbzaPLxQA+0rVe2oQpqVjP76saJp9/eSNnn3+h 7ynZRZgD5xN+C2MD0wstsyOuaIEi6/ott8eqvz6uNdnm+hiG410wAwkuXibK4/Mc6jr1 iO6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719559850; x=1720164650; h=content-transfer-encoding:in-reply-to:content-language:references :to:from:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=S3COrcGNqmtomZujIy8pN6XlwTlaJPfly7FSE+QE3l0=; b=CLPmIlFjHu9olq9i+6YkcFhsiu/HXVe9Oox4gwjfyVsmXHSZ6yH8Jnz3WJ7ahIrKWz oTfxDV0eDICwVDoFj1CmZhxltCLRJ5fajsihD/L0ieB3EMOyHv7Gk9okd51usiHJTTml faHb5YCl6IAPSbvuE3T0WemP4VITrxSDGyqyO9dbv6Y4MNT9FzrXYt10DuUAelrpXTmh aJssF18bin9zGkQZlpee9noikQUVL2GOh11sqPgezITcrwwEtmcD5nuTBOHjtIrzuC5X WtZ3b8IQRRXe0E6AtUnDJif28bUrbcQRkZRfVBuQdCMhUiCr4vji57KrJXr5ko8audZk UTeQ== X-Forwarded-Encrypted: i=1; AJvYcCX+mcuhbWB+pQXYACCz+muvRXt0MSAkT3OQQlsXu+HfqqvNLLxXGjB6SQffqtMLXj0JLmZN9frF6Queb9b+NPdVXXI= X-Gm-Message-State: AOJu0YyX71cE2q6Orivw3bTfUn4tdB3d5uuN/rvBcAUeQdq72Rpndc4Q snxaRUpwJIGwJf4K6/BivgCtjV+cKirAUzioyrdDvk91lwReAohx X-Google-Smtp-Source: AGHT+IFvsNsB6NjUBCNs48zRCs5Ttt1AjpV03AkL5i2sMll1CEfreqAsT4UabD2ybDt/RzGa420xoA== X-Received: by 2002:a05:6e02:13a4:b0:375:a535:f7c7 with SMTP id e9e14a558f8ab-3763f49c4c4mr240251805ab.0.1719559850479; Fri, 28 Jun 2024 00:30:50 -0700 (PDT) Received: from [192.168.255.10] ([43.132.141.24]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-72c6c7f76fbsm772447a12.73.2024.06.28.00.30.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Jun 2024 00:30:50 -0700 (PDT) Message-ID: <8d128229-4b4d-44f8-b075-8cb1834636e0@gmail.com> Date: Fri, 28 Jun 2024 15:30:45 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 00/20] mm/zsmalloc: add zpdesc memory descriptor for zswap.zpool From: Alex Shi 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> <22ffc2f5-4bca-4665-91f3-82840f23f33a@gmail.com> Content-Language: en-US In-Reply-To: <22ffc2f5-4bca-4665-91f3-82840f23f33a@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Stat-Signature: idzr7jwmmzpgdfud3wep8yzguud3mp4z X-Rspamd-Queue-Id: 8A31F140011 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1719559851-364567 X-HE-Meta: U2FsdGVkX190AaL0WTdgnHDxDGQN5I4aZ7AAf7iuuwsnldZG0F5rt1ry8fwvZBwADaKl/Xo9h3EDRd0D3avHpaZMnVTcRHc6p/IFT4TG2LbqYnaAeDWZM8UzhMgJjM9+KxyEO3PkBdXJfVV/5C1k2mBz7ryQda3b3TUbtuiCN8P9QuO8ZK3bODDJutusuHMc82xbNE/zaKER1Wp5OwJ2+YKE4vhl824mO5FGNkvefZggvB/Jj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PK1dgumPUvwYMJXX1Pd6PaZh/rbe06HIz8+4rm6Nd0H1mVN31BWuPVZaqSX3RxR5HB22dzVYB/APHYLHk+Upn6XrMqw+W7oMkuHkH1RslG7vQUDsLp+Dinfah/8Cby6FoW25XkvPR7kx7T3XHb1rPTutGzJSAal8qxuK4Azg24fxbxU6v5WidrrRcdzTAoQ4FOuH7u9tqG5jUDJ0smgqb6QDh9Ee1JJOIOamsThlSSnqa7Z4l9iZ3eXB65DJBNZ4A4u 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 3:26 PM, Alex Shi wrote: > > 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. Sorry, just double checked, this patchset based on git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm mm-unstable branch. "4b17ce353e02 mm: optimization on page allocation when CMA enabled" 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 >>