From: Tejun Heo Subject: Re: [PATCH 1/2] cgroup: add cpu.stat_percpu Date: Wed, 12 Jan 2022 10:23:55 -1000 Message-ID: References: <20220107234138.1765668-1-joshdon@google.com> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=n6vNoI1/a0MDiqXuZ0zXzZQChQHHajU4edJoNcbDIdQ=; b=EYBoAiBSvbXwh/dJ5H4rNhojPuxcAibbjsPJvRAzDkRKcXllebozoVEKaSp/nQJpu/ PAv1LWNyiMTdsL1r1GASsvdIAsGwCfl4jI664YuTM8ZkV/JB4SBEdANOJijQp3wU/CSF uU4pB0uPisW9xxGAtpS9g1OFpvBvS92rtOJXAK5Prk3QRLn+blfi6Pmwrb/BqHHeX95F 85BbQPrXuFfinz5LJF1/9B5Dxf3ujA+ugfdRtIseKhCk4X9a/BJazZE9GjyLpHyveBhV tdA0SURCSyxHi416HaDCKFnaueOmPDRZm86kOAbhep7nEmvZLhV8XikCqilTvD1Wgosp DcBA== Sender: Tejun Heo Content-Disposition: inline In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Josh Don Cc: Peter Zijlstra , Zefan Li , Johannes Weiner , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel Hello, On Tue, Jan 11, 2022 at 03:38:20PM -0800, Josh Don wrote: > Is the concern there just the extra overhead from making multiple > trips into this handler and re-allocating the buffer until it is large > enough to take all the output? In that case, we could pre-allocate > with a size of the right order of magnitude, similar to /proc/stat. > > Lack of per-cpu stats is a gap between cgroup v1 and v2, for which v2 > can easily support this interface given that it already tracks the > stats percpu internally. I opted to dump them all in a single file > here, to match the consolidation that occurred from cpuacct->cpu.stat. Yeah, nack on this. That part was dropped intentionally. These text pseudo files aren't a great medium for this sort of (potentially large) data dump and they scale really badly with new fields which we may want to expose in the future. For detailed introspection, a better route would be using bpf and if that's inconvenient for some reason trying to make them more convenient. Thanks. -- tejun