From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: driver-core@lists.linux.dev, linux-rt-devel@lists.linux.dev,
linux-rt-users@vger.kernel.org
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Arnd Bergmann <arnd@arndb.de>,
Clark Williams <williams@redhat.com>,
Danilo Krummrich <dakr@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Peter Zijlstra <peterz@infradead.org>,
Steven Rostedt <rostedt@goodmis.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: [RFC PATCH] sysfs: Add /sys/kernel/realtime entry
Date: Thu, 9 Jul 2026 16:31:08 +0200 [thread overview]
Message-ID: <20260709143108.UYeCUUcd@linutronix.de> (raw)
Hi,
The following patch sat in the RT queue for almost 15years now. I can't
find its origin on the list.
All it does is adding /sys/kernel/realtime once PREEMPT_RT is enabled
and returns 1.
Is this something that is still wanted and considered useful?
Is this something that can be expressed better by other means?
There was an in person discussion about this and it was suggested to add
/sys/kernel/realtime as a folder and having individual realtime features
as files. I don't remember a single feature that would quality for this
today but who knows. This is all I remember so far.
Now. Discussion go!
---------------------8>-------------------------
From: Clark Williams <williams@redhat.com>
Date: Sat, 30 Jul 2011 21:55:53 -0500
Add a /sys/kernel entry to indicate that the kernel is a
realtime kernel.
Clark says that he needs this for udev rules, udev needs to evaluate
if its a PREEMPT_RT kernel a few thousand times and parsing uname
output is too slow or so.
Are there better solutions? Should it exist and return 0 on !-rt?
Signed-off-by: Clark Williams <williams@redhat.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/ksysfs.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c
index f45ade718054a..670a7a57d7b23 100644
--- a/kernel/ksysfs.c
+++ b/kernel/ksysfs.c
@@ -133,6 +133,15 @@ KERNEL_ATTR_RO(vmcoreinfo);
#endif /* CONFIG_VMCORE_INFO */
+#if defined(CONFIG_PREEMPT_RT)
+static ssize_t realtime_show(struct kobject *kobj,
+ struct kobj_attribute *attr, char *buf)
+{
+ return sprintf(buf, "%d\n", 1);
+}
+KERNEL_ATTR_RO(realtime);
+#endif
+
/* whether file capabilities are enabled */
static ssize_t fscaps_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
@@ -206,6 +215,9 @@ static struct attribute * kernel_attrs[] = {
#ifndef CONFIG_TINY_RCU
&rcu_expedited_attr.attr,
&rcu_normal_attr.attr,
+#endif
+#ifdef CONFIG_PREEMPT_RT
+ &realtime_attr.attr,
#endif
NULL
};
--
2.53.0
next reply other threads:[~2026-07-09 14:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 14:31 Sebastian Andrzej Siewior [this message]
2026-07-09 14:38 ` [RFC PATCH] sysfs: Add /sys/kernel/realtime entry 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
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=20260709143108.UYeCUUcd@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=arnd@arndb.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 \
--cc=williams@redhat.com \
/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.