Oops in sched_mc_power_savings_store
I have no idea how you guys intended this to work, but here's the debugging work I've done so far.
[ 89.210171] Call Trace: [ 89.210182] [<c011c0b3>] ? sched_mc_power_savings_store+0x0/0x4a [ 89.210198] [<c02908c0>] ? sysdev_class_store+0x38/0x40 [ 89.210213] [<c01a0b51>] ? sysfs_write_file+0xb9/0xe4
sched_mc_power_savings_store isn't a class attribute, it's a plain attribute. So the prototypes are different. This is why we try to load from address 2 -- it's actually the length parameter.
I don't know how our typing system let this one through. I don't know if you want to fix this by adding an extra argument to the class_attribute show and store methods. I don't know if sched_mc_power_savings_store was intended to be a class attribute or not.
Signature · 4 lines
Intel are signing my paycheques ... these opinions are still mine "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step."
Quoted 9 lines · Matthew Wilcox
I have no idea how you guys intended this to work, but here's the debugging work I've done so far.
[ 89.210171] Call Trace: [ 89.210182] [<c011c0b3>] ? sched_mc_power_savings_store+0x0/0x4a [ 89.210198] [<c02908c0>] ? sysdev_class_store+0x38/0x40 [ 89.210213] [<c01a0b51>] ? sysfs_write_file+0xb9/0xe4
Quoted 8 lines
sched_mc_power_savings_storeisn't a class attribute, it's a plain attribute. So the prototypes are different. This is why we try to load from address 2 -- it's actually the length parameter.I don't know how our typing system let this one through. I don't know if you want to fix this by adding an extra argument to the
class_attributeshow and store methods. I don't know ifsched_mc_power_savings_storewas intended to be a class attribute or not.
Seems like a latent problem. The attributes were just declared wrong. Longer term we should probably add the sysdev attributes to the class too, but right now here's a minimal fix. Does it solve your problem? Thanks,
-Andi
---
commit a2ab909933f8c8623282979dfa64f3e358bdb9fc
Author: Andi Kleen <[email protected]> Date: Thu Jul 24 21:57:40 2008 +0200
Make scheduler sysfs attributes sysdev class devices
They are really class devices, but were incorrectly declared. This leads to crashes with the recent changes that makes non normal sysdevs use a different prototype.
kernel/sched.c +11 -11
@@ -7641,34 +7641,34 @@ static ssize_t sched_power_savings_store(const char *buf, size_t count, int smt) }#ifdef CONFIG_SCHED_MC -static ssize_t sched_mc_power_savings_show (struct sys_device *dev, -struct sysdev_attribute *attr,char *page) +static ssize_t sched_mc_power_savings_show (struct sysdev_class *class, +char *page) {return sprintf (page,"%u\n" , sched_mc_power_savings); } -static ssize_t sched_mc_power_savings_store (struct sys_device *dev, -struct sysdev_attribute *attr, +static ssize_t sched_mc_power_savings_store (struct sysdev_class *class,const char *buf,size_t count) {return sched_power_savings_store (buf, count,0 ); } -static SYSDEV_ATTR(sched_mc_power_savings, 0644, sched_mc_power_savings_show, - sched_mc_power_savings_store); +static SYSDEV_CLASS_ATTR(sched_mc_power_savings, 0644, + sched_mc_power_savings_show, + sched_mc_power_savings_store);#endif #ifdef CONFIG_SCHED_SMT -static ssize_t sched_smt_power_savings_show (struct sys_device *dev, -struct sysdev_attribute *attr,char *page) +static ssize_t sched_smt_power_savings_show (struct sysdev_class *dev, +char *page) {return sprintf (page,"%u\n" , sched_smt_power_savings); } -static ssize_t sched_smt_power_savings_store (struct sys_device *dev, -struct sysdev_attribute *attr, +static ssize_t sched_smt_power_savings_store (struct sysdev_class *dev,const char *buf,size_t count) {return sched_power_savings_store (buf, count,1 ); } -static SYSDEV_ATTR(sched_smt_power_savings, 0644, sched_smt_power_savings_show, +static SYSDEV_CLASS_ATTR(sched_smt_power_savings, 0644, + sched_smt_power_savings_show, sched_smt_power_savings_store);#endif
Quoted 3 lines · Andi Kleen
Seems like a latent problem. The attributes were just declared wrong. Longer term we should probably add the sysdev attributes to the class too, but right now here's a minimal fix. Does it solve your problem?
I got discnnected and made the equivalent changes myself. Yes, it fixes the problem. Thanks!
Signature · 4 lines
Intel are signing my paycheques ... these opinions are still mine "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step."