Re: Avoiding external fragmentation with a placement policy Version 12

David S. Miller
2005-06-05T19:53:50Z

From: Nick Piggin <nickpiggin@yahoo.com.au>
Date: Sat, 04 Jun 2005 12:15:46 +1000

> Herbert Xu wrote:
> > With Dave's latest super-TSO patch, TCP over loopback will only be
> > doing order-0 allocations in the common case. UDP and others may
> > still do large allocations but that logic is all localised in
> > ip_append_data.
> >
> > So if we wanted we could easily remove most large allocations over
> > the loopback device.
>
> I would be very interested to look into that. I would be
> willing to do benchmarks on a range of machines too if
> that would be of any use to you.

Even without the super-TSO patch, we never do larger than
PAGE_SIZE allocations for sendmsg() when the device is
scatter-gather capable (as indicated in netdev->flags).

Loopback does set this bit.

This PAGE_SIZE limit comes from net/ipv4/tcp.c:select_size().