All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] skb_free_datagram() doing something expensive ?
@ 2008-11-04 23:02 Eric Dumazet
  2008-11-04 23:41 ` David Miller
  2008-11-05  5:05 ` Eric Dumazet
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Dumazet @ 2008-11-04 23:02 UTC (permalink / raw)
  To: Linux Netdev List, Corey Minyard

Hi all

I noticed high contention on udp_memory_allocated on a typical VOIP application.

(Now that oprofile correctly runs on my machine :) )

I can see that skb_free_datagram() is :

void skb_free_datagram(struct sock *sk, struct sk_buff *skb)
{
        kfree_skb(skb);
        sk_mem_reclaim(sk);
}

So each time an UDP packet is received, we must touch udp_memory_allocated

Each time application reads a packet, we call sk_mem_reclaim() and touch again udp_memory_allocated.

Surely this cannot be correct ?

If this is correct, time is to resurrect a patch to make proto->memory_allocated a percpu_counter
or something to have a percpu reserve of say 64 or 128 pages to avoid cache line trashing...

tcp_memory_allocated do not have this problem, since tcp carefully calls sk_mem_reclaim(sk) only on
selected paths, not on fast path.

Thanks


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-11-05  9:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-04 23:02 [RFC] skb_free_datagram() doing something expensive ? Eric Dumazet
2008-11-04 23:41 ` David Miller
2008-11-05  5:05 ` Eric Dumazet
2008-11-05  9:38   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.