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 33DEDC19F2E for ; Thu, 27 Feb 2025 16:19:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A9C5A6B008A; Thu, 27 Feb 2025 11:19:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A4C7D6B008C; Thu, 27 Feb 2025 11:19:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 914286B0092; Thu, 27 Feb 2025 11:19:39 -0500 (EST) 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 74CB96B008A for ; Thu, 27 Feb 2025 11:19:39 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 188048189E for ; Thu, 27 Feb 2025 16:19:39 +0000 (UTC) X-FDA: 83166235278.08.1635EA8 Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) by imf17.hostedemail.com (Postfix) with ESMTP id 19D344001E for ; Thu, 27 Feb 2025 16:19:36 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=0whOb1Wl; spf=pass (imf17.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.160.178 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740673177; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=hmwhSsv/XWooEXVhNDscUh2O/fwxCYTE2ewAwwf/PEg=; b=qnQN8CxJ7jPNdlKH8Bv0l4we+SVPueEQVzOseSmDk4uNM851JHkOieM9So7tpFfS3aC7jf vPzcqiTLf7C/DXEGS+tgC5lLyFdmcfKBuwQ+Au5cvuKgKyIcrWG5iNyojhaXod4aqs22Cy XGom1gSDj3a8ksaMJYheW6Ym3Q9MTq4= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=0whOb1Wl; spf=pass (imf17.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.160.178 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740673177; a=rsa-sha256; cv=none; b=3wob2zqayKe+blOpmDruVdz9RE/mso+SVnVRGhooYwkowlikfWMOOT2KNnDKFPdr4J7Omy 4MUFykGJ/HvM56WTTU0aD+Li9Qnb11Hq9UjH810XzouIfzF9ul/U5V6SELOVkRKclBXBZ/ airucw2oLvbAasC/MsZy5SZi93AhRH4= Received: by mail-qt1-f178.google.com with SMTP id d75a77b69052e-472242b0da5so11024821cf.1 for ; Thu, 27 Feb 2025 08:19:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20230601.gappssmtp.com; s=20230601; t=1740673176; x=1741277976; darn=kvack.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=hmwhSsv/XWooEXVhNDscUh2O/fwxCYTE2ewAwwf/PEg=; b=0whOb1Wl37VMY6+HsPfsiNdeY4DxXF6Kmv8iio7U1vMvfCnDE8bHD4pC9OT0iGFD3k ++KCQCyAWQDq8yS/WkX6OZf9UeyjVEgIsJsIHKwdnopSjbflkvZs5pd+JC9an5n9Um1G hmqra6neaC5d0LXE4Tk5h3LtSt17aiHyTODNkgHlA+H7f6av3uphGHkbNIgWzFFdulTu 9bzKNcZaPz74Sx31rNox0YuJvR0xjv4efuIt+kxOwGca3fF5CHAWcdOSZbmOWp0PDGf7 AC0N8b6ozRIchKnaPQHdxR0ZWmcFGHiUiaZT+Ek8hwDNvAc82VjIh7DjqYCKTZuahFRc HKGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740673176; x=1741277976; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hmwhSsv/XWooEXVhNDscUh2O/fwxCYTE2ewAwwf/PEg=; b=ay5RLbLFlIBmHtNYc4ck9cNoy2kxmE1OxZEIA3Xe5gCoEP2jL+jDMhZQX4gGhxWn8z dZBCx1RxTOv1/TEevEvn1gANnuT40qTOnakioUIL3QxQpQuOqrrIIk6DiKwLjsFjMlt+ fEhzHJY6rsEXVEZ/KvhcwUNVs/TeP1prY3CA0OVu/SkSgY7p6jzr5B5DW+eM/yAODtSp Ol1/lj/4sz7Lx1K2ml3/NYH1tdPAR1ds/6ZEmWp3znCWhoQKrevUoAEQPfLJSM/sdtQc jvxh6CWVqgYurJdgDEyAOy7o2vzui7KYUUD08dh6jyy8QIJyJEmHd2ZiaQGjTsrSZXVY PmPA== X-Forwarded-Encrypted: i=1; AJvYcCWAMGVWIVMKntI2T+5ayud1SCvdgwScUKHXDOZQR7DledVMfCHSglOvhYvliCYMcNNuDf30CHHKgg==@kvack.org X-Gm-Message-State: AOJu0Yx0A4rXLX3uZg84I/ovvAvLPnWBZy90E5zM7DqywWLhGVFR6Jkm FVP6WHIobQ7VgEYATFkJgRe7ZgRd7t0Om6smdCin/eI/nzVWEZA/HQ+G5HH67ig= X-Gm-Gg: ASbGncuvjZ8B5LvVf2LB96+atri28uQxIxS79PuJKWqTQfRVwc/gguREvZp8m3UlvQo wBjtrcwo3S5zMHMgWEEOGqN1/Xq2aEWqjn4Jf+WxoCRxTor4dY9jGqbwyV0L0M62m7wOdkBhYK4 jdVArWSqIJ8/b9B5VeIWDGXJWCrglHJJ1NJ5vOynYWS6LLcFNF3jGVC+8OAcdb4ZaAZ3gwTTf1x dHDaqqV0B+cDAb8twJoOFnatXS/fFn0T6CXKC2ufLJw3ST7RBq2mofuKS8quGQCIJSN8L4bbQm5 r+pLKkKXpI46u15lE25JZaTV X-Google-Smtp-Source: AGHT+IHRaHuaosZEAeqgzup+sWlmY+z9YMwzc1/l26fkJ6+wOi0mYWekRfZhL6Q95PpZgS+aTZEHFg== X-Received: by 2002:a05:6214:1c4e:b0:6e8:9bcd:bba6 with SMTP id 6a1803df08f44-6e8a0c84efcmr652896d6.7.1740673176094; Thu, 27 Feb 2025 08:19:36 -0800 (PST) Received: from localhost ([2603:7000:c01:2716:da5e:d3ff:fee7:26e7]) by smtp.gmail.com with UTF8SMTPSA id 6a1803df08f44-6e897634a77sm11386876d6.16.2025.02.27.08.19.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2025 08:19:35 -0800 (PST) Date: Thu, 27 Feb 2025 11:19:34 -0500 From: Johannes Weiner To: Joshua Hahn Cc: ying chen , akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/vmscan: when the swappiness is set to 0, memory swapping should be prohibited during the global reclaim process Message-ID: <20250227161934.GA115948@cmpxchg.org> References: <20250227155431.2534325-1-joshua.hahnjy@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250227155431.2534325-1-joshua.hahnjy@gmail.com> X-Rspam-User: X-Stat-Signature: czwuoj8x3echzjbnpbezbot9ee7jzks9 X-Rspamd-Queue-Id: 19D344001E X-Rspamd-Server: rspam07 X-HE-Tag: 1740673176-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scZHOGg5DYxjV5OF/i3j4Mt87ed4b7Q8zKJ1mGyjriWGfdKuVky81hfYOV/VbLuVTFin8cTrVlb7Mr6Rw6N6I7GL40ksruCsH/snKmVPegZMr1NGwC5iKGp62+UEnVYmcMFOScnUcB+erZHq4kjuWfERcKyooo98C03Qr7xHhA9KugA+uLataHwd4MwIAfwbE6ascsaRU5QPruycz2Uwx9Yg0MOukIm1oM1CXa2YmloyL1PyPsM9coUcpoZWJNPP5ZALSxN0VTHTjuq7h4Nsa1Lm8mzSGFpmFGQGgws6BlCm1VZ2CslpyiT0QPypthggcq0ES/od5QTYF+8rqWwGBSw387rB5JVtunFk9p2H5nhMikRiNUHk2tmVV7Da8fdKwN08O4zD3mpJHlRYoif+Q69e5YvLqmS3mzErMJenFRF4DDVBmrIh0FyhWbvzRm+qymww0JBxW7HnhvtJ99yyJnd3A8z1z1jIGMPpDq1E7hjLB+Yto+HbyN1chQaB0AkLfkGUJ/qwKxVn8T1yyvK+v4Ts90FG0FJP X-Bogosity: Ham, tests=bogofilter, spamicity=0.187956, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hello, On Thu, Feb 27, 2025 at 07:54:27AM -0800, Joshua Hahn wrote: > On Thu, 27 Feb 2025 22:34:51 +0800 ying chen wrote: > Previously, when the system is under a lot of memory pressure and is > facing OOMs, global reclaim can create space for the system and prevent > going out of memory by swapping, even when swappiness is 0. If this patch > removes that check, it would mean that global reclaim can no longer > "bypass" the swappiness == 0 condition. > > I am also CCing Johannes, who is the original author of this section [1], > who clarified in the patch that swappiness == 0 has different meanings for > global reclaim and memory cgroup reclaim. Yes. It's been the behavior for decades that swappiness is merely a preference, and that the VM *will* swap to avert OOM. You would break users making this change. If you want to hard-exempt cgroups, set memory.swap.max=0. [ Yes, it's inconsistent. But it's really cgroup_reclaim() that is the oddball in this. Also for historical reasons... ] > > when the vm.swappiness is set to 0, global reclaim should also refrain > > from memory swapping, just like these cgroups. > > > > Signed-off-by: yc1082463 Nacked-by: Johannes Weiner