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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A5C3CC98311 for ; Wed, 23 Sep 2026 15:47:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B1F7D6B00AC; Wed, 23 Sep 2026 11:47:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ACC376B00AD; Wed, 23 Sep 2026 11:47:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 996E76B00AE; Wed, 23 Sep 2026 11:47:18 -0400 (EDT) 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 6CB136B00AC for ; Wed, 23 Sep 2026 11:47:18 -0400 (EDT) Received: from smtpin28.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay04.hostedemail.com (Postfix) with ESMTP id F22DA1A044F for ; Wed, 23 Sep 2026 15:47:17 +0000 (UTC) X-FDA: 85245456114.28.92E0DAA Received: from mta1.migadu.com (out-27.mta1.migadu.com [95.215.58.27]) by imf27.hostedemail.com (Postfix) with ESMTP id BC7194000B for ; Wed, 23 Sep 2026 15:47:15 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=QVRAKpPw; spf=pass (imf27.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.27 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1790178436; 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=oKiW8rwP60FsF4fzVgU0x+yXAX8l7xFBn4J5o6FPZ7I=; b=JQ5Qx5Z3to+S0WHI8mpjS/VUXiaMC1m4HZAI3FtOm9TbtWp4huYnJiNLRL6iAQfFxvIhh4 3anWcyYBoKvuSmwcamZoOBIYmhsqe3YaeJbUOlQpMEj0t53rDt6vqzeHPEej6buie9x+CH mCic0vNQT5EE88Cau95TwCwj6eSHXfU= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=QVRAKpPw; spf=pass (imf27.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.27 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1790178436; b=t/YC1T6GKUmgDFVLxANl4xOqXzvzNu5gzHAN843qNZ5N/lIEVLyzQMdtW0JLSJEeXzhHAm CBKeIqyYlsysM6E+5rN+mum9USWRVP6W0Blhk7Z4QMkkh1kcrvekLxZ8MWisAVHLyQmt1m W0Mg/sUBGdqMUkJV50asZw81/+zBUs0= X-Envelope-To: linux-mm@kvack.org DKIM-Signature: a=rsa-sha256; bh=HNkEwA1ANe2Cy1ef5VkR+k5aNsAR9SDnOLDe/iDUfoE=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1790178429; v=1; x=1790783229; b=QVRAKpPw9pB0VhEAsCwtrOwBZGF/JCoRGpiqsVVzoZ9QhWK5hxGAfABKcxhmvptQ/1Cs5WpG nI9r8I+aFU9x8Xd/aSJiFQdkp9dEUuCuBiL+5rxGXqFvr7q4vnyGhfbVPDK2ItoRnwM1oqIX8Bh kWAZfFcfgjma5hXGG0Q1mLkY= X-Envelope-To: linux-mm@kvack.org Received: by smtp.migadu.com with ESMTPS id d5fec120cfd73ec7; Wed, 23 Sep 2026 15:47:08 +0000 X-Mizu-Trace-ID: d5fec120cfd73ec7 X-Migadu-Flow: FLOW_OUT Date: Wed, 23 Sep 2026 08:47:07 -0700 From: Shakeel Butt To: Yafang Shao Cc: Andrew Morton , Alexei Starovoitov , Johannes Weiner , Michal Hocko , Roman Gushchin , JP Kobryn , Muchun Song , Tejun Heo , Michal Koutny , Amery Hung , Daniel Borkmann , Andrii Nakryiko , Eduard Zingerman , Kumar Kartikeya Dwivedi , Martin KaFai Lau , Song Liu , Yonghong Song , Emil Tsalapatis , Jiri Olsa , Ihor Solodrai , John Fastabend , Jiayuan Chen , hui.zhu@linux.dev, Donet Tom , Greg Thelen , Meta kernel team , linux-mm@kvack.org, bpf@vger.kernel.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 0/4] memcg_ext: memcg policy through cgroup-attached struct_ops Message-ID: References: <20260921192559.2619635-1-shakeel.butt@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: BC7194000B X-Stat-Signature: 7q93xqyg3q4i8ha88nt5r6kf95oatqfe X-Rspam-User: X-HE-Tag: 1790178435-952250 X-HE-Meta: U2FsdGVkX19yOY3pNbA6JX9sOV6KmZTVdpy+RSb24RgCwO+SkAtQuIipsw8LGUYD6IeA1j5Ob/E3XDduM08lipKBX57F3YlgDHUjIo8ES9dD3LSWyhUTBQxhmCOvcbzjv0v7qtj66On+E/A7in4VZUo1qd1dUkxJXjimPqlYmWlK+ewlSbRZRUqt7AMNggktFzQQgIvn/LyYjCwfozSvcRXTfg/lr6awEyJAmCRVniSFp2Pf3+wYnk/hBOEaMCcz+S7Ce5y1qdBgHST022lG+ZvRRFXGWMEqZTCz8EZBPvUIUtRJj9vdg7i+InilUpc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HFk/yR3EwxnfPy6ykI1eerv4nvSmS8= Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hi Yafang, On Wed, Sep 23, 2026 at 09:07:40PM +0800, Yafang Shao wrote: > On Tue, Sep 22, 2026 at 3:30 AM Shakeel Butt wrote: > > [...] > > > > Known open questions > > ==================== > > > > The semantics of memory.high for remote chargers or kernel threads is a > > grey area and this series does not aim to resolve that. > > > > Another open question is whether a bound on debt deferral is needed. At > > the moment, we think that rather than putting a limit on deferral for > > memory.high, it will be better to handle that through an async worker like > > memcg->high_work. We aim to introduce that later, along with the right CPU > > accounting for that async work. > > Hello Shakeel, > > On the open question of how deferred debt eventually gets paid: would > it make sense for the policy to also notify userspace (e.g. via > ringbuf) when it defers, I think the notification through bpf programs is already possible and a bpf program deciding to bypass memory.high can already do notification via ringbuf. > and have a userspace reclaimer do the reclaim > through memory.reclaim? > > I understand one of the concerns for the async worker is CPU > accounting. If the concern is that the kworker's CPU usage is not > charged to the target cgroup, the userspace reclaimer could instead be > spawned with clone3(CLONE_INTO_CGROUP) so it runs inside the target > cgroup, and both its CPU and memory usage get charged there. > > One caveat: intermediate cgroups with the no-internal-process > constraint cannot take processes, so this would only work for leaf > cgroups. > > What do you think? I think all of this is possible without additional code and with this series. With AI, should be very easy to prototype it. Please take a stab and I will look into it as well (time permitting). Thanks for taking a look and also please let me know what other ways you think memcg can be customized through BPF in a beneficial way.