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 882DAC83F17 for ; Mon, 14 Jul 2025 16:21:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C50588D000C; Mon, 14 Jul 2025 12:21:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C01398D0001; Mon, 14 Jul 2025 12:21:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B65AB8D000C; Mon, 14 Jul 2025 12:21:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id A75368D0001 for ; Mon, 14 Jul 2025 12:21:49 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 539A21A022C for ; Mon, 14 Jul 2025 16:21:49 +0000 (UTC) X-FDA: 83663386338.08.B54D766 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) by imf04.hostedemail.com (Postfix) with ESMTP id 781004000F for ; Mon, 14 Jul 2025 16:21:47 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=uTXLSzO2; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf04.hostedemail.com: domain of roman.gushchin@linux.dev designates 91.218.175.185 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1752510107; a=rsa-sha256; cv=none; b=PEb+/2vdIIeVhhVmj1ovp5pOvAzjh4e13rUIEzZ7Grxqpqp6Am9lRhXVm5RKK4Ieco9mO5 f+WOVG5yAE8/myzdr5Fnm5aipkODkEpRR8XwhHDpyftQdLF+Mw3D7qOgGvN/TwteweU+Vy BQw4I/NB0YJOEehPc+xKnYibSdxgVXo= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=uTXLSzO2; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf04.hostedemail.com: domain of roman.gushchin@linux.dev designates 91.218.175.185 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1752510107; 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=xcxPOiqo1VWn6JFGmacDTt76C1NFyWdttR909jiVjRY=; b=aOHKEf8jmkVnliiydqm2bkcd4gQA+dfvpRpIfgMJ0xccRBMzxuS9L5gB2PH0+wyq7X870T ESrL/94WL+Of2UL2/2SPQSk0CDARQabFy4Mq7CMnzVt3tFVBukH+k5kfYLOhib5dz03Si6 3jIb2BgKUiJjOK7+7ZG70j7M2J6QwAQ= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1752510105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xcxPOiqo1VWn6JFGmacDTt76C1NFyWdttR909jiVjRY=; b=uTXLSzO2c1NdApSVVJ8OQZxksSUT2V6en2xn/FPj6bE2wK3O/qCwEtfTQ8Hm1LUEIXx0+O VECfo+bbWXcxADaZDUjRiWGu8t3MMHEApvi768esm/J4IfNHqvyNGV59t2YW+gAJZv26iq qXSM9jCAyhZBiJsQl3PFGFueZ18JYoM= From: Roman Gushchin To: Johannes Weiner Cc: Andrew Morton , Shakeel Butt , Lorenzo Stoakes , Michal Hocko , David Hildenbrand , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: skip lru_note_cost() when scanning only file or anon In-Reply-To: <20250714152247.GB991@cmpxchg.org> (Johannes Weiner's message of "Mon, 14 Jul 2025 11:22:47 -0400") References: <20250711155044.137652-1-roman.gushchin@linux.dev> <20250711172028.GA991@cmpxchg.org> <8734b2vcgr.fsf@linux.dev> <20250714152247.GB991@cmpxchg.org> Date: Mon, 14 Jul 2025 09:21:34 -0700 Message-ID: <87o6tmu4j5.fsf@linux.dev> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: 781004000F X-Stat-Signature: xchbmgip1a5guaaz5cwsxcd4wzi7cnxs X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1752510107-151692 X-HE-Meta: U2FsdGVkX1/ceu2tUwsJyDcH/KgnQ+zAwxuqD/x2Ucuu/48gYI6sR/PLmzqZH+y2FG9m2Fd+wMBlTKsHfqc5Dnpdhdkdqp+RFnZ3712iM9eSU29dGgkZV79UPsBcj4tCIiuNi+TgXuSQeXBW9+9cSMchfA8pRz627iUWM5qLSsBpma0HGGIZ5UGB/aDhGjAzbjWv55g1y72Wody9H01LL1+/V2A1FSLuRdQ+5pklISN2wuQKEmqP/2B56os3XS3PHiZvTIfpYKhontMCdmhdfIgMORZE6q6ELyJGYOykINz6416rasc5DUWoFDXnRdlO2Mes1yaF/8gAS9XQxDFHnagTGy54jyPBiExkeDoQe25G/dettaGc4kcl+JA28t+gk1FwkLnlZACbKJlxHYtDxau2btOxcEWwGMSPIKoAlMX/SDqrvlRO2HPY99D9U0HUjiPjR/YTuqBvZ8pv0VpfcM1iZrt9drvTNLo4B/DVsY9tLt+fjD4ldvb5CrXdk2tEcUeaJOlrkbvb5bYwMj8T0H7g1CknUbra1Rm2s6hsGnjbYRjVk1s48R2w7UYVGoNae0cF82x9m11LnveAwTwOyPDXSf+30jjaZ/LFNdUSgM0lcs94ASFv6Y8DrMJMasqE4J8XYK/3szXAwZwFyxBpVgth1b6vYHEzjKT/OpeKeKd+qVqbVakfGO+dJ2V03vVA45Y8jlqhPmmIJiOLfjQGbdXFh+xswqvl5eGLoR7ysn+T7fmK9xAZWIeF7LT5XI0vte6eyrJmF7/WK2V005unQcYDtAIyDh3hNbzEA53TYj8iQ0Cr9ElBOZ1WcPflb7H4yh+G1MiMQwTckcKkJlvEBNgcRemjY2VHuNT4DthiYlgRTddTKLdtvdXPD2idegZ1e5NSZ4ZqtNuNu2aqTvA/sJEoFvTz9rKqe1IDY11Mr+feeX4T6dhb8m90Jt4wW8Nt0FuuOmg6QkvT7Q3OZf9 /5gNX95Y /BPlSxbFtJRCy95iatAkNCTmr6q7DkPswbeanNIH3rMkn1dfpYQHnpkLxwsSmKclBXK2GvGRzQgF1D4O4oCBc0eHfGa7MaDuvt0s13nmqglcbqTv9TXA2YSbYkm4w/Ki4zEJTtHeexNvgRUMk5cItke9I0iJmYoQ67ne68i4srDw9AbI+/Mes4plHGMOPaGTf21scJCW+Z24Awg88c/j/MZ5EwhV40mQkGLu8hKRJ+Mw/9SUp2POo9wBwdjQpcvY9z1loBM3qSqU829xj5fxRr5YdKg== 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: Johannes Weiner writes: > On Fri, Jul 11, 2025 at 10:55:48AM -0700, Roman Gushchin wrote: >> Johannes Weiner writes: >> > The caveat with this patch is that, aside from the static noswap >> > scenario, modes can switch back and forth abruptly or even overlap. >> > >> > So if you leave a pressure scenario and go back to cache trimming, you >> > will no longer age the cost information anymore. The next spike could >> > be starting out with potentially quite stale information. >> > >> > Or say proactive reclaim recently already targeted anon, and there >> > were rotations and pageouts; that would be useful data for a reactive >> > reclaimer doing work at around the same time, or shortly thereafter. >> >> Agree, but at the same time it's possible to come up with the scenario >> when it's not good. >> A >> / \ >> B C memory.max=X >> / \ >> D E >> >> Let's say we have a cgroup structure like this, we apply a lot >> of proactive anon pressure on E, then the pressure from on D from >> C's limit will be biased towards file without a good reason. > > No, this is on purpose. D and E are not independent. They're in the > same memory domain, C. So if you want to reclaim C, and a subset of > its anon has already been pressured to resistance, then a larger part > of the reclaim candidates in C will need to come from file. So, basically you can create a tiny memcg without swap in a large system, create a ton of memory pressure there and bias the global memory reclaim? That's strange.