On Thu, Sep 27, 2007 at 04:35:07AM -0700, Tejun Heo wrote:
Same here, I'm swamped with stuff, and now am on vacation for a few
days...
Yes, it was done so that we could have /sys/block for block devices. Al
Viro did that work.
Yes, those are two functions, I can agree with.
I agree. Your work in this area has been great and helped out a lot.
Yes, but a kobject is still needed internally for the lifespan
management.
Possibly, I'm still not sold on this.
Heh, that's a good analogy :)
No. I think you are missing a number of things that kobjects provide
and allow:
- a structurual heirachy of devices. Combine kobjects with
ksets and ktypes, and you have a very powerful system to
categorize objects and their representation to each other.
- a consistant and easy interface to userspace through
uevents/hotplug of the creation and removal of these objects.
This keeps the different parts of the kernel that need this
interface from having to create it every time on their own.
- a way to easily create and export attributes in sysfs
automatically.
- a way to provide working reference counting for a variety of
different objects.
All of those are still needed for the kernel.
I don't mind the removal of kobjects from sysfs in order to make sysfs
and kobjects work better/simpler. However the majority of the patches
you created to do this end up with more code overall, and are of no
benifit to the current users of sysfs and kobjects in the kernel.
But what would that benifit the driver model?
I will not deny that the current use of kobjects/ksets/ktypes (subsystem
is now gone) is difficult and extreemly painful. I am currently working
to fix this issue. But don't think that the reason this is hard to use
means that it should be abolished alltogether.
Rather, it means that this interface to using kobjects needs to be fixed
and made easier, not circumvented.
No, I think that we have been lucky so far that it is so hard to get
sysfs representation working properly for "raw" kobjects. It has made
people really think why they want to add things there, and usually just
give up and go and put things into the proper place in the /sys/devices/
tree.
Also, not everything that people keep wanting to put in /sys should go
there. The perfict example of that is the recent BDI stuff. It belongs
in the driver tree, not in a new /sys/bdi/ location. If sysfs were
"easier" to use, then it would be abused this way.
The end goal for sysfs is to present a heirachy of devices that are in
the kernel today. It is not a replacement for everything that people
feel they need to export to userspace in whatever form they want to.
There are rules that need to be followed in the exportation of data, as
userspace programs expect this. The current kobject interface tries
very hard to enforce those rules, and it needs to stay combined with
sysfs that way.
No, I don't think that is necessary as the driver model kind of enforces
that already today.
That might be a good idea to implement today :)
I strongly object here.
I think that if your current patches are accepted, we will see a lot of
new users of sysfs in ways that are not "standard" to how it is used
today. Things that rely on "close" happening to the sysfs file, or
trees created that do not emit uevents.
A good example for why we need to keep things the same way today is the
SLUB code. It exports data through sysfs and automatically started
exporting things through uevents. People realized this and can now
easily write tools that watch for those events to show things happening
in the slab allocator.
I don't object to a clean up. What I object to is the use by other code
of sysfs by not using kobjects. I feel that if you really want to do
that, then go write a new filesystem for that kind of thing. We have
already done this with debugfs and securityfs. I really want to enforce
the kobject interface to the users of sysfs.
Now if we can keep that enforcement of sysfs, then I have no objections
to cleaning up the internal interface between sysfs and kobjects, and
the overall fixing of the kobject/kset/ktype code. That is all good
things overall.
The driver model never shows kobjects to users. Ok, in places it does
sneak through, but I'll be glad to take patches to fix that up wherever
needed.
I'm all for helping the driver model and adding new features to it.
Just don't take away the enforcement of kobjects and sysfs at the same
time please.
thanks,
greg k-h
-