summaryrefslogtreecommitdiffstats
path: root/lib/libfetch/http.c
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2015-11-29 21:42:26 +0000
committermckusick <mckusick@FreeBSD.org>2015-11-29 21:42:26 +0000
commit6f0b4b3366b2f6b2fe1ba4c0f7f4ac0c2da3e8b7 (patch)
tree2cb4951f9f9f5a47db98e07789df09d3d089dde0 /lib/libfetch/http.c
parentcb4ab786a10727b3013ae5be67aadaf4cc10ca31 (diff)
downloadFreeBSD-src-6f0b4b3366b2f6b2fe1ba4c0f7f4ac0c2da3e8b7.zip
FreeBSD-src-6f0b4b3366b2f6b2fe1ba4c0f7f4ac0c2da3e8b7.tar.gz
As the kernel allocates and frees vnodes, it fully initializes them
on every allocation and fully releases them on every free. These are not trivial costs: it starts by zeroing a large structure then initializes a mutex, a lock manager lock, an rw lock, four lists, and six pointers. And looking at vfs.vnodes_created, these operations are being done millions of times an hour on a busy machine. As a performance optimization, this code update uses the uma_init and uma_fini routines to do these initializations and cleanups only as the vnodes enter and leave the vnode_zone. With this change the initializations are only done kern.maxvnodes times at system startup and then only rarely again. The frees are done only if the vnode_zone shrinks which never happens in practice. For those curious about the avoided work, look at the vnode_init() and vnode_fini() functions in kern/vfs_subr.c to see the code that has been removed from the main vnode allocation/free path. Reviewed by: kib Tested by: Peter Holm
Diffstat (limited to 'lib/libfetch/http.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud