Re: [Just for fun] loopback: avoid softirq on most transmits
From: David Miller <davem@davemloft.net>
Date: 2010-10-28 20:08:53
From: Eric Dumazet <redacted> Date: Thu, 28 Oct 2010 21:48:46 +0200
With the introduction of xmit_recursion percpu variable, its pretty cheap to check our recursion level in loopback transmit, and avoid raising softirq. Signed-off-by: Eric Dumazet <redacted> --- tbench faster by 4%, sorry I couldnt resist...
Hehehe :-) Maybe even that limit is low enough to prevent stack overflow situations even when doing NFS over a loopback to a raid volume using XFS as the filesystem which seems to be the standard stack usage stress test. But really, just like DST iteration, we should probably make these things more iterative. The cool thing about loopback is that we have a trigger for the cases we care about, release_sock(). So we could have something like: 1) lock_sock() sets "local cpu will run release_sock()" mark. 2) netif_rx() checks mark, if set it puts SKB on "release_sock() local cpu work queue" 3) release_sock() retains mark, and runs SKB queue until empty. Once SKB work queue is empty, mark is cleared. Anyways, just an idea.