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 1CC14CA5FD4 for ; Thu, 1 Oct 2026 16:00:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 234456B0088; Thu, 1 Oct 2026 12:00:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1E5146B0093; Thu, 1 Oct 2026 12:00:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0D38E6B0096; Thu, 1 Oct 2026 12:00:13 -0400 (EDT) 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 DCA526B0088 for ; Thu, 1 Oct 2026 12:00:12 -0400 (EDT) Received: from smtpin24.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 6C76514045F for ; Thu, 1 Oct 2026 16:00:12 +0000 (UTC) X-FDA: 85274519064.24.056D336 Received: from mta1.migadu.com (out-71.mta1.migadu.com [95.215.58.71]) by imf13.hostedemail.com (Postfix) with ESMTP id EC08220005 for ; Thu, 1 Oct 2026 16:00:08 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=Exk80jZv; spf=pass (imf13.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.71 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=1790870410; 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=t/UmLJEY0a3iLYujZH4c7hJLto4+PkpocQpwMHfxzk4=; b=x0XRBH6KJ6GDCjsrgxVDW8ficaZKgncr2J4xjLGt2lQZwi2SjcxIPGJU8DFEANAtnfCGlN z65y1a4Dgc/mS3xNO+txprfV0PeAB2j7nI53WEn5CgIAtC74nfwTusTVB8Wm1JkhUC1ulj H5AASk57GmV7X6N2bj4lqcF4FKuUeCM= ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1790870410; b=m0hvTa5Qxyz8TKb7HsAyL3z81/1481y7M2OCvykfep4NSubkp7CrtV3LVU1yAAgZsvlU8j zplfs4mxNJC0ieN+SvR+s9ROefe7w4v5GGmirRUfokscwRy4aVtOs+XwrXeLPocKgNRUpG i9+jFbkEFs6N34w4uUvYSpoS9/oh8MU= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=Exk80jZv; spf=pass (imf13.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.71 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Envelope-To: linux-mm@kvack.org DKIM-Signature: a=rsa-sha256; bh=nQNXL5q4knr5P0PR//t77Jz5pY4phClaMKAM51WfU40=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1790870407; v=1; x=1791475207; b=Exk80jZvoe5ccJQCgQeZt8Ca6D1jqS14CyBvgIo8nXhXYOpazRoGADCeZNiU1vDWygPqgumL Qqkw9dADHpmazD7czY0QvqUfwUvQxiyF8ZLlzfdDx7k+tQYuGCllI6bFEsAhlBOfeVIK49XSAR/ 8biMU8JiRvMotPQBZ1EzOE14= X-Envelope-To: linux-mm@kvack.org Received: by smtp.migadu.com with ESMTPS id 4267819c097ea3ea; Thu, 01 Oct 2026 16:00:02 +0000 X-Mizu-Trace-ID: 4267819c097ea3ea X-Migadu-Flow: FLOW_OUT Date: Thu, 1 Oct 2026 09:00:00 -0700 From: Shakeel Butt To: Peter Zijlstra Cc: Tejun Heo , Johannes Weiner , Michal =?utf-8?Q?Koutn=C3=BD?= , Michal Hocko , Roman Gushchin , Muchun Song , Andrew Morton , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak , Suren Baghdasaryan , Kumar Kartikeya Dwivedi , David Dai , JP Kobryn , Frederic Weisbecker , Aaron Lu , Daniel Jordan , Hao Lee , kernel-team@meta.com, cgroups@vger.kernel.org, bpf@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 0/7] cgroup: charge kernel work to the cgroup it is done for Message-ID: References: <20260924184714.912181-1-shakeel.butt@linux.dev> <20261001105909.GL4121339@noisy.programming.kicks-ass.net> <20261001121842.GJ4121620@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261001121842.GJ4121620@noisy.programming.kicks-ass.net> X-Rspam-User: X-Stat-Signature: 9r1j5cyud3xzaa8egmq1y934tbsr7tbd X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: EC08220005 X-HE-Tag: 1790870408-336630 X-HE-Meta: U2FsdGVkX18p1OODckdi9LGFUPAEvOEa4SMxqt6/YdlZyHPO127bfdewlMOh2owaIa8e3P6g8coJ4eA33pv2l25bQuw+RZBnP80AGZYvNII4YNIhpbyC5nApErTnXW5sG+YOUuiQS6j07TFsOkirLh8NiQ3CONZCL9I8fxkkfppO6rVC4lkTHxA03Ix4rh8lCXILJGVSNP1xOYyWYf6uk0hTPmt4z/5N5gz7vKs1jKYrY1dy2kN9VJH+iXS1AcCO+JzX2ejquuovHQ1hACd1a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gs/fH5rA== Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Oct 01, 2026 at 02:18:42PM +0200, Peter Zijlstra wrote: > On Thu, Oct 01, 2026 at 12:59:09PM +0200, Peter Zijlstra wrote: > > On Thu, Sep 24, 2026 at 10:28:10AM -1000, Tejun Heo wrote: > > > Hello, Shakeel. > > > > > > On Thu, Sep 24, 2026 at 11:47:04AM -0700, Shakeel Butt wrote: > > > > This series lets a kernel thread say which cgroup it is working for. > > > > That cgroup then sees the CPU time in its cpu.stat and the stalls in > > > > its memory.pressure, and the CPU time comes out of its cpu.max quota. > > > > The first user is the memcg reclaim that runs from high_work. > > > > > > This doesn't translate to net rx, which is another major source of > > > displaced CPU usage. Switching membership on each packet isn't going to > > > work there. Attribution can't happen that way. We'd much rather count > > > per-cgroup received packets and prorate the CPU consumption. If at all > > > possible, I think it'd be better to adopt an approach which can cover > > > both use cases. > > > > Ideally RX would be split for each network queue, rather than lumped > > into the one giant softirq that nobody owns. > > > > I know PREEMPT_RT has been wanting something like that for ages. Not all > > queues are created equal. Some might want RT priority while others > > should definitely not. > > > > Furthermore, without ingress throttling, your RX back charge could > > completely deplete the actual cgroup time quota. > > > > Anyway, if you get per queue RX processing threads, then you can move > > them into cgroups where so desired. > > Gemini is trying to tell me this exists and is called Threaded NAPI. For the accurate cpu accounting of net rx, threaded NAPI or softirq is not that important. I think it is steering packets of the workload/cgroup to their dedicated queues and only newer NICs have support for hardware rx steering. For old NICs, we will still be getting packets for different cgroups on the same NIC queue and I think Tejun is asking for cgroup cpu accounting for this scenario to work.