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)
Feb 20 2024, 10:00 AM
Unknown Object (File)
Feb 18 2024, 8:29 AM
Unknown Object (File)
Feb 10 2024, 10:23 PM
Unknown Object (File)
Feb 8 2024, 10:23 PM
Unknown Object (File)
Dec 23 2023, 12:42 AM
Unknown Object (File)
Dec 13 2023, 2:30 AM
Unknown Object (File)
Dec 10 2023, 3:36 PM
Unknown Object (File)
Dec 10 2023, 12:35 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.