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 86554C021A4 for ; Mon, 24 Feb 2025 21:54:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 026906B0083; Mon, 24 Feb 2025 16:54:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EF12628000D; Mon, 24 Feb 2025 16:54:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D91356B0088; Mon, 24 Feb 2025 16:54:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id B8C196B0083 for ; Mon, 24 Feb 2025 16:54:46 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 62C01C01C7 for ; Mon, 24 Feb 2025 21:54:46 +0000 (UTC) X-FDA: 83156193372.10.20E6788 Received: from out-171.mta0.migadu.com (out-171.mta0.migadu.com [91.218.175.171]) by imf13.hostedemail.com (Postfix) with ESMTP id 8B64E20005 for ; Mon, 24 Feb 2025 21:54:44 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=xj7puxSs; spf=pass (imf13.hostedemail.com: domain of yosry.ahmed@linux.dev designates 91.218.175.171 as permitted sender) smtp.mailfrom=yosry.ahmed@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=1740434084; 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=iKvtXyMTOUzB1AmErLiqadTS7N4LqKEv1hJE5pdBIgg=; b=8iMrNIJAnHFc/hGeR+MZwnqdgR5wPAr2uBcdFaqXo+n3wEbqJFkegxyECbBP+i1cPP9Cfp qmga4kUtqsfp0lVRZ3EXHfvUG8nQOe/OERDWzE9/Zc8ZMF9tGkvbNF5hgtF3Ve8B/2Mfjf hifhOlZjjfYvR2/VAfvbzHINfIVxhx8= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=xj7puxSs; spf=pass (imf13.hostedemail.com: domain of yosry.ahmed@linux.dev designates 91.218.175.171 as permitted sender) smtp.mailfrom=yosry.ahmed@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740434084; a=rsa-sha256; cv=none; b=b0YX6dsrG6g/9g1EENmZx/UumXxnX3Akb48PmxVxsJ0q6isqqLvd+REHKQ+4cdeF+Mv9uZ O0080/VHtbTKjgPELRRWvWn7PCh7vrvDQY0r9PUhXQJauJzu9KPeSN2Pwc9WKafkkjtPOv mW69sfFghFZw2+PqddYXDvcJwjYJji8= Date: Mon, 24 Feb 2025 21:54:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1740434082; 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=iKvtXyMTOUzB1AmErLiqadTS7N4LqKEv1hJE5pdBIgg=; b=xj7puxSsieUCrsCLFguHW7TfcXlZ1UOcgY7ki6qZ9yDeGvi202eYiQKUbmi/NfMgxKMCXq 43r32cOv54objJL5JpeJNOMgB2wnGjW6QGxee9ODS/qngJQpxvBToWpl6fKGE8tKK75oT7 p0TMggfxIwUTsbsQ+G49DABHTewcuPA= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yosry Ahmed To: Shakeel Butt Cc: JP Kobryn , tj@kernel.org, mhocko@kernel.org, hannes@cmpxchg.org, akpm@linux-foundation.org, linux-mm@kvack.org, cgroups@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH 00/11] cgroup: separate rstat trees Message-ID: References: <20250218031448.46951-1-inwardvessel@gmail.com> <158ea157-3411-45e6-bca4-fb70d67fb1c5@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 8B64E20005 X-Stat-Signature: p96iyg3uhh7dffn1kopiqgp73kjpysdr X-HE-Tag: 1740434084-622960 X-HE-Meta: U2FsdGVkX1/kpXvPSDn7yWqPYaCacE2Kd+F6pxs7la5AZaf9+29PasapwefNcXYHVwL3boK50CZoahXVK+EI2cFx1esxKTFtUSSPiahWGcn1Xza/qaBOLF1LgYt2xBSjkcZXS0ZDJDMqB6fhfTbDXyWDEqcfS0dNOVY5oqg69mAdJx64dhHQF0bGdsj2HYfjCbi7IqmUCvlk65ub+eV/XpUd76E/pPdFogiMWjmfj8ADENIcr0BOuiANOfKQ+v1rJnt2iSRhBP6uiYHE+wQa9w1q2ivqKuFZogNDeJHbvJ0gDTr+pfb9QQblr5V2bdF9srmCrCD+auSI4bm9oIgPwPxdeGQ+bzHiLXROl58O6Lun0rmEyP0u3XyPgGjHp8+NyvkGtI8H+OT5uP72BhOAmo/d4KY2nLmPpxd8TocpERotHsSn+wKw59WQR+B1HJjGHC7kS+btBUz/FM13dG1lpOnVlN/b8ermed67a1nlGKX3aua3hNjeEyijuJHq2YtCliSg2DsUC57Lk+OXGFO3inYhA3WyGQqnf5TJwqb5DDKVMJF1OrA+nZSPRrUA4euYBwb93//Y0IciHIcKyND5drYRwWvKzGM98i0mpGNpvAUshoRyB9PyV/6QEVO+PSGfrTtujXkWEzfrDRqBaNxilV8hgli/uk1gT75n4bmx8yMVVoISXAg7rdFohLZgj4VJT3fnGkTcOPJS67jgDSq8Jf053Z5JRfvj1r+03tDmEIboiGacqCCg+hxIXQz9oHpUZlpNaoDHrBLsrNqWvz0MMGuXUTUfnV7rtaLYgER3hmkDpKY1LkxPuI+LN1fcFTTX7gKA7v1c3HfOKvH/Sc4AuEfi7EaQyV39A6fHkbem5ThfhJLt3iQjBG3HMsIgZqn7jyOummb4M92NBx8VLXiyHVGUxRqWvBeOEQgHTMC6DbGfk8ZGEDuU8bvvTax/Bik5pU+1wOCWGLyXzZF20+i CMqfyH1S 9P+lKvttmRXAo3X0D/XD5IXFTzhzfuGjSy5PTpXM1kI4xMkXkbR/362OPHzWj57BHKgi/A7u/EPLYkDD5K/xIoilwcouOk2qnLJ3p8QkiUlz/zpFsYuokYXQuth0xiZSfmly1cl/+Dx8Jl4c8+RbKwA/VnjZVO83NaChHafK/PLlLalChdKYgY7zWhpqZx87ENZ+wOEnoZ4CuaKzFK5yfng/+LW+/tAI7EAn3 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: On Mon, Feb 24, 2025 at 01:13:35PM -0800, Shakeel Butt wrote: > On Thu, Feb 20, 2025 at 08:04:02PM +0000, Yosry Ahmed wrote: > > On Thu, Feb 20, 2025 at 10:14:45AM -0800, JP Kobryn wrote: > > > On 2/20/25 9:59 AM, Yosry Ahmed wrote: > > > > On Thu, Feb 20, 2025 at 09:53:33AM -0800, Shakeel Butt wrote: > > > > > On Thu, Feb 20, 2025 at 05:26:04PM +0000, Yosry Ahmed wrote: > > > > > > > > > > > > Another question is, does it make sense to keep BPF flushing in the > > > > > > "self" css with base stats flushing for now? IIUC BPF flushing is not > > > > > > very popular now anyway, and doing so will remove the need to support > > > > > > flushing and updating things that are not css's. Just food for thought. > > > > > > > > > > > > > > > > Oh if this simplifies the code, I would say go for it. > > > > > > > > I think we wouldn't need cgroup_rstat_ops and some of the refactoring > > > > may not be needed. It will also reduce the memory overhead, and keep it > > > > constant regardless of using BPF which is nice. > > > > > > Yes, this is true. cgroup_rstat_ops was only added to allow cgroup_bpf > > > to make use of rstat. If the bpf flushing remains tied to > > > cgroup_subsys_state::self, then the ops interface and supporting code > > > can be removed. Probably stating the obvious but the trade-off would be > > > that if bpf cgroups are in use, they would account for some extra > > > overhead while flushing the base stats. Is Google making use of bpf- > > > based cgroups? > > > > Ironically I don't know, but I don't expect the BPF flushing to be > > expensive enough to affect this. If someone has the use case that loads > > enough BPF programs to cause a noticeable impact, we can address it > > then. > > > > This series will still be an improvement anyway. > > If no one is using the bpf+rstat infra then maybe we should rip it out. > Do you have any concerns? We did not end up using the BPF+rstat infra, so I have no objection over removing that. They are kfuncs and supposedly there is no guarantee for them hanging around. However, looking back at the patch series [1], there were 3 main components: (a) cgroup_iter BPF programs support. (b) kfunc hooks for BPF+rstat infra. (c) Selftests. I am not sure if there are other users for cgroup_iter for different purposes than BPF+rstat, and I am not sure if we can remove an iterator program type (in terms of stability). We can drop the kfunc hooks, but they are not really a big deal imo. I am fine either way. If we remove (b) we can also remove the corresponding test, but not the test for cgroup_iter as long as it stays. [1]https://lore.kernel.org/all/20220824233117.1312810-1-haoluo@google.com/