[patch 33/38] Processor degradation notification.

[patch 33/38] Processor degradation notification.

Post by Martin Sch » Sat, 28 Apr 2007 23:20:22


rom: Heiko Carstens < XXXX@XXXXX.COM >

Generate uevents for all cpus if cpu capability changes. This can
happen e.g. because the cpus are overheating. The cpu capability can
be read via /sys/devices/system/cpu/cpuN/capability.

Signed-off-by: Martin Schwidefsky < XXXX@XXXXX.COM >
Signed-off-by: Heiko Carstens < XXXX@XXXXX.COM >
---

arch/s390/kernel/smp.c | 48 ++++++++++++++++++++++---
drivers/s390/char/Makefile | 2 -
drivers/s390/char/sclp.h | 2 +
drivers/s390/char/sclp_config.c | 75 ++++++++++++++++++++++++++++++++++++++++
drivers/s390/sysinfo.c | 18 +++++++++
include/asm-s390/processor.h | 1
6 files changed, 140 insertions(+), 6 deletions(-)

Index: quilt-2.6/arch/s390/kernel/smp.c
===================================================================
--- quilt-2.6.orig/arch/s390/kernel/smp.c 2007-04-27 16:04:59.000000000 +0200
+++ quilt-2.6/arch/s390/kernel/smp.c 2007-04-27 16:05:00.000000000 +0200
@@ -821,19 +821,57 @@

static DEFINE_PER_CPU(struct cpu, cpu_devices);

+static ssize_t show_capability(struct sys_device *dev, char *buf)
+{
+ unsigned int capability;
+ int rc;
+
+ rc = get_cpu_capability(&capability);
+ if (rc)
+ return rc;
+ return sprintf(buf, "%u\n", capability);
+}
+static SYSDEV_ATTR(capability, 0444, show_capability, NULL);
+
+static int __cpuinit smp_cpu_notify(struct notifier_block *self,
+ unsigned long action, void *hcpu)
+{
+ unsigned int cpu = (unsigned int)(long)hcpu;
+ struct cpu *c = &per_cpu(cpu_devices, cpu);
+ struct sys_device *s = &c->sysdev;
+
+ switch (action) {
+ case CPU_ONLINE:
+ if (sysdev_create_file(s, &attr_capability))
+ return NOTIFY_BAD;
+ break;
+ case CPU_DEAD:
+ sysdev_remove_file(s, &attr_capability);
+ break;
+ }
+ return NOTIFY_OK;
+}
+
+static struct notifier_block __cpuinitdata smp_cpu_nb = {
+ .notifier_call = smp_cpu_notify,
+};
+
static int __init topology_init(void)
{
int cpu;
- int ret;
+
+ register_cpu_notifier(&smp_cpu_nb);

for_each_possible_cpu(cpu) {
struct cpu *c = &per_cpu(cpu_devices, cpu);
+ struct sys_device *s = &c->sysdev;

c->hotpluggable = 1;
- ret = register_cpu(c, cpu);
- if (ret)
- printk(KERN_WARNING "topology_init: register_cpu %d "
- "failed (%d)\n", cpu, ret);
+ register_cpu(c, cpu);
+ if (!cpu_online(cpu))
+ continue;
+ s = &c->sysdev;
+ sysdev_create_file(s, &attr_capability);
}
return 0;
}
Index: quilt-2.6/drivers/s390/char/Makefile
===================================================================
--- quilt-2.6.orig/drivers/s390/char/Makefile 2007-04-27 16:04:59.000000000 +0200
+++ quilt-2.6/drivers/s390/char/Makefile 2007-04-27 16:05:00.000000000 +0200
@@ -3,7 +3,7 @@
#

obj-y += ctrlchar.o keyboard.o defkeymap.o sclp.o sclp_rw.o sclp_quiesce.o \
- sclp_info.o sclp_chp.o
+ sclp_info.o sclp_config.o sclp_chp.o

obj-$(CONFIG_TN3270) += raw3270.o
obj-$(CONFIG_TN3270_CONSOLE) += con3270.o
Index: quilt-2.6/drivers/s390/char/sclp_config.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ quilt-2.6/drivers/s390/char/sclp_config.c 2007-04-27 16:05:00.000000000 +0200
@@ -0,0 +1,75 @@
+/*
+ * drivers/s390/char/sclp_config.c
+ *
+ * Copyright IBM Corp. 2007
+ * Author(s): Heiko Carstens < XXXX@XXXXX.COM >
+ */
+
+#include
 
 
 

1. I have a 38 digit # and I want to subtract 27 thru 32 from 33 thru

2. [RFC PATCH 33/33] Add Xen virtual block device driver.


Hi,

as first general comment, I think that some of the memory allocation
GFP_ flags are possibly incorrect; I would expect several places to use
GFP_NOIO rather than GFP_KERNEL, to avoid recursion/deadlocks


like here..


and __GFP_NOFAIL is usually horrid; is this because error recovery was
an afterthought, or because it's physically impossible? In addition
__GFP_NOFAIL in a block device driver is... an interesting way to add
OOM deadlocks... have the VM guys looked into this yet?


hmm isn't this a duplication of the pr_debug() and dev_dbg()
infrastructure? Please don't reinvent new ones..




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/

3. [PATCH 33 of 33] IB/ipath - fix drift between WCs in user and kernel space

4. [PATCH 33 of 33] IB/ipath - fix drift between WCs in user and kernel space

5. [PATCH 33/33] x86_64: Make bzImage a valid 64bit elf executable.

6. [PATCH 33/33] nfs: do not warn on radix tree node allocation failures

7. [patch 33/33] Convert non-highmem kmap_atomic() to static inline function

8. [PATCH 33/33] KVM: MMU: add audit code to check mappings, etc are correct

9. [PATCH 33/33]Documentation/filesystems/affs.txt update web address.

10. [PATCH] [38/48] Suspend2 2.1.9.8 for 2.6.12: 614-plugins.patch

11. [patch 00/38] s390 patches for 2.6.22

12. [eCS SCAM] 38 True facts about eComStation Was FAQ: 38 DetrimentaleCS Facts

13. ufsboot: ufs/inetboot fail on ps2 33/50mhz processor boards with L2 cache

14. Auction: IBM PS/2 Processor Complex Card 486DX-33 FRU 64F0198 (Non-SOD)

15. [patch 00/33] m68k patches for 2.6.22