Page MenuHomeFreeBSD

Mbuf external storage improvements.
ClosedPublic

Authored by glebius on Oct 6 2017, 8:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 26 2024, 7:49 AM
Unknown Object (File)
Nov 26 2024, 7:48 AM
Unknown Object (File)
Nov 26 2024, 7:48 AM
Unknown Object (File)
Nov 26 2024, 7:26 AM
Unknown Object (File)
Nov 24 2024, 2:28 PM
Unknown Object (File)
Nov 22 2024, 8:39 PM
Unknown Object (File)
Nov 22 2024, 6:32 AM
Unknown Object (File)
Nov 21 2024, 4:54 PM

Details

Summary

Some improvements from Netflix. There is one performance optimization,
and a couple of prerequisites for future improvements (e.g. multi-page
mbufs).

o Shorten list of arguments to mbuf external storage freeing function.

All of these arguments are stored in m_ext, so there is no reason
to pass them in the argument list.  Not all functions need the second
argument, some don't even need the first one.  The second argument
lives in next cache line, so not dereferencing it is a performance
gain.  This was discovered in sendfile(2), which will be covered by
next commits.

The second goal of this commit is to bring even more flexibility
to m_ext mbufs, allowing to create more fields in m_ext, opaque to
the generic mbuf code, and potentially set and dereferenced by
subsystems.

o In mb_dupcl() don't copy full m_ext, to avoid cache misses.

If we always use the original mbuf when freeing external data, then
we don't need to copy second part of m_ext to shadow copies.

o Adopt sendfile(2) to shorted argument list of ext free function,

use regular ext_free mech for the sendfile(2) buffers.  Remove
sendfile knowledge from mbuf code.  Create function sendfile_free_page()
that later will be used for multi-page mbufs.  For now compiler will
inline it into sendfile_free_mext().

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Just from the proposed commit message this smells like it should be at least two or three individual changes and commits, e.g., mb_dupcl() sounds like it's a standalone change?

Yes, it will be. It is split in commits in my git repo.

It LGTM. I know sfbufs are quite different on i386, do you need anyone to do some basic tests there?

The change doesn't affect sfbufs at all.

What is LGTM?

gallatin added a subscriber: gallatin.

The change doesn't affect sfbufs at all.

What is LGTM?

LGTM is "Looks Good To Me"..

Which is what I think as well.

This revision is now accepted and ready to land.Oct 9 2017, 2:41 PM
This revision was automatically updated to reflect the committed changes.