On Thu, 2016-12-08 at 07:36 -0800, Rick Jones wrote: > On 12/08/2016 07:30 AM, Eric Dumazet wrote: > > On Thu, 2016-12-08 at 10:46 +0100, Jesper Dangaard Brouer wrote: > > > >> Hmmm... I'm not thrilled to have such heuristics, that change memory > >> behavior when half of the queue size (sk->sk_rcvbuf) is reached. > > > > Well, copybreak drivers do that unconditionally, even under no stress at > > all, you really should complain then. > > Isn't that behaviour based (in part?) on the observation/belief that it > is fewer cycles to copy the small packet into a small buffer than to > send the larger buffer up the stack and have to allocate and map a > replacement?
If properly done yes ;) Some drivers do a copybreak, but throw away the original page frag and reallocates a fresh one anyway. Like if you have a PAGE_SIZE=65536, it is split in ~32 frags, and drivers might not bother trying to reuse 1 frag.