On Fri, Mar 23, 2007 at 10:04:26AM +0800, Shaohua Li wrote: > On Fri, 2007-03-23 at 01:52 +0800, Andrew Morton wrote: > > > > It looks like the cpuidle patches are doing incorrect things > > with their kobject protocol. > Looks the goal to force kobject to be allocated dynamically is to > release the memory of the kobject. But in the cpuidle case, we don't > want to free the memory as it might be used soon. What do you mean "used soon"? Is this a time critical thing? > I saw a lot of similar staff too, like 'cpu_devices' in > arch/i386/kernel/topology.c. The point is that kobjects should be created dynamically as they can be referenced by different threads at different times, so you need to let it manage the reference counting logic for you. Don't create them statically, it's almost always wrong. Note, one valid use of static kobject is in struct bus_type and in some class definitions. So this should probably be fixed. thanks, greg k-h - To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html