Date: Wed, 30 Jul 2003 11:55:15 -0700 (PDT) From: Bosko Milekic <bmilekic@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/vm uma_core.c Message-ID: <200307301855.h6UItFgg063471@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
bmilekic 2003/07/30 11:55:15 PDT FreeBSD src repository Modified files: sys/vm uma_core.c Log: Plug a race and a leak in UMA. 1) The race has to do with zone destruction. From the zone destructor we would lock the zone, set the working set size to 0, then unlock the zone, drain it, and then free the structure. Within the window following the working-set-size set to 0 and unlocking of the zone and the point where in zone_drain we re-acquire the zone lock, the uma timer routine could have fired off and changed the working set size to something non-zero, thereby potentially preventing us from completely freeing slabs before destroying the zone (and thus leaking them). 2) The leak has to do with zone destruction as well. When destroying a zone we would take care to free all the buckets cached in the zone, but although we would drain the pcpu cache buckets, we would not free them. This resulted in leaking a couple of bucket structures (512 bytes each) per cpu on SMP during zone destruction. While I'm here, also silence GCC warnings by turning uma_slab_alloc() from inline to real function. It's too big to be an inline. Reviewed by: JeffR Revision Changes Path 1.69 +29 -13 src/sys/vm/uma_core.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200307301855.h6UItFgg063471>