]> git.baikalelectronics.ru Git - kernel.git/commit
tun: do not put self in waitq if doing a nonblock read
authorAmos Kong <akong@redhat.com>
Thu, 9 Jun 2011 07:27:10 +0000 (00:27 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 9 Jun 2011 07:27:10 +0000 (00:27 -0700)
commited2423145132000af81afd22d5fe528df072e7d0
treee439d62aa7299ad6644b37b3e569ca3de8c0f60b
parent914a635e919d70efab18cf49ec29311596ac5a91
tun: do not put self in waitq if doing a nonblock read

Perf shows a relatively high rate (about 8%) race in
spin_lock_irqsave() when doing netperf between external host and
guest. It's mainly becuase the lock contention between the
tun_do_read() and tun_xmit_skb(), so this patch do not put self into
waitqueue to reduce this kind of race. After this patch, it drops to
4%.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Amos Kong <akong@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c