Page MenuHomeFreeBSD

md: Get rid of the pbuf zone
ClosedPublic

Authored by markj on May 22 2023, 9:06 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 28, 6:11 PM
Unknown Object (File)
Mon, Oct 28, 6:10 PM
Unknown Object (File)
Mon, Oct 28, 6:09 PM
Unknown Object (File)
Mon, Oct 28, 6:09 PM
Unknown Object (File)
Oct 1 2024, 7:33 PM
Unknown Object (File)
Sep 28 2024, 3:29 PM
Unknown Object (File)
Sep 27 2024, 10:23 PM
Unknown Object (File)
Sep 2 2024, 6:52 AM
Subscribers

Details

Summary

The zone is used to provide KVA for mapping BIOs so that we can pass
buffers to VOP_READ and VOP_WRITE. Its use doesn't really make sense:
it is limited globally to nswbuf/10 allocations, so this might not work
well if a large number of vnode MDs are in use. Furthermore, all I/O to
a MD device is handled with a dedicated thread, so we might as well just
have one reserved block per softc.

I suspect we should go further and add VOPs which enable reading and
writing with unmapped buffers. But this step lets us get rid of some
unncessary pbuf pre-allocations, which is my current goal.

Diff Detail

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

Event Timeline

markj requested review of this revision.May 22 2023, 9:06 PM

The use of dedicated (sub)zone is reasonable for KVA-starved arches, where we do not want to waste 1MB of KVA per md. Instead KVA use was shared with other consumers.

This revision is now accepted and ready to land.May 23 2023, 1:39 AM
In D40215#915694, @kib wrote:

The use of dedicated (sub)zone is reasonable for KVA-starved arches, where we do not want to waste 1MB of KVA per md. Instead KVA use was shared with other consumers.

It should still be 128KB on KVA-starved arches?

At the moment pbuf_zsecond_create() preallocates pbufs, so the change in fact reduces wasted KVA (until one has many vnode md devices).

This revision was automatically updated to reflect the committed changes.