--- - branch: MAIN date: Tue Dec 15 03:02:25 UTC 2009 files: - new: '1.190' old: '1.189' path: src/sys/kern/subr_autoconf.c pathrev: src/sys/kern/subr_autoconf.c@1.190 type: modified - new: '1.128' old: '1.127' path: src/sys/sys/device.h pathrev: src/sys/sys/device.h@1.128 type: modified id: 20091215T030225Z.b4d7a2f220f3aa2696e520d2538b32832ffaa07b log: | Per rmind@'s suggestion, avoid an acquire/release-mutex dance by collecting garbage in two phases: in the first stage, with alldevs_mtx held, gather all of the objects to be freed onto a list. Drop alldevs_mtx, and in the second stage, free all the collected objects. Also per rmind@'s suggestion, remove KASSERT(!mutex_owned(&alldevs_mtx)) throughout, it is not useful. Find a free unit number and allocate it for a new device_t atomically. Before, two threads would sometimes find the same free unit number and race to allocate it. The loser panicked. Now there is no race. In support of the changes above, extract some new subroutines that are private to this module: config_unit_nextfree(), config_unit_alloc(), config_devfree(), config_dump_garbage(). Delete all of the #ifdef __BROKEN_CONFIG_UNIT_USAGE code. Only the sun3 port still depends on __BROKEN_CONFIG_UNIT_USAGE, it's not hard for the port to do without, and port-sun3@ had fair warning that it was going away (>1 week, or a few years' warning, depending how far back you look!). module: src subject: 'CVS commit: src/sys' unixtime: '1260846145' user: dyoung