From: Cristian Marussi <cristian.marussi@arm.com>
To: Christian Brauner <brauner@kernel.org>
Cc: "David Hildenbrand (Arm)" <david@kernel.org>,
Cristian Marussi <cristian.marussi@arm.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, arm-scmi@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org,
sudeep.holla@kernel.org, james.quinlan@broadcom.com,
f.fainelli@gmail.com, vincent.guittot@linaro.org,
etienne.carriere@st.com, peng.fan@oss.nxp.com,
michal.simek@amd.com, d-gole@ti.com, jic23@kernel.org,
elif.topuz@arm.com, lukasz.luba@arm.com, philip.radford@arm.com,
souvik.chakravarty@arm.com, leitao@kernel.org, kas@kernel.org,
puranjay@kernel.org, usama.arif@linux.dev, kernel-team@meta.com
Subject: Re: [PATCH v4 00/31] Introduce SCMI Telemetry FS support
Date: Fri, 3 Jul 2026 14:18:56 +0100 [thread overview]
Message-ID: <ake2wFSSxD2Dnvyr@pluto> (raw)
In-Reply-To: <20260629-rangfolge-intellektuell-flagrant-2814268b9d66@brauner>
On Mon, Jun 29, 2026 at 10:22:46AM +0200, Christian Brauner wrote:
> > > Thanks a lot, David !
> >
> > Let's hope for some guidance regarding the FS side soon.
> >
> > But yeah, avoiding the in-kernel FS sounds completely reasonable at this point.
>
> Afaiu, David wanted me to add a few comments on the viability of a
> character device for this.
Hi Christian,
thanks for Your feedback on this.
>
> I think you usually have at least the following options:
>
> (1) character device
> (2) notification pipe
> (3) netlink
> (4) well-known AF_UNIX socket
>
> You then need to consider your constraints. David added a few:
>
> (i) root can set properties (enable/disable events)
> (ii) non-root can only retrieve properties/events
>
> I assume you mean real root, i.e., root on the host system or more
> specifically anyone with CAP_SYS_ADMIN or some other relevant
> capability.
Yes.
>
> This is a rather simple model and gets a lot of head-scratching out of
> the way.
>
> But root could also mean "root in a users namespace" which makes this
> more complicated as it effectively means that an unprivileged container
> would be enable/disable events. This makes sense if there's a subset of
> events that naturally lends itself to be charged to a container and that
> the container might have a genuine use for.
I had already ruled out any container support with the defunct FS
interface idea, since it does NOT really make any sense with SCMI
telemetry.
>
> This touches on another design question which decides how complicated
> the whole implementation is going to be: What consumer-producer
> relationship does this need?
>
> The process subscribing to the telemetry stream might have exclusive
> access. IOW, once you have subscribed to the telemetry stream the
> connect is busy and no new subscribers are allowed. This is a very
> simple model ofc which has advantages.
>
> On the other end you have the uevent model. Uevents are broadcast to all
> subscribers who have a uevent netlink socket open (glossing over some
> namespacing details that are irrelevant here).
Stream mode is only one of the possible collection mode in SCMI, and
I am not implementing that immediately out of the box, since by the spec
the asynchronous SCMI notification support needed by a reasonably
performant streaming mode implementation is...optional.
At first I will only implement 'polled' mechanims, i.e. in which the
platform updates the Telemetry data as required by the configuration
chosen and the users go and read the data at the known locations when
they see fit.
>
> You need to figure out what you really need here. The choice of
> transport also has quality of life implications.
>
> (1):
> A character device is somewhat simple but it means it's all inherently
> tied to devtmpfs and namespacing it retroactively is not possible. If
> you ever want to namespace it, i.e., delegate it to unprivileged
> sandboxes, userspace needs to bind-mount the character device into the
> container at container startup or have a mechanism to inject said
> character devices later via the new mount api. It's all possible I'm
> just pointing out that you're tied to a rather rigid kernel object. But
> I think in general it is ok.
No containerization support. I am going for a chardev+IOCTLs approach with
the possibility of an alternative RAW direct mmap access to the Telemetry
shared areas from userspace.
>
> (2):
> A while ago David Howells extended pipes with the concept of a
> watchqueue. A watchqueue is just a pipe with some special properties. It
> can be created by passing O_NOTIFICATION to pipe(2) "meticulously
> undocumented" as Jon would say...) into which the kernel splices small,
> fixed-format notification records:
>
> int fds[2];
> pipe2(fds, O_NOTIFICATION_PIPE);
> ioctl(fds[0], IOC_WATCH_QUEUE_SET_SIZE, nr_notes); /* preallocate, 1..512 */
> ioctl(fds[0], IOC_WATCH_QUEUE_SET_FILTER, &filter); /* optional */
> keyctl(KEYCTL_WATCH_KEY, KEY_SPEC_SESSION_KEYRING, fds[0], 0x01); /* subscribe a source */
>
> If the ring is full or no free note exists, the record is dropped and
> PIPE_BUF_FLAG_LOSS is set on the last buffer. So consumers always learn
> that they missed something — but not what.
>
> IOC_WATCH_QUEUE_SET_FILTER takes struct watch_notification_filter with
> up to 16 watch_notification_type_filter entries. With a filter installed
> the default is reject and only the type bit + subtype bit + info match
> let a record through. Passing NULL removes all filters (everything
> passes).
>
These are good to know possibilities that I will explore better..thanks !
> Kinda like a ringbuffer might be something to consider.
> O_NOTIFICATION_PIPE works from all contexts (hence the preallocation).
>
> (3):
> No.
>
> (4):
> A while ago I added the "coredump socket" to the kernel. Basically,
> userspace listens on a well-known AF_UNIX socket address (in this case
> configured via /proc/sys/kernel/core_pattern). The kernel connects to it
> and sends the coredump data via this socket (with some protocol
> negotiation at the beginning).
>
> If you really want to transform the data stream you're receiving into a
> FUSE filesystem I think any of the referenced methods is compatible with
> that. You just refresh the various files when new events come in and
> otherwise show the data that you already have.
>
> In other words, if you allow multiple consumers the following scenario
> may happen: Consumer A consumes event E_1 and consumer B consumes E_2,
> consumer A now gets E_3. If consumer A is what funnels the data into a
> filesystem then consumer A misses data. That might be fine or might not
> be.
>
No we already dropped the FUSE extensions idea...the performance hit would
be too much and it just make more sense for the existing libs to
interface with the new IOCTLs interface.
Thanks again !
Cristian
prev parent reply other threads:[~2026-07-03 13:19 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-12 22:37 [PATCH v4 00/31] Introduce SCMI Telemetry FS support Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 01/31] firmware: arm_scmi: Add new SCMIv4.0 error codes definitions Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 02/31] firmware: arm_scmi: Reduce the scope of protocols mutex Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 03/31] firmware: arm_scmi: Allow registration of unknown-size events/reports Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 04/31] firmware: arm_scmi: Allow protocols to register for notifications Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 05/31] uapi: Add ARM SCMI definitions Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 06/31] dt-bindings: firmware: arm,scmi: Add support for telemetry protocol Cristian Marussi
2026-06-15 22:14 ` Rob Herring (Arm)
2026-06-12 22:37 ` [PATCH v4 07/31] include: trace: Add Telemetry trace events Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 08/31] firmware: arm_scmi: Add basic Telemetry support Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 09/31] firmware: arm_scmi: Add support to parse SHMTIs areas Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 10/31] firmware: arm_scmi: Add Telemetry configuration operations Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 11/31] firmware: arm_scmi: Add Telemetry DataEvent read capabilities Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 12/31] firmware: arm_scmi: Add support for Telemetry reset Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 13/31] firmware: arm_scmi: Add Telemetry notification support Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 14/31] firmware: arm_scmi: Add support for boot-on Telemetry Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 15/31] firmware: arm_scmi: Add Telemetry generation counter Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 16/31] firmware: arm_scmi: Add common per-protocol debugfs support Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 17/31] firmware: arm_scmi: Add Telemetry debugfs SHMTI dump support Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 18/31] firmware: arm_scmi: Add Telemetry debugfs ABI documentation Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 19/31] firmware: arm_scmi: stlmfs: Add System Telemetry filesystem driver Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 20/31] fs/stlmfs: Document ARM SCMI Telemetry filesystem Cristian Marussi
2026-06-13 5:27 ` Randy Dunlap
2026-06-12 22:37 ` [PATCH v4 21/31] firmware: arm_scmi: stlmfs: Add basic mount options Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 22/31] fs/stlmfs: Document ARM SCMI Telemetry FS " Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 23/31] firmware: arm_scmi: stlmfs: Add ioctls support Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 24/31] fs/stlmfs: Document alternative ioctl based binary interface Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 25/31] firmware: arm_scmi: stlmfs: Add by-components view Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 26/31] fs/stlmfs: Document alternative topological view Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 27/31] firmware: arm_scmi: stlmfs: Add generation file Cristian Marussi
2026-06-12 22:37 ` [PATCH v4 28/31] [RFC] docs: stlmfs: Document ARM SCMI Telemetry FS ABI Cristian Marussi
2026-06-13 5:30 ` Randy Dunlap
2026-06-12 22:37 ` [PATCH v4 29/31] firmware: arm_scmi: stlmfs: Add lazy population support Cristian Marussi
2026-06-12 22:38 ` [PATCH v4 30/31] fs/stlmfs: Document lazy mode and related mount option Cristian Marussi
2026-06-12 22:38 ` [PATCH v4 31/31] [RFC] tools/scmi: Add SCMI Telemetry testing tool Cristian Marussi
2026-06-13 5:35 ` [PATCH v4 00/31] Introduce SCMI Telemetry FS support Randy Dunlap
2026-06-17 12:58 ` Christian Brauner
2026-06-17 17:11 ` Cristian Marussi
2026-06-18 17:22 ` David Hildenbrand (Arm)
2026-06-18 17:27 ` David Hildenbrand (Arm)
2026-06-18 23:28 ` Cristian Marussi
2026-06-19 10:16 ` David Hildenbrand (Arm)
2026-06-19 12:51 ` Cristian Marussi
2026-06-22 12:20 ` David Hildenbrand (Arm)
2026-06-29 8:22 ` Christian Brauner
2026-07-03 13:18 ` Cristian Marussi [this message]
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=ake2wFSSxD2Dnvyr@pluto \
--to=cristian.marussi@arm.com \
--cc=arm-scmi@vger.kernel.org \
--cc=brauner@kernel.org \
--cc=d-gole@ti.com \
--cc=david@kernel.org \
--cc=elif.topuz@arm.com \
--cc=etienne.carriere@st.com \
--cc=f.fainelli@gmail.com \
--cc=james.quinlan@broadcom.com \
--cc=jic23@kernel.org \
--cc=kas@kernel.org \
--cc=kernel-team@meta.com \
--cc=leitao@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=michal.simek@amd.com \
--cc=peng.fan@oss.nxp.com \
--cc=philip.radford@arm.com \
--cc=puranjay@kernel.org \
--cc=souvik.chakravarty@arm.com \
--cc=sudeep.holla@kernel.org \
--cc=usama.arif@linux.dev \
--cc=vincent.guittot@linaro.org \
/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