Re: on static kobjects and double frees...

From: Arthur Jones
Date: Tue Jun 10 2008 - 17:39:41 EST


Hi Doug, ...

On Tue, Jun 10, 2008 at 02:14:30PM -0700, Doug Thompson wrote:
> [...]
> Arthur, thanks for tracking that down and reviewing it. All the memory controller kobjects are all
> dynamic. [...]

You're welcome, I learned a lot about kobjects
that I should have already known...

AFAICS, mc is not quite clean yet, though, as
mc_kset is static and I don't think that is right.
It does, however, look like less work than edac_pci_sysfs.c...

> [...] The edac PCI code needed to be refactored and it looks like you did it.

I only did the bare minimum, there's a lot of kobject
stuff in there that looks suspect to me, e.g.:

* the "pci" object should be a kset rather than a kobject?
* if the "pci" object is a kset, can the whole global list
thing in edac_pci just go away?
* do we really need the atomic_inc counter, wouldn't a mutex
be clearer?
* can we initialize "pci" at init time thereby removing the
need even for a mutex on the "pci" initializer? This does
change the sysfs semantics slightly, though, as the "pci"
object would no longer be created lazily. I'm not sure if
that's a problem.

and other minor things. It looks to me like it could
use a thorough scrubbing. The good news is that I don't
think the API would change much if at all. I can have a
closer look if you are interested...

Arthur
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/