Page MenuHomeFreeBSD

GEOM: Introduce partial confxml API
ClosedPublic

Authored by mav on Mar 11 2022, 2:24 AM.
Tags
None
Referenced Files
F103010920: D34529.diff
Tue, Nov 19, 7:24 PM
Unknown Object (File)
Mon, Nov 18, 12:36 PM
Unknown Object (File)
Tue, Nov 5, 1:16 PM
Unknown Object (File)
Oct 18 2024, 7:21 AM
Unknown Object (File)
Oct 13 2024, 11:51 PM
Unknown Object (File)
Oct 4 2024, 7:21 PM
Unknown Object (File)
Oct 3 2024, 10:40 AM
Unknown Object (File)
Sep 26 2024, 10:57 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 Skipped
Unit
Tests Skipped

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.