linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luck, Tony" <tony.luck@intel.com>
To: Borislav Petkov <bp@alien8.de>
Cc: "x86@kernel.org" <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v2] RAS: Fix the trace_show() function to output trace_count
Date: Mon, 17 Oct 2022 16:09:23 +0000	[thread overview]
Message-ID: <SJ1PR11MB60835DDCB1F3EBC8B6DFA2F7FC299@SJ1PR11MB6083.namprd11.prod.outlook.com> (raw)
In-Reply-To: <Y00wIFEN9h9YPGe1@zn.tnic>

> 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



  reply	other threads:[~2022-10-17 16:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-05 16:16 [PATCH] RAS: Fix the trace_show() function to output trace_count Tony Luck
2022-10-05 18:17 ` Borislav Petkov
2022-10-05 19:46   ` [PATCH v2] " Tony Luck
2022-10-17 10:36     ` Borislav Petkov
2022-10-17 16:09       ` Luck, Tony [this message]
2022-10-17 19:40         ` Borislav Petkov
2022-10-18 14:36           ` Tony Luck
2022-10-18 16:05             ` Borislav Petkov
2022-10-18 16:59             ` [PATCH v3] RAS: Fix return value from show_trace() Tony Luck
2022-10-31 18:15               ` [tip: ras/core] " tip-bot2 for Tony Luck

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=SJ1PR11MB60835DDCB1F3EBC8B6DFA2F7FC299@SJ1PR11MB6083.namprd11.prod.outlook.com \
    --to=tony.luck@intel.com \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.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;
as well as URLs for NNTP newsgroup(s).