From: Heiko Carstens <hca@linux.ibm.com>
To: Frederic Weisbecker <frederic@kernel.org>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org
Subject: [RFC PATCH 3/3] s390/idle: Remove idle time and count sysfs files
Date: Wed, 25 Feb 2026 15:51:46 +0100 [thread overview]
Message-ID: <20260225145146.1031705-4-hca@linux.ibm.com> (raw)
In-Reply-To: <20260225145146.1031705-1-hca@linux.ibm.com>
Remove the s390 specific idle_time_us and idle_count per-cpu sysfs
files. They do not provide an additional value. The risk that there are
existing applications which rely on these architecture specific files
should be very low.
However if it turns out such applications exist, this can be easily
reverted.
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
---
arch/s390/include/asm/idle.h | 4 ----
arch/s390/kernel/idle.c | 20 +-------------------
arch/s390/kernel/smp.c | 32 +-------------------------------
3 files changed, 2 insertions(+), 54 deletions(-)
diff --git a/arch/s390/include/asm/idle.h b/arch/s390/include/asm/idle.h
index dc04d63b6187..f0f3d38ef648 100644
--- a/arch/s390/include/asm/idle.h
+++ b/arch/s390/include/asm/idle.h
@@ -10,7 +10,6 @@
#include <linux/percpu-defs.h>
#include <linux/types.h>
-#include <linux/device.h>
#include <asm/tod_types.h>
struct s390_idle_data {
@@ -26,9 +25,6 @@ struct s390_idle_data {
DECLARE_PER_CPU(struct s390_idle_data, s390_idle);
-extern struct device_attribute dev_attr_idle_count;
-extern struct device_attribute dev_attr_idle_time_us;
-
void psw_idle(struct s390_idle_data *data, unsigned long psw_mask);
#endif /* _S390_IDLE_H */
diff --git a/arch/s390/kernel/idle.c b/arch/s390/kernel/idle.c
index ceb95c0d22eb..db120ef810ac 100644
--- a/arch/s390/kernel/idle.c
+++ b/arch/s390/kernel/idle.c
@@ -81,7 +81,7 @@ static u64 arch_cpu_in_idle_time(int cpu)
idle_time = now.tod - idle->clock_idle_enter.tod;
smp_mb();
} while (__atomic_read(&idle->sequence) != seq);
- return tod_to_ns(idle_time);
+ return cputime_to_nsecs(idle_time);
}
static u64 arch_cpu_idle_time(int cpu, enum cpu_usage_stat idx, bool compute_delta)
@@ -133,24 +133,6 @@ void noinstr arch_cpu_idle(void)
__load_psw_mask(psw_mask);
}
-static ssize_t show_idle_count(struct device *dev,
- struct device_attribute *attr, char *buf)
-{
- struct s390_idle_data *idle = &per_cpu(s390_idle, dev->id);
-
- return sysfs_emit(buf, "%lu\n", READ_ONCE(idle->idle_count));
-}
-DEVICE_ATTR(idle_count, 0444, show_idle_count, NULL);
-
-static ssize_t show_idle_time(struct device *dev,
- struct device_attribute *attr, char *buf)
-{
- struct s390_idle_data *idle = &per_cpu(s390_idle, dev->id);
-
- return sysfs_emit(buf, "%lu\n", READ_ONCE(idle->idle_time) >> 12);
-}
-DEVICE_ATTR(idle_time_us, 0444, show_idle_time, NULL);
-
void arch_cpu_idle_enter(void)
{
}
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 439eab2fb67a..64f0a5617e86 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -1086,31 +1086,6 @@ static struct attribute_group cpu_common_attr_group = {
.attrs = cpu_common_attrs,
};
-static struct attribute *cpu_online_attrs[] = {
- &dev_attr_idle_count.attr,
- &dev_attr_idle_time_us.attr,
- NULL,
-};
-
-static struct attribute_group cpu_online_attr_group = {
- .attrs = cpu_online_attrs,
-};
-
-static int smp_cpu_online(unsigned int cpu)
-{
- struct cpu *c = per_cpu_ptr(&cpu_devices, cpu);
-
- return sysfs_create_group(&c->dev.kobj, &cpu_online_attr_group);
-}
-
-static int smp_cpu_pre_down(unsigned int cpu)
-{
- struct cpu *c = per_cpu_ptr(&cpu_devices, cpu);
-
- sysfs_remove_group(&c->dev.kobj, &cpu_online_attr_group);
- return 0;
-}
-
bool arch_cpu_is_hotpluggable(int cpu)
{
return !!cpu;
@@ -1176,18 +1151,13 @@ static DEVICE_ATTR_WO(rescan);
static int __init s390_smp_init(void)
{
struct device *dev_root;
- int rc;
+ int rc = 0;
dev_root = bus_get_dev_root(&cpu_subsys);
if (dev_root) {
rc = device_create_file(dev_root, &dev_attr_rescan);
put_device(dev_root);
- if (rc)
- return rc;
}
- rc = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "s390/smp:online",
- smp_cpu_online, smp_cpu_pre_down);
- rc = rc <= 0 ? rc : 0;
return rc;
}
subsys_initcall(s390_smp_init);
--
2.51.0
next prev parent reply other threads:[~2026-02-25 14:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 14:51 [RFC PATCH 0/3] s390: Idle time accounting improvements Heiko Carstens
2026-02-25 14:51 ` [RFC PATCH 1/3] fixup! s390/time: Prepare to stop elapsing in dynticks-idle Heiko Carstens
2026-03-11 15:14 ` Frederic Weisbecker
2026-02-25 14:51 ` [RFC PATCH 2/3] s390/idle: Provide arch specific kcpustat_field_idle()/kcpustat_field_iowait() Heiko Carstens
2026-03-11 16:13 ` Frederic Weisbecker
2026-03-20 12:30 ` Heiko Carstens
2026-02-25 14:51 ` Heiko Carstens [this message]
2026-03-11 16:14 ` [RFC PATCH 3/3] s390/idle: Remove idle time and count sysfs files Frederic Weisbecker
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=20260225145146.1031705-4-hca@linux.ibm.com \
--to=hca@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=frederic@kernel.org \
--cc=gor@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=svens@linux.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox