datapath: Avoid system freeze due to ovs-flow-rehash softlockup.
authorPravin B Shelar <pshelar@nicira.com>
Thu, 24 May 2012 00:25:41 +0000 (17:25 -0700)
committerPravin B Shelar <pshelar@nicira.com>
Thu, 24 May 2012 00:45:39 +0000 (17:45 -0700)
commit256cd4d51df7e0a54edd050817d55257cef3e3f7
tree5aebbd6c0577e4c0cc538fdc5c248fcc9119e683
parent0e4b96b57c212c2799e6e5f0ba1b19ff1f3a37d3
datapath: Avoid system freeze due to ovs-flow-rehash softlockup.

OVS datapath does periodic flow table rehash which takes genl_lock
in workq context.
In some cases, like ports add or delete, genl_lock can cause softlockup
as vswitchd would take and succeed with genl_lock and rehash workq
would block on the lock. Eventually rehash will proceed, flow rehash
is low priority task so this is not problem for rehashing.
But it is blocking workq thread; some other workq item from other
kernel subsystem would be blocked and can cause system freeze.
To avoid workq blocking and system freeze, we can use OVS compat workq.
It runs in separate kernel thread thus does not block any non-ovs
deferred workq work item.

We will fix it by making genetlink lockless and having fine granular
locking in OVS.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath/linux/compat/include/linux/workqueue.h
datapath/linux/compat/workqueue.c