Page MenuHomeFreeBSD

Extend m_copyback() to support unmapped mbufs.
ClosedPublic

Authored by jhb on May 5 2021, 9:29 PM.
Tags
None
Referenced Files
F170716404: D30133.id.diff
Sun, Sep 6, 4:42 AM
F170652544: D30133.id89870.diff
Sat, Sep 5, 8:06 PM
F170652519: D30133.id89870.diff
Sat, Sep 5, 8:06 PM
F170639358: D30133.id.diff
Sat, Sep 5, 6:29 PM
Unknown Object (File)
Thu, Sep 3, 9:34 AM
Unknown Object (File)
Thu, Sep 3, 9:09 AM
Unknown Object (File)
Wed, Sep 2, 11:07 PM
Unknown Object (File)
Wed, Sep 2, 10:58 AM
Subscribers

Diff Detail

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

Event Timeline

markj added inline comments.
sys/kern/uipc_mbuf.c
1899

m_unmappeduiomove() or so might be a better name then. Not sure if it's worth the churn.

This revision is now accepted and ready to land.May 6 2021, 1:48 PM
gallatin added inline comments.
sys/kern/uipc_mbuf.c
1899

We also have m_copyfromunmapped(). We could add a m_unmappeduiomove(.. int direction) and make the existing functions wrappers..

sys/kern/uipc_mbuf.c
1899

m_copy{to,from}unmapped() are kind of wrappers already, they just construct different uio's to pass to this routine. In that regard they are similar to the physcopy{in,out} wrappers around uiomove_fromphys(). uiomove_fromphys() suffers similar naming issues (it copies to/from physical pages, not only from physical pages). This routine is also used by m_mbuftouio() which is where it gets is original name from. I don't mind renaming this. It isn't a lot of churn. The one use case outside of this file is in soreceive() where it is paired with uiomove(), so something in the uiomove_* namespace ala uiomove_fromphys() might not be a bad name for it.

sys/kern/uipc_mbuf.c
1899

I don't have strong feelings about it. The m_* namespace makes more sense to me for this routine, so I'm inclined to prefer m_unmapped_uiomove(), but uiomove_mbuf_unmapped() or so would be ok. The name uiomove_fromphys() has always bugged me for exactly the reason you point out.

sys/kern/uipc_mbuf.c
1899

I'll add a followup commit after this one that renames it to m_unmapped_uiomove().

This revision was automatically updated to reflect the committed changes.