https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253877
Bug ID: 253877
Summary: [libgeom] O(n^2) behavior in geom_stats_resync
Product: Base System
Version: CURRENT
Hardware: Any
OS: Any
Status: New
Severity: Affects Many People
Priority: ---
Component: bin
Assignee: [email protected]
Reporter: [email protected]
geom_stats_resync tries to mmap all of /dev/devstat. But without knowing that
device's size, it simply tries to mmap successively larger amounts of memory
until it fails. That means that the entire operation has O(n^2) syscalls,
where n is related to the number of geom providers. On a system with a few
thousand providers, running "mdconfig -l" can take several minutes.
void
geom_stats_resync(void)
{
void *p;
if (statsfd == -1)
return;
for (;;) {
p = mmap(statp, (npages + 1) * pagesize,
PROT_READ, MAP_SHARED, statsfd, 0);
if (p == MAP_FAILED)
break;
else
statp = p;
npages++;
}
}
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"