From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED0633F86F8 for ; Mon, 27 Jul 2026 11:07:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785150430; cv=none; b=n64y3Ky9EKP0lGVqkLZMt5XJBVmAJ42TMEQxbwQDztO+fbwivmtz7U41RIc1+BMX6lUcfIaXjx6kdkykHpG6SGpy0QC35uF1i2w5e+UtB8pYBpYCDISs5P0olGHLqGHvO0CjKKtOg7EMbhgc9sQwghN96dZNCBXSXStwdOWd470= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785150430; c=relaxed/simple; bh=eiePssanOChul9o4TvxVWaX5Hpbt7DFsEMu4VFQ7hpU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QHSJ+PBrlJVCh5+LHaIPjNLc4r53BXBu4bQ6z7cyp9rORojpExQonU4gMrb63j1sB4NX0iwNZzY2kjdB9m0bHeswsrPcNqhlg3oesBpljFJfQrTxe9xi+fCwi5ueYMNnlryhIECNzFn9IM7lSKfzNCfEpdkYbIH0Q9rnX45bEpI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=e/akcKqD; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="e/akcKqD" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-47f7854678bso840970f8f.3 for ; Mon, 27 Jul 2026 04:07:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1785150424; x=1785755224; darn=vger.kernel.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=5w7z4b4ItZfAnGdR2d5efYiK4hIf2c6dkxv9txYXXIc=; b=e/akcKqDv+SnJIjp6u5k9bSZ0L4g+pyaASwvDOTLeprVZLL+RQQdlPP59JPEcz0m6h y72qfSvxLqm3OVBWfoO51nWaxrYqJu/R0i0Q9GxVVRpcFaw6P2C6I0tw+EK4cGKRhwdF xP053+XmX1sRTYC4SdOHCZCCqYojxstqX4CPU70WbMn+jhh+gPdqodHy1cuEB7c82P5K nDquLmXwyRbvdlRqTbT3TkYa7uC1+Gxo9kCH1WEIwtqKKNzlM/Xekj7/6fSaBrT210+1 j4pu/bhU/Mm7Dl+fNAvhJ92hMbs8BrzVRYuaiHI3Tq9dIHvCifli3fkpwDtpU3+SQB0r uB5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785150424; x=1785755224; 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=5w7z4b4ItZfAnGdR2d5efYiK4hIf2c6dkxv9txYXXIc=; b=r7Edkz9YIOzA51rvgomYr9CbuXLNSUb7nB+CQda4aSkW0zmkwL0TCGEYPqXzIw4LdV xgdm6jXzl6UO+v/BEcoL7OXo/q9V8hYj/VB3Zh44coref6X89bB6swts6Ed80iWf/Rmy QUohK7UM2fAvc3TtsIWl0t7xBdCPIFsePBYpcVbwSv4YngUkJZ9y7Bv1HcZgkCpsv2u/ gVpRos3fOQ74WKvRixesztJ/tsV/7RV9ByhAKoW4i+xQf3S9VvbZDLp5bz86B2Y6GKb4 oXIGuy5B4bzLE02nhyHml7dz1btW4dXV66RzOSIo0sUqFasrTDBrv6jKw5h9ihjIeqEf V30w== X-Forwarded-Encrypted: i=1; AHgh+Ro+NFAoa53DythOxUl/6ZRBb9a1Jgu7jtrwUoaaPBwxwZfba4kkFBRpgzPkSbmQIrCQDAXasDXRS4fBnTI=@vger.kernel.org X-Gm-Message-State: AOJu0Yw4qu9GxdNG3yiVaQebUP6g6xDxvbjefTismT1EeHMyjecc3neA iBTUsDLYhsFn29kVvra+0ouuqXRhVHHgFNxTu8gbc52i6IJhfGONE30g70BjEDBqPoo= X-Gm-Gg: AR+sD12mKS4+7tY885N5IDsSMMmFx+m5zNG2e/etmdjhzkJgW9PmAvr+M+EFWc9L9T5 dJdDKIvRmmFZby7Yui3I9bL0UI84B60uYJiO9CE/fc/pZRIM5bRVtBX7EnzvLUisjo6r0q3nSLS 6e68yQmLl2FxAMPw1353ndb8bbKLmCFpymYbSJV1bgZJHkOA6BOYnAk+7udqRv9jYn8ym7/sUvU RKNC1AolxEXj/FZbi9KCjtiexSvVIRN4dBOMG3zDh0ME+w9rbFWQBdnTxe/K+6MO4XUJ1n4/MNr cNNe3O6YNlno2+HjwtC63HsWMn9xZAUy4K2ACgT1CLbsDHLLiLXq8TaWsnUeoNrM3sEpCDx7abX vREzDLScWrkLMs8huJE5aaf22BvHpaE2HXdkmOePKlzHbz8QV/mAvGWwvnMQIknewr4vhvR6oOr bjvKZ5vOooVw== X-Received: by 2002:a05:6000:3109:b0:47f:8ce7:8684 with SMTP id ffacd0b85a97d-47f9fc9d4b8mr10289593f8f.6.1785150424336; Mon, 27 Jul 2026 04:07:04 -0700 (PDT) Received: from localhost (109-81-83-7.rct.o2.cz. [109.81.83.7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f85c531afsm52462450f8f.24.2026.07.27.04.07.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2026 04:07:04 -0700 (PDT) Date: Mon, 27 Jul 2026 13:07:02 +0200 From: Michal Hocko To: Barry Song Cc: Ridong , Andrew Morton , Johannes Weiner , David Hildenbrand , Qi Zheng , Shakeel Butt , Lorenzo Stoakes , Kairui Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , Zhongkun He , Muchun Song , Davidlohr Bueso , Roman Gushchin , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Ridong Chen Subject: Re: [PATCH -v4 1/4] mm/vmscan: fix anon-only reclaim evicting file pages when swappiness=max Message-ID: References: <20260724033435.2573323-1-ridong.chen@linux.dev> <20260724033435.2573323-2-ridong.chen@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Mon 27-07-26 18:56:07, Barry Song wrote: > On Mon, Jul 27, 2026 at 4:19 PM Michal Hocko wrote: > > > > On Fri 24-07-26 11:34:32, Ridong wrote: > > > From: Ridong Chen > > > > > > As Qi mentioned [1], when swappiness=max (SWAPPINESS_ANON_ONLY) is set, > > > the reclaim logic is expected to reclaim anonymous pages exclusively. > > > However, due to the current ordering of checks in get_scan_count(), > > > file pages may still be evicted if can_reclaim_anon_pages() returns > > > false, which contradicts the semantics of SWAPPINESS_ANON_ONLY. > > > > But if can_reclaim_anon_pages tells us that anonymous pages are not > > reclaimable then it makes no sense to try that, no? What do you expect > > to see? An OOM killer? > > This is proactive reclaim rather than direct reclaim, and > SWAPPINESS_ANON_ONLY is only supported for proactive reclaim. It > therefore cannot invoke the OOM killer. > > If I understand correctly, this is exactly the issue this patch is > trying to address. Instead of falling back to reclaiming file folios, > it returns "bash: echo: write error: Resource temporarily unavailable". My bad. I have misread the changelog and even missed the WARN_ON for !pr-oactive reclaim path. Failing pro-active makes sense. -- Michal Hocko SUSE Labs