Message ID | 20240729112534.3416707-1-alexs@kernel.org (mailing list archive) |
---|---|
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 4DDA6C3DA61 for <linux-mm@archiver.kernel.org>; Mon, 29 Jul 2024 11:20:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C73086B0089; Mon, 29 Jul 2024 07:20:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C244E6B008A; Mon, 29 Jul 2024 07:20:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AEAE96B008C; Mon, 29 Jul 2024 07:20:21 -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 9055D6B0089 for <linux-mm@kvack.org>; Mon, 29 Jul 2024 07:20:21 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 0376DA3937 for <linux-mm@kvack.org>; Mon, 29 Jul 2024 11:20:20 +0000 (UTC) X-FDA: 82392546642.26.BF77EDE Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf13.hostedemail.com (Postfix) with ESMTP id 530B52002F for <linux-mm@kvack.org>; Mon, 29 Jul 2024 11:20:19 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=F8CRFlJn; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf13.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722251959; 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=wTsXyAnQyNXD3MThO9mx4Z9QqQspVR+1/h22PrSWmxU=; b=FblecT0GRqmr3UsrTbRHDuPyJqmOPZvQo8CQyk2FwTlqoUUyUBGWT23jFaNQga7BfXJA/4 zq8tnvf6I4fKIVGavMaFBDKYu/4cemr/oYUnJqVJXoSCgcmrjmOxX8Xtt3PQQ05oaRZgLA 0LzwvtUum9lAYiLzSXMS8U6wnr7943M= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722251959; a=rsa-sha256; cv=none; b=WSm/lSYVeakiNiwlFJPUPRQJZRANNij5dAidK9jWIaUPZkd5MfmtLroHkfy2HRFsKytBZx +/IT0pZfftld0D9sCaDVf1b+zQSkI6sORyeOnIm0pdnaXet/Hlz5qIRk8wvn5I2UHNOL5F uHyp29d+CRuu6z4LzpButMsKuDL5Ra0= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=F8CRFlJn; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf13.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 24AAC61714; Mon, 29 Jul 2024 11:20:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9E11C4AF07; Mon, 29 Jul 2024 11:20:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722252017; bh=GCdDKMyQhi6Fdywd48MEubdovoeD83E2ZbnWZmQMiLQ=; h=From:To:Cc:Subject:Date:From; b=F8CRFlJn8PYsipRmq17JRRtuDEIxI6V+iRjzWcYrPNZEBjneRZKQ+/PDmaM7JviHS ej5fGL5ljaxMWPEKXi3mkKg2+RUcfm1WYL/lJAaX0mSxfb2+Jd+sH5bkaN4PJLuphH k/x8rB3xXdWd+BK3tHujQRxCUX0RlcXZoUSXsI1K6YLdtweVY4n1VgQ6uorbYclgmY WxIUljwyASnrlypR4u/DF6BluEFl9HpoQuccvRBd+maU8vw6tOP3rxJSQXmFFxGOki dq7p0vOGMD0aakXjhMUMxQtrvZfHjHxyUEaw4zgE+q9Jt3/zbCUUxQT6+ssrUVMeey e5aA2K4WsU2Ng== From: alexs@kernel.org To: Vitaly Wool <vitaly.wool@konsulko.com>, Miaohe Lin <linmiaohe@huawei.com>, Andrew Morton <akpm@linux-foundation.org>, 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, Yosry Ahmed <yosryahmed@google.com>, nphamcs@gmail.com Cc: Alex Shi <alexs@kernel.org> Subject: [PATCH v4 00/22] mm/zsmalloc: add zpdesc memory descriptor for zswap.zpool Date: Mon, 29 Jul 2024 19:25:12 +0800 Message-ID: <20240729112534.3416707-1-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 530B52002F X-Stat-Signature: zxpfnmsmfd9biib5c3spfggwfh6ja7oj X-Rspam-User: X-HE-Tag: 1722252019-834662 X-HE-Meta: U2FsdGVkX18ybWEwYUEQYlk74OaoySZTTRcY2NMT2eM0PEUTUfzZubJQh13xzUBYQz6akcZPmqjoI9AObGZbUgjKG/VHLlQpmkSsPLUeHty1BEq+gup//8JBxYs9/Fo1OiEZj8uHQSu9U/YnPX9RiQrKflj7EFol7uOqY0J88AszMASOSeofdp2Vl55+mKWh9NEYdGo6tvO20dVSuH9G1lG9Vr6SveHTvYXrCEWowo2xxIAJap7VPrhHhoYTaKHHRo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MbWil4gDXFDIAKhDYfrlI1AQFJOA== 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm/zsmalloc: add zpdesc memory descriptor for zswap.zpool
|
expand
|
From: Alex Shi <alexs@kernel.org> 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 does not increase the descriptor size nor introduce any functional changes, and could save about 122Kbytes zsmalloc.o size. Thanks Alex --- v3->v4: - rebase on akpm/mm-unstable Jul 21 - fixed a build warning reported by LKP - Add a comment update for struct page to zpdesc change v2->v3: - Fix LKP reported build issue - Update the Usage of struct zpdesc fields. - Rebase onto latest mm-unstable commit 2073cda629a4 v1->v2: - Take Yosry and Yoo's suggestion to add more members in zpdesc, - Rebase on latest mm-unstable commit 31334cf98dbd --- Alex Shi (11): 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: convert get/set_first_obj_offset() to take zpdesc mm/zsmalloc: introduce __zpdesc_clear_movable mm/zsmalloc: introduce __zpdesc_clear_zsmalloc mm/zsmalloc: introduce __zpdesc_set_zsmalloc() mm/zsmalloc: fix build warning from lkp testing mm/zsmalloc: update comments for page->zpdesc changes Hyeonggon Yoo (11): 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/zpdesc.h | 146 ++++++++++++++++ mm/zsmalloc.c | 466 +++++++++++++++++++++++++++----------------------- 2 files changed, 401 insertions(+), 211 deletions(-) create mode 100644 mm/zpdesc.h