From: Borislav Petkov <bp@alien8.de>
To: "Luck, Tony" <tony.luck@intel.com>
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 21:40:09 +0200 [thread overview]
Message-ID: <Y02vmRn1Uz6/NMFF@zn.tnic> (raw)
In-Reply-To: <SJ1PR11MB60835DDCB1F3EBC8B6DFA2F7FC299@SJ1PR11MB6083.namprd11.prod.outlook.com>
On Mon, Oct 17, 2022 at 04:09:23PM +0000, Luck, Tony wrote:
> 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).
Yap, exactly.
> Should have thought of this earlier ... changing user space semantics
> is hard.
AFAIR, at the time we cared only about there being at least one
consumer... thus the binary test, is there at least one or not:
if (!ras_userspace_consumers()) {
print_extlog_rcd(NULL, tmp, cpu);
goto out;
}
> 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?
Yeah, doesn't work either:
# tail -f /sys/kernel/debug/ras/daemon_active &
[1] 3019
1
tail: /sys/kernel/debug/ras/daemon_active: file truncated
1
# cat /sys/kernel/debug/ras/daemon_active
2
We really need something to say, "I really am a RAS events consumer and
not some random file opener."
OTOH, if one does that on ones system, then one has herself to blame
when errors don't get logged and disappear. I mean, why would one even
do that?!
Then again, I've seen weirder stuff so...
Question is, what is your goal with this?
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
next prev parent reply other threads:[~2022-10-17 19:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-05 16:16 [PATCH] " 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
2022-10-17 19:40 ` Borislav Petkov [this message]
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=Y02vmRn1Uz6/NMFF@zn.tnic \
--to=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.com \
--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
all inboxes | Powered by JetHome®