From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796311147; b=Tg0Ci1QfVhbCkXcOTK4+Qy/5Cr/ZPYcQEDBc6+NQQZFyEHL4SWKRTevvUX55Q2IDWq0f VK63hhpRrqRZfgJbyRufDSHglz2hq4czXNkLgVLA8K4SyjLjZo/azmy7m2/oHo7nVet5y /sXa+kKdAnOFiIg+W18+kLBwqT0xNDc1OZnxX3FWryve+UlZ/Q3KLyVlG+OwdorK0DMRR K3rwG53wMCYvLEM9DkGyvt9UegZGjqn4/bUxW+tN/KX7LCppEaYQ9z2mLX5EFzI+et40o 2Sew0Fh1oMf+jWAQqGTcevwszMLT6jRsWXy3/j4hFuhmmvCVVWm61GY8KnqutpGvXxw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796311147; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=7pslJbzEY/vhks2JURn1hqgOvmukohqrYy18zJYz+7Q=; b=I7v0LcyoTG/aTJ9DG+56LAyx4i9iW+TrK+I7W+AZyTPepVk1ih8Owpws2N9yrile0aW3 YBBPe86ElIDWKiA+PNeFjKgxMep4NRjpwMGH9PSrwRBcZAW0SthZWehMMUFGv7fsx2Opw BLufMQiv5eC1w4JP1hfkExDJ9hDeomKjNaYBdnh7a/RPWQM11umB4r7gcsAyWpjfq+Yeb 4wsYtdqUsBzr8RpT9DNZDYEDhwsyZkm8Ryz8zlrXyPSgrK2RX8Ztue56u/HHblISgyqE4 Ca96Mdr6jTvpcBc//HKZvn6NAqhG6n+pEkbvELIJoAwtzbp22JhdLrsN1aQYLSkcZfA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=XRPuAFxk; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 237DA606A322 for ; Thu, 3 Dec 2026 15:19:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=XRPuAFxk Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F32A1F00896; Thu, 3 Dec 2026 15:19:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796311146; bh=7pslJbzEY/vhks2JURn1hqgOvmukohqrYy18zJYz+7Q=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=XRPuAFxkifULUFZ0bHGvDhVJg/qBHhcFDMpYyT1P8Q5UJYOWIpRKp89EaRHuDHnRE tvj3l4Hjx179TxO1U7YHF+LAKByeDU/J7j9XYHjq0pT4irMTJTqsuh75e3jPgLRn4j f+4nsPTkVmNJ1S9nS9eyy1nXz8CKhwqKlh/K59Dyu/NjynqwiHODmWXcngqyIKHXyT 7p8LNZG/icYZ+0r6chtLtmr7GCsKZp1Wd9UEgglBi192rPbAb1YY/Ta6xHDf9Q/DLY QBdO9GRM7mnm0bYfWOXb1yB52z2XhYW1iQNOcan6di8S1U07Gk2qQFYPK6xmmlbgF5 uOBHzPshdeVzA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v15 4/4] docs: cgroup-v2: document the iocost BPF cost model attachment Reply-To: sashiko-reviews@lists.linux.dev To: "Tao Cui" Cc: bpf@vger.kernel.org, tj@kernel.org, hannes@cmpxchg.org, mkoutny@suse.com In-Reply-To: <20261203150338.2625598-5-cui.tao@linux.dev> References: <20261203150338.2625598-1-cui.tao@linux.dev> <20261203150338.2625598-5-cui.tao@linux.dev> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 15:19:06 +0000 X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [Low] docs: cgroup-v2: io.cost.model bpf readback inaccurately omits ctrl - [Low] docs: cgroup-v2: io.cost.model omits BPF_F_LINK requirement for attach - [Low] docs: cgroup-v2: dev is supplied on struct_ops map update, not map creation -- commit 647cd1dc2151194c42e7d75e366a48e8b9681de0 Author: Tao Cui docs: cgroup-v2: document the iocost BPF cost model attachment This commit documents BPF cost model attachment in the io.cost.qos and io.cost.model sections of the cgroup v2 administration guide. > diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admi= n-guide/cgroup-v2.rst > index 9e3c67b02ae2e..c83f6fba16c1e 100644 > --- a/Documentation/admin-guide/cgroup-v2.rst > +++ b/Documentation/admin-guide/cgroup-v2.rst [ ... ] > @@ -2111,13 +2112,50 @@ IO Interface Files [ ... ] > + When BPF cost model support is available, a BPF cost model > + can be bound to a device by attaching an > + "iocost_model_ops" struct_ops carrying the whole disk's > + major:minor as encoded by makedev(3) in its "dev" member (a > + partition's major:minor is rejected). The loader supplies > + "dev" when the map is created and it cannot be changed > + afterward. Attaching creates the controller if needed, like an [Severity: Low] Is "dev" actually supplied when the map is created? BPF_MAP_CREATE only takes map metadata and BTF type IDs. The "dev" member is supplied on the single permitted BPF_MAP_UPDATE_ELEM call (__bpf_struct_ops_map_update_elem() -> ioc_bpf_init_member()), after which further updates fail with -EBUSY. Even libbpf sends "dev" via bpf_map_update_elem() in bpf_map__attach_struct_ops(). Rewording this to say the loader supplies "dev" when populating the struct_ops map (or before loading the object with libbpf) would match both workflows. > + io.cost.model write does, switches the device's pricing to the > + model and populates the device's line in this file and in > + "io.cost.qos" if it did not exist yet. Attaching fails with > + -EBUSY if the device already has a model attached, with > + -EINVAL if the model fails its attach-time validation, with > + -EOPNOTSUPP if dev names a partition or a device without a > + multiqueue queue, and with -ENODEV if dev does not name an > + existing device or if the device has gone away. Updating the [Severity: Low] Should this also document that link-based attachment (BPF_F_LINK) is required? ioc_bpf_reg() returns -EOPNOTSUPP when link is NULL, which happens for struct_ops maps created without BPF_F_LINK (e.g., SEC(".struct_ops") instead of SEC(".struct_ops.link")). Since other struct_ops types allow non-link attachment, this can produce an undocumented -EOPNOTSUPP. [ ... ] > @@ -2125,7 +2163,9 @@ IO Interface Files > automatic changes are disabled. > =20 > When "model" is "linear", the following model parameters are > - defined. > + defined. They remain writable while "model" is "bpf"; while > + "bpf" is selected, the readback shows only "model=3Dbpf" and the > + attached model's "name". [Severity: Low] Does the readback actually omit "ctrl" while "bpf" is selected? ioc_cost_model_prfill() unconditionally prints "ctrl=3Duser" or "ctrl=3Dauto" before "model=3Dbpf name=3D...". Only the linear model parameters (rbps, wbps, etc.) are omitted. The commit message also says this documents that "ctrl" keeps describing the coefficients while attached, which this sentence contradicts. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203150338.2625= 598-1-cui.tao@linux.dev?part=3D4