From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 28395378D87 for ; Wed, 18 Mar 2026 08:25:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773822354; cv=none; b=C64+tF8+aBhbJ2db8iCJ+pfIg07jWh8qEs/E1Ir4/lV1q46o/IsWoNuH8jzfnxkrCuRqe+wnN0FuTS6Olz/yyw59JAx1bt+INVQW3K3XfBH66uuB3XmsjPlc8oUjtDVUW9ow+uLWG3Q/HAcOsmE5upjJrUPrhGF+hpgDgaRuyac= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773822354; c=relaxed/simple; bh=QQVMaXaAflgjwrw9LePhqS1Qap8U+Lqqz6w2uj7bOGg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BOG4+alyijjFMnM5X7v420oPyLBr1P1UUqpqAdxkELrdsJBWFKM9A2/kXcLi0DS8l3q2ZsPb97R8lD7bfZcqQNkzwH7AVQgDgiVf3rLLPn1HYZJE8cE6eC+Xs424hGUFytWycRDPDe3UTeMfNCTj4AXrHSeV9FCiCtE83A8NGKU= 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/ZSKPjm; arc=none smtp.client-ip=209.85.128.54 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/ZSKPjm" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4852afd42ceso55922655e9.2 for ; Wed, 18 Mar 2026 01:25:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1773822350; x=1774427150; darn=vger.kernel.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=qct1M6uDgddyZIwhlydpZnvmv7ZwIfwluJBCESYJnoQ=; b=e/ZSKPjmpxeJJVM2zlJGotb6EPzQvTHfQk2lut2/ZxU9GkfM4TJnrE0IGy41Cw4rNs aklLIJSHI6wjz6rnn+RGXqBwSJx2rhdXvMT0CCT3KvxSuL0AbVrNF3U2pJ6hRUr3he2p uLWCs76QG1Ytc62wrKkjjvDtJaSm7t6t7EpKfqpo/tzF/w+wlGTBnSrfp6pjxPbwoEZU doC6XQmIfvV/XMyKaEn//kvxBR7O0Aakas6I4pesr+NKwcdBeMZDyt/CAzkqKLjAncVr RBnsoXaQ2ZRuzCQtSKLOjUwQZEqLwvC6khugKvTp1519bblqKxnx9mJZbq9WmavD74iV +EuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773822350; x=1774427150; h=in-reply-to:content-disposition: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; bh=qct1M6uDgddyZIwhlydpZnvmv7ZwIfwluJBCESYJnoQ=; b=snr5tcenlBeNpVaheGpiZpcBTMLLrYLY6GG0xGyaA1U5vDCWl+S6XhVsBtp8V4b8mQ RUjZHb5aM5GflHN8R14GckVYfTujPN6hEsKkryYAXi7K4CqOnU3X+ql3GJM6pnUX1uGY 3tVYdcN1zv/jdIlVFBlrQqOTdQQU5x/AAmeHS5oB7okfphihyZb6D49XyPx6JgxhBq4h xfIKSY2k8h2p2jR3yrjWXJf/ZqxDEbI6HqxDEr3YQGtrEJm07QjPIQyt/p3WCHMsjVZ9 28AqXfXwEj+brmAxupYKq/Y0XFGSPcv6nVzZ5QXaDaOk8FRf5cpJRRmVl3at6pfW8Ie8 216w== X-Forwarded-Encrypted: i=1; AJvYcCVcXQnY8qiWn5jQen58Nou6D2dU6mQ2kwE+qniCiYdFTr/l36l2v7KyQ9j5CQ1SSSE/nP2YAI3dZJ+z6+s=@vger.kernel.org X-Gm-Message-State: AOJu0YxFPwCjDh24LN9+lFZ+O/cNr/cF4nDhUNSXfHbljrG2C8Nw9uBG GcoqIcCKU1dkzuCPTqzc9FUsgvliSsDYublk3JQTFZr4irTeXRvshKG2ViFkuWrbdQc= X-Gm-Gg: ATEYQzzlVeMovVJEZfIZuckJ9XrRpOzAU2SkUPCaFa0ZHmRmCTwdU/S1Y8MDGEK3D1Z gc5197CYlLsJ047L9FNqDLdM9ULIyui3zIrF3lhl+xeqGBO9bvaXQK+NWTrwLnZS3t/HdZ3VIMQ /ECKXp3S8rkvIPMngfgsLE8shEQ6VNGg1jMw9OU/P0Moru87IFupm9pt3w08vFrVtuluk7oodj9 4Ipz05KkQLwVYg89+XxNCz+Lsl7gWMivAH//2aNqwo3sMVVqxzaSuDPtzdVxYWYUsPZpQ/Bx8pv n+a5lraJhEb3TM6sQD7VHSf/no+mNlbmkUPhvVbhPJzl0jbT2QsOtaXjni4+ZSqtVoSbMMaXzq6 brQQvx6ZnQ7sSkNdcyFwWfMZ9lExWzVyDSwp/J4Kin79RrAXC6cnMoPLco1QBMlkepCTwHMZvkl e9mjmiseYDlnbFRbs6dejXwdQnUBLN7eW8XBvd X-Received: by 2002:a05:600c:8486:b0:485:3a22:69b9 with SMTP id 5b1f17b1804b1-486f4457e6dmr35524025e9.29.1773822350370; Wed, 18 Mar 2026 01:25:50 -0700 (PDT) Received: from localhost (109-81-21-195.rct.o2.cz. [109.81.21.195]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4856eae3322sm105879665e9.10.2026.03.18.01.25.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2026 01:25:50 -0700 (PDT) Date: Wed, 18 Mar 2026 09:25:48 +0100 From: Michal Hocko To: Daniil Tatianin Cc: Andrew Morton , Johannes Weiner , Roman Gushchin , Shakeel Butt , Muchun Song , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Axel Rasmussen , Yuanchu Xie , Wei Xu , Brendan Jackman , Zi Yan , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, yc-core@yandex-team.ru Subject: Re: [PATCH] mm: add memory.compact_unevictable_allowed cgroup attribute Message-ID: References: <20260317100058.2316997-1-d-tatianin@yandex-team.ru> <20260317121736.f73a828de2a989d1a07efea1@linux-foundation.org> <3db237d0-1ee8-44b7-a356-f3015173f7c2@yandex-team.ru> 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=us-ascii Content-Disposition: inline In-Reply-To: <3db237d0-1ee8-44b7-a356-f3015173f7c2@yandex-team.ru> On Tue 17-03-26 23:17:28, Daniil Tatianin wrote: > > On 3/17/26 10:17 PM, Andrew Morton wrote: > > On Tue, 17 Mar 2026 13:00:58 +0300 Daniil Tatianin wrote: > > > > > The current global sysctl compact_unevictable_allowed is too coarse. > > > In environments with mixed workloads, we may want to protect specific > > > important cgroups from compaction to ensure their stability and > > > responsiveness, while allowing compaction for others. > > > > > > This patch introduces a per-memcg compact_unevictable_allowed attribute. > > > This allows granular control over whether unevictable pages in a specific > > > cgroup can be compacted. The global sysctl still takes precedence if set > > > to disallow compaction, but this new setting allows opting out specific > > > cgroups. > > > > > > This also adds a new ISOLATE_UNEVICTABLE_CHECK_MEMCG flag to > > > isolate_migratepages_block to preserve the old behavior for the > > > ISOLATE_UNEVICTABLE flag unconditionally used by > > > isolage_migratepages_range. > > AI review asked questions: > > https://sashiko.dev/#/patchset/20260317100058.2316997-1-d-tatianin@yandex-team.ru > > > Should this dynamically walk up the ancestor chain during evaluation to > > ensure it returns false if any ancestor has disallowed compaction? > > I think ultimately it's up to cgroup maintainers whether the code should do > that, but as far as I understand the whole point of cgroups is that a child > can override the settings of its parent. Moreover, this property doesn't > have CFTYPE_NS_DELEGATABLE set, so a child cgroup cannot just toggle it at > will. In general any attributes should have proper hieararchical semantic. I am not sure what that should be in this case. What is a desire in a child cgroup can become fragmentation pressure to others. I think it would be really important to explain more thoroughly about those usecases of mixed workloads. Is the memcg even a suitable level of abstraction for this tunable? Doesn't this belong to tasks if anything? -- Michal Hocko SUSE Labs