From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2454A3890F1; Thu, 9 Jul 2026 14:31:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783607474; cv=none; b=PHR3JJz6wfZxjbQcwJqmU7D+LEIRlbEqyjZh+Ims+EK+3DOv+G1gyHYitKuiOETCfHqRzZ9YGGhBXSD/D1f1lcg5yC4Q0HkO73mLyGjQaBmAjPjsL0rnnZiWOhTc3utRu8rM3jYCfIQOkkgGfUH/XuGP1PmMlUSdUn9hYaC1N3M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783607474; c=relaxed/simple; bh=tYRSRMOCoDr5c8AaPlCzkJaf9wYXXNmgZB1EM01BYX0=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=C5CRqeT3gezjoYjDL0yxfhnd3Ic2AvBEFraizBiiVOVv1zZQ0YwtxkGcAOnDbLvM8eY3RBhY6z1bWO40kc79jB3M2yhdq/YZESszjG7jmzFDBIx4NyN4/iB2KOokHkKwfjhddzZFZ8jbXmiasJ3TV3ZTA+X8vf5REye4l2U9LLA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=mW+cA96R; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=XNNwECeY; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="mW+cA96R"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="XNNwECeY" Date: Thu, 9 Jul 2026 16:31:08 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1783607470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=TS8BEtvMQvtLnB6vfkWXPH4LOaVjs2BDj91GOA4OgVE=; b=mW+cA96RmxeGTEehWDU8SyxfkrIbx+4kKTfErwftKzdlJPFTPDYaY9Dq/PXN/CaklgWmAI 6mxsuxy3x9Ol6Bn8TJQlODW0htTI2WRG+ss+iQ/iTa3+dz0rQBQNZ/qlHvYGraJFAj9Fyq CgCAiXYZ/hzruMIoatV18Juw00JH0G+B/tm/zLTz46J8Dn+bix+q4ahFQdBWT8a09B1jc3 7esakF7I7Sn4lPC9iRIWnk5jqJUHmF6H+LNmyYFkYeTCLMGgwQtJECO/hyD/NjeaP7kaYe boEiKaVTSOoCT2qtNmbo9raX03lAOlZb79nlcfFrYHTdR+ukg5+G2zyxMKT0iw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1783607470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=TS8BEtvMQvtLnB6vfkWXPH4LOaVjs2BDj91GOA4OgVE=; b=XNNwECeYc1MIAYyh6X9dBtiS5yNzABLsSfq9sA4ZLkMC2bGNLOtXKV6+mhEDjymCEGmXzl bTVZNwZpawljt0DA== From: Sebastian Andrzej Siewior To: driver-core@lists.linux.dev, linux-rt-devel@lists.linux.dev, linux-rt-users@vger.kernel.org Cc: "Rafael J. Wysocki" , Arnd Bergmann , Clark Williams , Danilo Krummrich , Greg Kroah-Hartman , Peter Zijlstra , Steven Rostedt , Thomas Gleixner Subject: [RFC PATCH] sysfs: Add /sys/kernel/realtime entry Message-ID: <20260709143108.UYeCUUcd@linutronix.de> Precedence: bulk X-Mailing-List: driver-core@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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 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 Signed-off-by: Peter Zijlstra Signed-off-by: Thomas Gleixner --- 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