Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 May 2000 03:25:50 +0100 (BST)
From:      Nick Hibma <n_hibma@calcaphon.com>
To:        FreeBSD Arch Mailing List <arch@FreeBSD.ORG>
Subject:   kobj
Message-ID:  <Pine.BSF.4.20.0005122217010.73091-100000@localhost>

next in thread | raw e-mail | index | archive | help

I've had a bit of a browse through the kobj source code to see what
you'd done to the newbus stuff in order to separate the two.

One of my main issues with it is that kobj_compile_methods panics in low
memory situations. It should return an error code / NULL. It's not
necessarily fatal if an object can't be created. I consider kobj very
similar to malloc, except that it embeds a bit of functionality in the
allocated struct.

Second, two minor nits (or signs of brain damage on my side). You call
kobj_init twice in subr_bus.c:make_device.
And you call kobj_class_compile in subr_bus.c:root_bus_module_handler
explicitly and through kobj_init, implicitly.

One last thing: KOBJ_CACHE_SIZE is by default set to 256. I find that
rather large (1kb) considering the number of methods in use currently in
newbus (per file, possibly multiple MODULES):

15 ./dev/iicbus/iicsmb.c
16 ./i386/i386/nexus.c
18 ./dev/eisa/eisaconf.c
19 ./dev/mca/mca_bus.c
20 ./pccard/pccard_nbk.c
21 ./dev/pccard/pccard.c
22 ./dev/ata/ata-all.c
23 ./pci/pci.c
27 ./isa/isa_common.c
29 ./pci/pcisupport.c

I suggest something like 120 or less (less than a power of two to make
the object fit in an allocation of a power of 2.

Hope these comments are of any use.

Nick

--
n_hibma@webweaving.org
n_hibma@freebsd.org                                          USB project
http://www.etla.net/~n_hibma/







To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.20.0005122217010.73091-100000>