Search Linux Wireless

Re: Linux 2.6.24-rc7

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Sat, 26 Jan 2008, David Miller wrote:
>
> The socket gets charged for a full MTU's amount of memory instead
> of something more on the order of 100 bytes :-)
> 
> In fact that is the original reason all of these things exists,
> it was just simple to extend it to handle alignment cases too.
> 
> Anyways, once we put the logic for unaligned handling into a
> centralized location the above can now evaluate to a constant,
> or default to the lower value of 100.

Wouldn't it be nice to just handle the MTU memory accounting issue at the 
network level too?

Make the rule simply be:

 - if the packet allocation is *much* bigger than the packet length 
   itself (eg 20-byte IP packet bytes in a 1536-byte allocation),
OR
 - if the packet data is badly aligned AND (packet is small and can be 
   just moved in place OR architecture requires alignment)

then copy the packet data into a new allocation (or preferably reuse the 
old allocation if the size is appropriate and you can tell from the 
refcount that nobody else has a pointer to it - I forget the exact rules 
for this all).

The fact that the new allocation would be aligned is obviously one of the 
benefits, but as you point out, it's not the only one.

			Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux