[PATCH 2/5] powerpc: proc_device_tree remove and update functions

Benjamin Herrenschmidt benh at kernel.crashing.org
Thu Jan 12 09:43:20 EST 2006


On Wed, 2006-01-11 at 22:32 +0000, Arnd Bergmann wrote:
> On Wednesday 11 January 2006 21:50, Benjamin Herrenschmidt wrote:
> > I think we should move to a filesystem instead. It should be fairly
> > trivial (look at sun's openpromfs for example)
> 
> openpromfs predates most of libfs, which means it is a lot more
> complicated than necessary already, and it doesn't fit the powerpc
> representation of device_node very well.

Yeah, well, it was just an example ;) In fact, if you think it's too
complicated, then what is simple ? :) (openpromfs looks trivial enough).

One of the big thing we want is to stop eating loads of memory on
machines with gazillion nodes (typically big memory machines have
gazillion of /memory@* nodes) among others. We want dentries & inodes to
be created on the fly and purged automatically.

> It's probably easier to write a new libfs based file system for
> device nodes than to use the existing openpromfs. Once we have
> that, it could even be possible to move sparc over to use the
> new fs ;-)

Hehe.

> However, I still think the better solution would be to use sysfs
> instead. It is already pretty clever regarding memory allocation
> and easy to use. The /sys/firmware/ hierarchy actually is made
> for exactly this kind of scenario and it is currently unused on
> powerpc.
> The biggest advantage here would be that we can easily describe
> the relation between OF device nodes and the linux device tree
> by using sysfs_create_link().
> 
> Do you see any strong reason against using sysfs?

Yes, the fact that we have to allocate everything like we do for proc.
Also, a special file system can be mounted on /proc/device-tree so is
easily backward compatible with existing userland tools.

Ben.





More information about the Linuxppc64-dev mailing list