RE: [PATCH v2] RAS: Fix the trace_show() function to output trace_count

From: Luck, Tony
Date: Mon Oct 17 2022 - 12:11:15 EST


> Still misleading:
>
> $ cat /sys/kernel/debug/ras/daemon_active
> 1

Agreed. It needs user to interpret the answer. The filename would lead
them to think "1" means the daemon is active, but its actually just a count
of how many times the file is concurrently open (which includes the
"cat" process reading the file).


> I don't know, maybe we should teach RAS daemons to ->write() into that
> file their name and PID so that the trace_count counts *only* the RAS
> daemons not any reader...

Should have thought of this earlier ... changing user space semantics
is hard. Even with only one user, there is a long transition period where
new kernels are running with old rasdaemon and vice versa.

How about:

seq_printf(m, "%d\n", atomic_read(&trace_count) - 1);

with a comment that users reading the file only want to know if anyone
else has it open?

-Tony