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 C7B45C3ABB2 for ; Fri, 30 May 2025 06:47:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D66FD6B0082; Fri, 30 May 2025 02:47:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D16F86B0083; Fri, 30 May 2025 02:47:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C2F796B0085; Fri, 30 May 2025 02:47:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A1CFC6B0082 for ; Fri, 30 May 2025 02:47:37 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 6D5A0C2455 for ; Fri, 30 May 2025 06:47:36 +0000 (UTC) X-FDA: 83498643312.16.0BB8C24 Received: from lgeamrelo03.lge.com (lgeamrelo03.lge.com [156.147.51.102]) by imf23.hostedemail.com (Postfix) with ESMTP id C365A140007 for ; Fri, 30 May 2025 06:47:33 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=lge.com; spf=pass (imf23.hostedemail.com: domain of youngjun.park@lge.com designates 156.147.51.102 as permitted sender) smtp.mailfrom=youngjun.park@lge.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1748587654; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OmbXH2vN7fx86Roa4L6QDMJrDUXGu+MTgU1/7VT/CIE=; b=b0UYPsq/v0eqyYUs/q5iLCsmA2250jVuUZDU/LqGzMEFtiZn1/d622pY4fr/3zIP+y3eb/ RFb0bVi0gZKAnYcmHHKI4b+o74eq24Nv6pbt94AqIR/9tXdH//78fHjg2WGeaP/na77/1V Zk4OSXLbluhla351PsALNhFqY1wsRJA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1748587655; a=rsa-sha256; cv=none; b=E4zdIy1LPSJXep6z/moScD5jlcpxMW5InDyVbgoN4cM5CZxpq6vGEQ2J3v+ZTssEKBRN3m GABjWCPoOvE04ljZuDi0VEIaMP2N0zRGD3tBw+MuZ1PA3giZXPMc72vpeqKpx4xGdAS+kJ 1fzEeVhoWQEP7XGwxUdR42G6pwlL2Nc= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=lge.com; spf=pass (imf23.hostedemail.com: domain of youngjun.park@lge.com designates 156.147.51.102 as permitted sender) smtp.mailfrom=youngjun.park@lge.com Received: from unknown (HELO yjaykim-PowerEdge-T330) (10.177.112.156) by 156.147.51.102 with ESMTP; 30 May 2025 15:47:30 +0900 X-Original-SENDERIP: 10.177.112.156 X-Original-MAILFROM: youngjun.park@lge.com Date: Fri, 30 May 2025 15:47:29 +0900 From: YoungJun Park To: Nhat Pham Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hannes@cmpxchg.org, hughd@google.com, yosry.ahmed@linux.dev, mhocko@kernel.org, roman.gushchin@linux.dev, shakeel.butt@linux.dev, muchun.song@linux.dev, len.brown@intel.com, chengming.zhou@linux.dev, kasong@tencent.com, chrisl@kernel.org, huang.ying.caritas@gmail.com, ryan.roberts@arm.com, viro@zeniv.linux.org.uk, baohua@kernel.org, osalvador@suse.de, lorenzo.stoakes@oracle.com, christophe.leroy@csgroup.eu, pavel@kernel.org, kernel-team@meta.com, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-pm@vger.kernel.org, peterx@redhat.com, gunho.lee@lge.com, taejoon.song@lge.com, iamjoonsoo.kim@lge.com Subject: Re: [RFC PATCH v2 00/18] Virtual Swap Space Message-ID: References: <20250429233848.3093350-1-nphamcs@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20250429233848.3093350-1-nphamcs@gmail.com> X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: C365A140007 X-Stat-Signature: r6c6aierdpoq9dsc67z7qp5ym5yuad14 X-Rspam-User: X-HE-Tag: 1748587653-816298 X-HE-Meta: U2FsdGVkX1/xhyH6RUWwoGU86uljsRlunb9BZRaOEeOapLPK43Ulr3Gk50aSDP8PjACawVk/5Q85pSFNoyxi7v9RMRXRWBYWjCr8OL1NeFb0SyigMOQGbAnpJ76NSxhkvTc8SpygND/zVFp2OMyHpkTmUH4Xzk7qbgDxkMvS4YsfJj3FYpNenSu1InO1sfjA3CLKiMHNJ9rL0cMWb+PhlgRHFKjCsj0Hg0wVH2IL97fn42NOgghFx5yKAAB/T8+CjST8HunO/RHne8vdp+ooz/i5wU8jcwZjRpIl/JwZodVYhA3UPeywXGehOuOPYyKV1A2Q1LCYxGO/I7QPyOCNy1+rpXsBzC5dkLrx52yZAr01eS8jpoa14WOovKrxB0jfLtTGEq0+reaCsvkTRXa+cq3SVGzLq/cKmGP7wMk/KUmA+tHUMhBua124ONYOsG3KZkoDrlmuovAGn3xPcz/bcQzVRpqLQSjebROw1edt3UaZMRfIBPAlQsITlgYVQSpHiyb2vWTQJySysGjL/KV/V4bEVjxBUzI879sDbeMYMPhrl1lS5yYA0W+S+EsnbfbRDZ/BGQPwlXTrjZYWNTJ6ukXlJwfo0OfZ8w810JlRmkHbOW1mfz7LuM11yeLdFkJ3MkDArLjLcj00BtThsKqTh7TxM99RalhOWW64miLRwR+XWiYqbDRhztBD9Eej65JElfO1nu6zgB7390jluNuaOeq5ky6jPV4ueCzr2tYQW5FIqvgJAt0tkWzhQ/9w6QmKjQxG0hVkcolHNP4gVzIYTiDSXlIKx6dcw8bv0uUtVcG/sC9wRzoZZOxJ5nFUrd/sMGHcZ0b5my8xD37S4Okrw09/217WgU8mm6aBHHziUTw2qUhJI6Lzarsj1LS9auanuG/z6UMD8iEl4WK2TLmmZgIVGogt0WRSMGE2VuSxuUnzAGRtEYlujJCQiFC81tAq 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 Tue, Apr 29, 2025 at 04:38:28PM -0700, Nhat Pham wrote: > Changelog: > * v2: > * Use a single atomic type (swap_refs) for reference counting > purpose. This brings the size of the swap descriptor from 64 KB > down to 48 KB (25% reduction). Suggested by Yosry Ahmed. > * Zeromap bitmap is removed in the virtual swap implementation. > This saves one bit per phyiscal swapfile slot. > * Rearrange the patches and the code change to make things more > reviewable. Suggested by Johannes Weiner. > * Update the cover letter a bit. Hi Nhat, Thank you for sharing this patch series. I’ve read through it with great interest. I’m part of a kernel team working on features related to multi-tier swapping, and this patch set appears quite relevant to our ongoing discussions and early-stage implementation. I had a couple of questions regarding the future direction. > * Multi-tier swapping (as mentioned in [5]), with transparent > transferring (promotion/demotion) of pages across tiers (see [8] and > [9]). Similar to swapoff, with the old design we would need to > perform the expensive page table walk. Based on the discussion in [5], it seems there was some exploration around enabling per-cgroup selection of multiple tiers. Do you envision the current design evolving in a similar direction to those past discussions, or is there a different direction you're aiming for? > This idea is very similar to Kairui's work to optimize the (physical) > swap allocator. He is currently also working on a swap redesign (see > [11]) - perhaps we can combine the two efforts to take advantage of > the swap allocator's efficiency for virtual swap. I noticed that your patch appears to be aligned with the work from Kairui. It seems like the overall architecture may be headed toward introducing a virtual swap device layer. I'm curious if there’s already been any concrete discussion around this abstraction, especially regarding how it might be layered over multiple physical swap devices? >From a naive perspective, I imagine that while today’s swap devices are in a 1:1 mapping with physical devices, this virtual layer could introduce a 1:N relationship — one virtual swap device mapped to multiple physical ones. Would this virtual device behave as a new swappable block device exposed via `swapon`, or is the plan to abstract it differently? Thanks again for your work, and I would greatly appreciate any insights you could share. Best regards, YoungJun Park