From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 969B4606A322 for ; Fri, 4 Dec 2026 19:44:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.a=rsa-sha256 header.s=google header.b=I+R6tJKf Received: by kanga.kvack.org (Postfix) id AEDC16B05B2; Fri, 4 Dec 2026 14:44:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A9EBE6B05B3; Fri, 4 Dec 2026 14:44:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 98DAB6B05B4; Fri, 4 Dec 2026 14:44:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 3CDA96B05B2 for ; Fri, 4 Dec 2026 14:44:23 -0500 (EST) Received: from smtpin18.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 4AE001A04D6 for ; Fri, 4 Dec 2026 19:44:21 +0000 (UTC) X-FDA: 85507327122.18.FC1AB5B Received: from mail-yw1-f170.google.com (mail-yw1-f170.google.com [209.85.128.170]) by imf06.hostedemail.com (Postfix) with ESMTP id 11B87180003 for ; Fri, 4 Dec 2026 19:44:18 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=cmpxchg.org header.s=google header.b=I+R6tJKf; spf=pass (imf06.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.128.170 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1796413459; b=IyacIyzVijUerF3UO++0HxgZfG/FgvpSJWJFUg+gcR1QwtaJp9Sdo2XF2U8wsWapI0VeZ+ 4dC0KdSaEhdFiOu2/N6Oqerg4iV8WR+zB8xkrxdkcDH8g5UX3ga7N2pIJIN3VOsTI4nzGQ SMVhwv/1pOdGXFHVQRXsUpq+WPkdErI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1796413459; 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:dkim-signature; bh=L0fNvtPEN5CTbmnrKUGEGY9uS7zufaxf96c+iJlh7KE=; b=5U6GaLST6cU63MaH6B/IZQdeyIgLegh6oXlyzhIEjw57FPhqSsvs69ZhHNGMbgi59QE3oq yvrC8+c9Yma+SmXby0FPOtotiTBAIXpg2Qq6tzkwwdpXEfiEld5LSq+gQtkx1eg9c69eOK ssVD8kuONmOni2OgfssQKRqpKizXr0g= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=cmpxchg.org header.s=google header.b=I+R6tJKf; spf=pass (imf06.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.128.170 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org Received: by mail-yw1-f170.google.com with SMTP id 00721157ae682-8b4f4095a7aso11875617b3.0 for ; Fri, 04 Dec 2026 11:44:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg.org; s=google; t=1796413458; x=1797018258; darn=kvack.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=L0fNvtPEN5CTbmnrKUGEGY9uS7zufaxf96c+iJlh7KE=; b=I+R6tJKf0aQzFvGipypglzCtq5Fs9f5sB+Qiw4fgjiplXOnUSPfusm0teuy9SognBw yAalmTokfYxcvaNq1qKSzLJ0x0IhsOFfulZgUQ7aZj9wlyd3zGjfZkaYZzYtIvwfTh47 9K4Lc6FZQ0Bd/4+xoKxvSIFp+ZHhYxsUk+6mh9oJWUS8D/fh6GBLGZQFZV+lmSlqhek4 E9VmPeTpFzF/psxI/th2K/enLVbtIILaFDY00sdptFFZtz1Rs9FuC9snr2ugq4qZIDLE i3zSTzQGVoRubRsLvbh6IUh3jo4hjz3tO2npLtPH2/O9e9z5927RtRl+dkE6DrGfSkZE 0+LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796413458; x=1797018258; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=L0fNvtPEN5CTbmnrKUGEGY9uS7zufaxf96c+iJlh7KE=; b=YamBWvQxRbL93CW96SvizHSM9Si7ObqaSbJ+c/WTkUfq11kTHm25cbhQKXrDn2PJql zECMaOJLAmewfXU2AOAkAiZQG+b70iYEUhjJsZf2Nm/x5M5jvprvDtxHft25GDX/pmaY IKlAHSMJS5x6vck9kZwvwFu3fC0fUX96HsQOvQaKOtXVGulAY323PrV328a6Ryz4g1zF Fw888YxmlZPJvuniZvUQDrBQ/imLA1hn8vzD9EjQp5Rv5Ss7yX/2ImDwB0SNBVIDrygh wveWFmIealKowpgt1Oz+30GanxKZId31YwakxiF9nBhlyGvLGM4SRgdUdjRdnDpOgB75 ufdw== X-Forwarded-Encrypted: i=1; AL+hErEt3uoAzBzu5jnZJcEc9TnoEdo9o7EFPNxCuhfz/JRH0f7wBdqznXRLZHegyGSY4Y5qtf9YbpDjeg==@kvack.org X-Gm-Message-State: AB4q+uHxcuyMORV3A6Lieq/2+hFNv8PwlRVCsHS2AoInDLJkl4UzCFJj QLt8wxKI0FSgLaQN35h5TpMZlhJcryyFvof7gghSBwIIue59RzM8/DiXht2KxrumptA= X-Gm-Gg: AZFdTZdc4S3AMLqeV1r2BRThHek9p6k40Gqzq6tJucz6+CVWcg5cVmCQu4qQwP4H6A+ 7YCLdGg81wz3UFSmFlwdHU6iILPBpUz0YPlpVDzB6UvPDuNIuYeVbYAJkgRfa5hTbTzrxLbGa9p hpipS5Lr0BavI5ez5/wmv9hnpR+D9t5ULa+8hal9T57z839etYPHbJrAetvjOGS+pm3jF62TM9i zrVj7Tw2kKseOJtL+sB1cDWw/2LgPYisckt/l42fKPMaCoPwS2rROaxr7bLtMo5LFLJ53ws25g0 vRe4DTgcXAqxAY4K5+woY9fhVPd6/tzg0kylN9MUm37AIO+bE7mOljbYv0mzfdZcdfk+41MUSF5 BFseXHYyjkh4oh/EMxx4UnAtXwspTsMVUHx25cZGoF0fMLLvOfIa3rdmjPThIPT/To4QW3bSsSt Q20luIiA5Hvk44ZLxNhk/QHfT/UF1tuOY6LvOFMB5lAxqbeN4G3mpBg/UPC/XJIfXPdoph5Wq8P L9dc916LcofQjMb+U+fowdUY2TeipbjajaNj4t9Rrwss3YjQSuxWqguqXunJ4JI1LQx+itnVamv LG/7jQY+FRQvnCW07fIIv8W5pfA= X-Received: by 2002:a05:690c:7344:b0:8b3:be52:9832 with SMTP id 00721157ae682-8b660df2a37mr17782487b3.43.1796413457979; Fri, 04 Dec 2026 11:44:17 -0800 (PST) Received: from localhost ([2605:8600:200:dc6:365a:60ff:fe62:ff29]) by smtp.gmail.com with ESMTPSA id 00721157ae682-8b660e10477sm13901007b3.43.2026.12.04.11.44.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 11:44:17 -0800 (PST) Date: Fri, 4 Dec 2026 14:44:13 -0500 From: Johannes Weiner To: Nhat Pham Cc: Chris Li , Kairui Song , "David Hildenbrand (Arm)" , Baoquan He , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Kemeng Shi , Barry Song , YoungJun Park , Chengming Zhou , "Lorenzo Stoakes (Oracle)" , "Liam R. Howlett" , "Vlastimil Babka (SUSE)" , Mike Rapoport , Suren =?utf-8?B?QmFnaGRhc2FyeWFu77+8?= , Qi Zheng , Axel Rasmussen , Yuanchu Xie , Gregory Price , Wenchao Hao , Jonathan Corbet , Hugh Dickins , Baolin Wang , Tejun Heo , Michal =?iso-8859-1?Q?Koutn=FD?= , Shuah Khan , Kunwu Chan , Meta kernel team , Linux Memory Management List , Linux Kernel Mailing List , "open list:CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG)" , Andrew Morton , Joshua Hahn , Rik van Riel , Wei Xu , Yosry Ahmed Subject: Re: Virtual Swap Sync Message-ID: References: X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspam-User: X-Rspamd-Queue-Id: 11B87180003 X-Rspamd-Server: rspam03 X-Stat-Signature: sx3h4nojxwuzznju73jb4rcsx4rjmkc4 X-Spam-Status: No, score=-6.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-HE-Tag: 1796413458-436496 X-HE-Meta: U2FsdGVkX19RMlURn7RU2cr2I9q4PiRRp+g8yueLM5ypSsNIEHSR0g1WUcvkHT1+QkbXPyFXmQyz7oURLb7GYemXnYh1PmdvvqKS9j5hRBHF2AJQhXJyi84oAm99cm/sowb654IIKVPGv9W+L3v6ZYLVZqN9s2rAq6bML20uQ0O1Ba4Mc4tYCV6BXcLQaZD/grlpDmF2ZL+C7Q+kacQSHQ8vFPhsUgPdJ30voY4ggnFZHc9vmxDiZPvUXvVkdd7OIuwi1y3ZsiyF4+pb0gd5wBBK4R1ouhPYacq41brsgI8I2XW+BWsoUQ07BHMAA6zapIdmaxoAeQm+93QSptRRryeyk3X8yEO/BCzHIJRmzhfukevLaPgQyM+12RU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3DPgQLPk8/LD+4L+lsbRm9hy942i9oz09vM+YniE3/+KVnewLGSWwREgY9SNUo0jxBpI6CA7DkZ1Jo4ipyCCsIIAagM+7ivduBTjWg264KfFlXNcY/Ti1bWxsSwsb8UsYVp5qH6RvfkdX2QVmrLwTVu4P0ur+RV+QSpXK9Z+rAgPG5WqF9ftHSrhyvVOU8OwXQNl4OkuQaqsgZZRu0kkG4nisdh+7ewQumq4sHJqKyIGMowV4bV0h6xj2L09eZLvwlwSAjxV5jyBCMcS1gJ/YHJsSirG6nCOtt9Z2I= Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Fri, Dec 04, 2026 at 11:30:46AM -0700, Nhat Pham wrote: > On Tue, Dec 1, 2026 at 10:27 PM Chris Li wrote: > > > > On Mon, Nov 30, 2026 at 4:26 AM Nhat Pham wrote: > > > Ah I see. It's logical footprint, but enforced on an allocation/used > > > basis rather than mapping (i.e address space reservation, which > > > existing vm.overcommit modes regulate). > > > > > > I think swap sizing is still the wrong interface for this. IMHO, it's > > > a crude emulation, with some downsides: > > > > > > Say the desired logical memory limit is 4GB. We have 2GB of physical > > > memory limit, so we emulate that by setting swap size to 2GB. Now say > > > I have a hot file cache of 1GB, and 3GB of cold anon. That should be > > > allowed, but you'd thrash prematurely or OOM because you can only > > > > I think you and Kairui have different requirement and assumption in mind. > > You seem to want the maximum compression. (Max memory savings). > > Kairui's usage case cares about the consistency serving quality by > > limiting the total amount of swap (a bounded performance penalty > > caused by swap). My read is that, page faults have a much higher > > access latency than RAM. He is trading less memory saving for more > > consistent run time behavior. The compression ratio is determined by > > the workload, which lacks consistency from a job scheduling > > perspective; he does not want a high compression ratio if it causes > > too many page faults in the worst-case scenario, which would impact > > serving performance. It is OK to OOM there, because if you have too > > much swap, your worst-case performance is trashed anyway. In this case > > the solution is to increase RAM not increase the swap limit. > > > > Both requirements can be valid use cases. > > Yes, my personal use case is closer to the second one (maximum > compression), but I'm actually describing both use cases here, and I > think static sizing interface seems wrong for both. > > For the first use case, gating phys mem and gating swap size > separately is not the same as gating "logical memory footprint". It's > essentially the equivalent of using memory.max and memory.swap.max to > simulate memsw. It's not quite accurate tbh. That's is my point. The > user is only still using 4GB, logically speaking (1GB file and 3GB of > anon). We're violating that guarantee, because we give the host 2GB of > memory and 2G of offload capability, which fails to serve 4GB because > we incorrectly predict the split. IIRC, Kairui mentioned in the first meeting that he tried emulating his usecase exactly this way in cgroup2 and it didn't work. Kairui, please correct me if I misremember. IMO, the best option is still a transparent virtualization layer at the bottom. And an optional control plane on top for those who care. One that actually fits the usecase, doesn't get in the way of those who do not want it, and composes well with the rest of the kernel. I know I've said this a few times without offering a concrete proposal. But I'm also in the camp of people who do not care. I worked with everyone who thought they had such a case at my company to switch to psi-based utilization control, and still think this is a better use of resources. It would be good for those who have that "fixed cloud capacity" case to lay it out cleanly and help design a solution. It shouldn't be a vswap blocker. This is as incremental as it gets. No memsw setup is broken, no zram setup is broken.