nuta / resea

A microkernel-based hackable operating system.
Other
519 stars 28 forks source link

Too many mbuf allocations #7

Open ghost opened 4 years ago

ghost commented 4 years ago

There are too many allocs and frees for simple network operations. This could become a problem for performance.

[e1000] received 60 bytes [tcpip] mbuf_alloc() [tcpip] tcp: port=80, seq=00186a01, ack=00000000, len=0 [ SYN ] [tcpip] tcp: new client (port=80) [tcpip] mbuf_alloc() [tcpip] mbuf_alloc() [tcpip] mbuf_alloc() [tcpip] mbuf_alloc() [tcpip] mbuf_alloc() [tcpip] mbuf_alloc() [tcpip] mbuf_delete_one() [tcpip] mbuf_delete_one() [e1000] sent 42 bytes [e1000] received 64 bytes [tcpip] mbuf_alloc() [tcpip] mbuf_alloc() [tcpip] mbuf_delete_one() [tcpip] mbuf_delete_one() [tcpip] mbuf_delete_one() [tcpip] mbuf_delete_one() [e1000] sent 54 bytes [e1000] received 60 bytes [tcpip] mbuf_alloc() [tcpip] tcp: port=80, seq=00186a02, ack=00000001, len=0 [ [e1000] received 195 bytes ACK ] [tcpip] mbuf_alloc() [tcpip] mbuf_alloc() [tcpip] mbuf_delete_one() [tcpip] mbuf_delete_one() [tcpip] mbuf_alloc() [tcpip] mbuf_alloc() [tcpip] mbuf_delete_one() [tcpip] mbuf_delete_one() [tcpip] mbuf_alloc() [tcpip] mbuf_alloc() [tcpip] mbuf_delete_one() [tcpip] mbuf_delete_one() [tcpip] mbuf_alloc() [tcpip] mbuf_alloc() [tcpip] mbuf_delete_one() [tcpip] mbuf_delete_one() [tcpip] mbuf_alloc() [tcpip] tcp: port=80, seq=00186a02, ack=00000001, len=141 [ ACK ] [tcpip] tcp: received 141 bytes (seq=186a02) [tcpip] mbuf_alloc() [tcpip] mbuf_alloc() [tcpip] mbuf_alloc() [tcpip] mbuf_alloc() [tcpip] mbuf_alloc() [tcpip] mbuf_delete_one() [tcpip] mbuf_delete_one() [tcpip] mbuf_delete_one() [tcpip] mbuf_delete_one() [tcpip] mbuf_delete_one() [e1000] sent 54 bytes [webapi] new data

nuta commented 4 years ago

It sounds like a "premature optimization". I do think reducing number of allocations is a good idea but we're not in that phase yet.

ghost commented 4 years ago

I know this is not urgent, I'm just saying it's something you will have to think about.