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:25:41 +0000 (17:25 -0700)
commitee5f04b7c29897d96b06ebb119ee131ea84183ec
treea1d959afba6391f94d54b9fa34c5490a4daf6235
parent8319bc815a8d5fa375a28c94dde208f2dec68c42
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