Page MenuHomeFreeBSD

GEOM: Introduce partial confxml API
ClosedPublic

Authored by mav on Mar 11 2022, 2:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 7, 4:56 PM
Unknown Object (File)
Mar 11 2024, 6:06 PM
Unknown Object (File)
Mar 11 2024, 6:06 PM
Unknown Object (File)
Mar 11 2024, 6:06 PM
Unknown Object (File)
Mar 11 2024, 2:00 AM
Unknown Object (File)
Mar 8 2024, 3:10 AM
Unknown Object (File)
Feb 10 2024, 1:43 AM
Unknown Object (File)
Jan 4 2024, 3:39 PM
Subscribers
None

Details

Summary

Traditionally the GEOM's primary channel of information from kernel to user-space was confxml, fetched by libgeom through kern.geom.confxml sysctl. It is convenient and informative, representing full state of GEOM in a single XML document. But problems start to arise on systems with hundreds of disks, where the full confxml size reaches many megabytes, taking significant time to first write it and then parse.

This patch introduces alternative solution, allowing to fetch much smaller XML document, subset of the full confxml, limited to 64KB and representing only one specified geom and optionally its parents. It uses existing GEOM control interface, extended with new "getxml" verb. In case of any error, such as the buffer overflow, it just transparently falls back to traditional full confxml. This patch uses this API in few user-space GEOM tools where possible.

Test Plan

Manually tested affected geom and gpart sub-commands, confirming significant reduction in number of full confxml requests.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mav requested review of this revision.Mar 11 2022, 2:24 AM
mav created this revision.

Looks pretty good to me.
Just had a few nits to consider.

lib/geom/part/geom_part.c
471

why abort here, but errx elsewhere?

lib/libgeom/geom_getxml.c
59

Do you have any figures on what a typical request would be? My eyeball suggests in the 1-2k range for something complex...

sys/geom/geom_ctl.c
4

perhaps you should list this after the all rights reserved line below?

sys/geom/geom_dump.c
4

same here and any place else you added a copyright notice.

This revision is now accepted and ready to land.Mar 11 2022, 3:55 AM
lib/geom/part/geom_part.c
471

It is practically an assertion, since "nargs" == 1 is checked in gpart_issue(), and so arg0 must be present. And it was like that before me, I only moved it slightly.

lib/libgeom/geom_getxml.c
59

It is hard to speak about any averages here, but for simple PART with one partition on top of DISK I am getting 2.8KB.

sys/geom/geom_ctl.c
4

OK. Changed locally.

This revision was automatically updated to reflect the committed changes.