All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clark Williams <williams@redhat.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	driver-core@lists.linux.dev, linux-rt-devel@lists.linux.dev,
	linux-rt-users@vger.kernel.org,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Arnd Bergmann <arnd@arndb.de>, Danilo Krummrich <dakr@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [RFC PATCH] sysfs: Add /sys/kernel/realtime entry
Date: Thu, 9 Jul 2026 11:02:22 -0500	[thread overview]
Message-ID: <ak_GDsJS6kVoUM2f@lysander> (raw)
In-Reply-To: <20260709152214.rH1O_8SM@linutronix.de>

On Thu, Jul 09, 2026 at 05:22:14PM +0200, Sebastian Andrzej Siewior wrote:
> > But really, why is this needed?  Userspace shouldn't care, right?
> 
> So there is Clark who needed it 15y ago for some udev rules. Maybe he
> elaborate on that.
> 

Ugh, I've always been embarrassed about that patch. We added it because
in the dim dark past, something triggered udev many, many times and that
called a shell script which searched the 'uname -v' output for
PREEMPT_RT, meaning boot times slowed to a crawl. Instead we added 
/sys/kernel/realtime and it just became a stat(2) call to see if the
file existed. Pretty sure that was a RHEL6 kernel (2.6.32-ish) and I
suspect that the need for it is long gone. 

I'm hesitant to call for it's removal, because the only other way for
startup code that want's to know if it's on a realtime kernel is to look
for PREEMPT_RT in the 'uname -v' output. I know that the financials and
the telcos tune specifically for RT, pretty sure there are others. 

> There is custom "software" that is designed for realtime environment and
> if it is run on a regular kernel then it missed its timing requirements
> and the software goes usually in a fail state and people start debugging
> what has happen. If this happens often enough (booting a non-RT kernel)
> they tend to add a check so that the software complains early enough
> since checking the kernel is usually the last thing that is done.
> 
> This could work with the file (or folder) or by parsing uname output. I
> know of at least two individuals that switched to uname because the
> upstream RT does not have that file.
> 

Really? We always took the absence of that file to mean Not Realtime.

> cyclictest (from rt-tests) is using this file but only while collecting
> system information, nothing else.
> 	https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/tree/src/lib/rt-utils.c#n528

I'll ask around, but I'm betting RTLA checks for this as well. 

> 
> There is also sosreport
> 	https://github.com/sosreport/sos/blob/main/sos/report/plugins/kernelrt.py#L32
> 

Forgot about sosreport.

> using for information collection purpose.
> There is thermald
> 	https://github.com/intel/thermal_daemon/blob/master/src/thd_engine.cpp#L1065
> but this looks like just information gathering. That check looks wrong
> since there is a space instead of an underline in the check so this was
> not tested on a RT kernel.
> 
> > And checkpatch should complain about the sprintf(), should be
> > sysfs_emit().
> 
> Sure.

I can certainly fix that.

The question I have is, would a folder with RT-specific information be useful? 
Someone just wanting to know if they're on RT could still check for existance
if that's all they want to know, but I'm not really coming up with any
other information that would prove useful for someone tuning for an RT
workload. 

Is there a "better" way to indicate that the system is running a
PREEMPT_RT kernel?

Clark

-- 
The United States Coast Guard
Ruining Natural Selection since 1790

  reply	other threads:[~2026-07-09 16:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09 14:31 [RFC PATCH] sysfs: Add /sys/kernel/realtime entry Sebastian Andrzej Siewior
2026-07-09 14:38 ` sashiko-bot
2026-07-09 14:46 ` Greg Kroah-Hartman
2026-07-09 15:22   ` Sebastian Andrzej Siewior
2026-07-09 16:02     ` Clark Williams [this message]
2026-07-10  7:02       ` Sebastian Andrzej Siewior
2026-07-10  7:05       ` Tomas Glozar
2026-07-10  7:23     ` Florian Bezdeka
2026-07-10 15:51       ` Steven Rostedt
2026-07-10 15:57         ` Sebastian Andrzej Siewior
2026-07-10 16:01         ` Florian Bezdeka
2026-07-10 16:12           ` Steven Rostedt
2026-07-14 11:07           ` Sebastian Andrzej Siewior
2026-07-10 16:05         ` Greg Kroah-Hartman
2026-07-10 16:14           ` Steven Rostedt
2026-07-09 15:54   ` Steven Rostedt

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=ak_GDsJS6kVoUM2f@lysander \
    --to=williams@redhat.com \
    --cc=arnd@arndb.de \
    --cc=bigeasy@linutronix.de \
    --cc=dakr@kernel.org \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rafael@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.