]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
s390/idle: Remove idle time and count sysfs files
authorHeiko Carstens <hca@linux.ibm.com>
Wed, 13 May 2026 14:01:29 +0000 (16:01 +0200)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Mon, 15 Jun 2026 14:33:40 +0000 (16:33 +0200)
Remove the s390 specific idle_time_us and idle_count per cpu sysfs
files. They do not provide any 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>
Acked-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
arch/s390/include/asm/idle.h
arch/s390/kernel/idle.c
arch/s390/kernel/smp.c

index f3502d5621c05ed810bc9a21305b86ab744a4125..07819f11987cc843e511bfe64f59a661c6d38eca 100644 (file)
 
 #include <linux/percpu-defs.h>
 #include <linux/types.h>
-#include <linux/device.h>
 #include <asm/tod_types.h>
 
 struct s390_idle_data {
 #ifdef CONFIG_NO_HZ_COMMON
        bool          in_idle;
 #endif
-       unsigned long idle_count;
-       unsigned long idle_time;
        unsigned long timer_idle_enter;
        unsigned long mt_cycles_enter[8];
        union tod_clock clock_idle_enter;
@@ -27,7 +24,4 @@ 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;
-
 #endif /* _S390_IDLE_H */
index b5fae512fc9ca75df97ff6c09765b7ea85146ae5..7f7851c001e0ac40158319236baaa67a2a55ad65 100644 (file)
@@ -28,8 +28,6 @@ static __always_inline void __account_idle_time_irq(void)
        unsigned long idle_time;
 
        idle_time = idle->clock_idle_exit.tod - idle->clock_idle_enter.tod;
-       __atomic64_add(idle_time, &idle->idle_time);
-       __atomic64_add_const(1, &idle->idle_count);
        account_idle_time(cputime_to_nsecs(idle_time));
 }
 
@@ -144,24 +142,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)
 {
 }
index 50bb499cf3e508e62ee511e40b6e67c990f0b12f..0ba7f89b81611be95d00fac975ab2bd8f6d4298f 100644 (file)
@@ -54,7 +54,6 @@
 #include <asm/debug.h>
 #include <asm/os_info.h>
 #include <asm/sigp.h>
-#include <asm/idle.h>
 #include <asm/nmi.h>
 #include <asm/stacktrace.h>
 #include <asm/topology.h>
@@ -1085,31 +1084,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;
@@ -1175,18 +1149,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);