Page MenuHomeFreeBSD

Introduce m_get3()
ClosedPublic

Authored by kp on Aug 7 2021, 8:05 PM.
Tags
None
Referenced Files
F106168069: D31455.id93873.diff
Thu, Dec 26, 12:26 PM
Unknown Object (File)
Mon, Dec 16, 11:16 AM
Unknown Object (File)
Fri, Dec 13, 11:45 PM
Unknown Object (File)
Fri, Dec 6, 10:07 PM
Unknown Object (File)
Wed, Dec 4, 3:56 PM
Unknown Object (File)
Nov 23 2024, 6:38 AM
Unknown Object (File)
Nov 22 2024, 5:20 AM
Unknown Object (File)
Nov 21 2024, 11:10 AM

Details

Summary

Introduce m_get3() which is similar to m_get2(), but can allocate up to
MJUM16BYTES bytes (m_get2() can only allocate up to MJUMPAGESIZE).

This simplifies the bpf improvement in f13da24715.

Suggested by: glebius

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 41091
Build 37980: arc lint + arc unit

Event Timeline

kp requested review of this revision.Aug 7 2021, 8:05 PM

Q: why can’t we extend m_get2 to not fail for 9..16k packets?

Please do not introduce new usages of mbuf clusters > PAGE_SIZE into
the network stack. When under memory pressure attempting to
allocating >PAGE_SIZE clusters will DoS the whole system if done at
the packet rates seen on modern networks.

Please do not introduce new usages of mbuf clusters > PAGE_SIZE into
the network stack. When under memory pressure attempting to
allocating >PAGE_SIZE clusters will DoS the whole system if done at
the packet rates seen on modern networks.

This particular use case (in f13da24715a7) is for bpf, so not directly in the data path, and it shouldn't be allocating millions of times per second. I suppose that does form a good argument for not extending m_get2() rather than having an m_get3() (or keeping the current bpf approach of m_get2()/m_getjcl()).

glebius added a subscriber: glebius.
glebius added inline comments.
sys/kern/kern_mbuf.c
1388

Can we short circuit beginning of the function to m_get2()?

if (size <= MJUMPAGESIZE)

return (m_get2(size, how, type, flags);
1412

Should be updated to m_free_raw(m) after the recent changes.

This revision is now accepted and ready to land.Aug 16 2021, 4:45 PM
This revision now requires review to proceed.Aug 17 2021, 7:09 AM
This revision is now accepted and ready to land.Aug 17 2021, 5:19 PM
This revision was automatically updated to reflect the committed changes.