freebsd-nq/lib/libgeom
Alan Somers ab63da3564 Speed up geom_stats_resync in the presence of many devices
The old code had a O(n) loop, where n is the size of /dev/devstat.
Multiply that by another O(n) loop in devstat_mmap for a total of
O(n^2).

This change adds DIOCGMEDIASIZE support to /dev/devstat so userland can
quickly determine the right amount of memory to map, eliminating the
O(n) loop in userland.

This change decreases the time to run "gstat -bI0.001" with 16,384 md
devices from 29.7s to 4.2s.

Also, fix a memory leak first reported as PR 203097.

Sponsored by:	Axcient
Reviewed by:	mav, imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D28968
2021-03-02 18:33:45 -07:00
..
geom_ctl.c
geom_getxml.c
geom_stats.c Speed up geom_stats_resync in the presence of many devices 2021-03-02 18:33:45 -07:00
geom_util.c
geom_xml2tree.c
libgeom.3
libgeom.h
Makefile
Makefile.depend Update Makefile.depend files 2019-12-11 17:37:53 +00:00