Re: [RFC] Changes to the driver model class code.

From: Dmitry Torokhov
Date: Tue Mar 15 2005 - 22:43:46 EST


On Tuesday 15 March 2005 17:14, Greg KH wrote:
> > Ease-of-use, maybe. However, it also means
> > ease-of-getting-reference-counting-wrong. And reference counting trumps it
> > all :)
>
> It will not make the reference counting logic easier to get wrong, or
> easier to get right.  It totally takes it away from the user, and makes
> them implement it themselves if they so wish (like the USB HCD patch
> does.)

Exactly, _IF_ they wish. And as practice shows proper reference counting
is not the very first thing people are concerned about.

I see the the new class interface useful in the following scenario:

- We have a proper subsystem that already does proper refcounting and
one might not want to consolidate core reference counting with
subsystems as it is too invasive.

If you consider the following scenario I do not think we want to
encourage it:

- We have "bad" system and user says "ah, I'll just use the new model
so I don't have to think about lifetime rules at the moment, I don't
have time/have something more interesting to do/I'll do that later
when I have time".

There is a third scenario:

- We have a completely new system or a system undergoing overhaul: the
coder tries to do it right and does consider all lifetime rules and
makes sure that all objects are properly accounted for. In this case
old interface is much more clear and easier to use than the new one.

I also not quite sure why a bus with its devices and drivers can be
implemented correctly (I believe we have a bunch of them now - PCI, USB,
serio, gameport) but class interface cannot be tamed?

--
Dmitry
-
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/