Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/kern



David Young <dyoung%pobox.com@localhost> wrote:
> > 
> > Your code had local a list of devices to G/C - it is redundant.
> 
> Now there is a global list, and there is still a local list of devices
> to garbage collect.  That is not more redundant?

No, because you had local lists all over the place.  There is a single point
where local list is used - config_alldevs_unlock_gc().  The whole point of
the change was to keep collection logic in a single point.

> 
> The names are no longer descriptive.  "Enter" and "exit" are vague.
> 

It is the name often used in other subsystems or interfaces, for example,
mutex_"enter/exit".  Anyway, if you know a better name - please use.

> You changed the previous behavior in two ways:
> 
> config_detach: used to collect the garbage it just created, in the
>     common case where no other thread was in the device tree.  Now it
>     does not.

True.  It can/should simply use config_devunlink() - will even save another
line of code.  :)  However, G/C should be re-structured to do all collection
at last unlock point (without doing anything at config_alldevs_lock() point).
This is what I initially suggested.

> 
> device_lookup: collects garbage where previously it did not.

It checks the device list, but does not perform any free.  See above about
last unlock point.

> Back the changes out, and let's discuss how to achieve your purposes
> with a smaller change.

If you want to revert and/or improve the current way (and I saw there was a
lot of space for improvements in subr_autoconf.c) - of course, please do that.
But I do not think previous spread of G/C is better than current single point.

-- 
Mindaugas


Home | Main Index | Thread Index | Old Index