Messages in this thread | | | Date | Thu, 19 Jan 2012 20:38:20 +0100 | From | Ingo Molnar <> | Subject | Re: [PATCH] mce: fix warning messages about static struct mce_device |
| |
* Alan Stern <stern@rowland.harvard.edu> wrote:
> Or to put it another way, even though no code takes references > to these device structures (can you really guarantee that even > now?), [...]
That's a good question. Do these devices get exposed to user-space access via sysfs somehow, where such an extra reference could materialize?
> [...] how do you prevent references being taken in future > versions of the kernel? Calling memset while there still are > outstanding references very definitely _is_ a bug.
Unless there's a reference i missed the 'refcounting' here is very simple and does not exist at all.
IMHO you should not impose complexity and abstraction on code just because. Now i don't care much about the extra pointer, but the [NR_CPUS] array was doubly ugly (and Greg promised to fix that, so no problems from me).
So the conclusion is that the reasons stated here don't really apply. The one i mentioned *does* apply: the original bug was due to sloppy life time rules of this driver buffer, and that came back to bite us. Making it dynamic solves that kind of problem. In that sense the warning is fine too.
Thanks,
Ingo
| |