The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Liang Luo <luoliang@kylinos.cn>
Cc: void@manifault.com, arighi@nvidia.com, changwoo@igalia.com,
	emil@etsalapatis.com, devnexen@gmail.com, yphbchou0911@gmail.com,
	zhaomengmeng@kylinos.cn, sched-ext@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tools/sched_ext: scx_flatcg: Document cgroup v2 requirement
Date: Wed, 03 Jun 2026 22:29:10 -1000	[thread overview]
Message-ID: <c2c820b0287df816cae84763b9e757bc@kernel.org> (raw)
In-Reply-To: <20260603090106.2494243-1-luoliang@kylinos.cn>

On Wed, Jun 03, 2026 at 05:01:06PM +0800, Liang Luo wrote:
> The BPF program relies on cgroup v2-specific features - specifically
> BPF_MAP_TYPE_CGRP_STORAGE and cgroup v2 kfuncs (bpf_cgroup_ancestor,
> bpf_cgroup_from_id, scx_bpf_task_cgroup, ...), none of which are
> available on cgroup v1. The current file header describes the
> algorithm but does not make this runtime requirement explicit, so
> users running on a cgroup v1-only system get a confusing BPF load
> error with no clear pointer to the cause.

This doesn't look accurate on current kernels. BPF_MAP_TYPE_CGRP_STORAGE is
registered unconditionally and its fd access goes through
cgroup_v1v2_get_from_fd(), and bpf_cgroup_ancestor(), bpf_cgroup_from_id()
and scx_bpf_task_cgroup() all take a plain struct cgroup with no v1/v2
gating. The program should load fine on cgroup1.

Did you actually hit a load failure, and on which kernel? cgrp_storage's
cgroup1 access was only enabled in v6.8 by 73d9eb340d2b ("bpf: Enable
bpf_cgrp_storage for cgroup1 non-attach case"). Before that it was cgroup2
only, which would explain a failure on an older kernel.

Thanks.

--
tejun

  reply	other threads:[~2026-06-04  8:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-03  9:01 [PATCH] tools/sched_ext: scx_flatcg: Document cgroup v2 requirement luoliang
2026-06-04  8:29 ` Tejun Heo [this message]
2026-06-04  9:29   ` luoliang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c2c820b0287df816cae84763b9e757bc@kernel.org \
    --to=tj@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=devnexen@gmail.com \
    --cc=emil@etsalapatis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luoliang@kylinos.cn \
    --cc=sched-ext@lists.linux.dev \
    --cc=void@manifault.com \
    --cc=yphbchou0911@gmail.com \
    --cc=zhaomengmeng@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox