Thread (1 message) 1 message, 1 author, 2014-03-27

Re: [PATCH net v2] openvswitch: fix a possible deadlock and lockdep warning

From: Jesse Gross <hidden>
Date: 2014-03-27 17:37:32

On Thu, Mar 27, 2014 at 10:33 AM, Flavio Leitner [off-list ref] wrote:
On Thu, Mar 27, 2014 at 10:19:23AM -0700, Pravin Shelar wrote:
quoted
On Thu, Mar 27, 2014 at 7:05 AM, Flavio Leitner [off-list ref] wrote:
quoted
There are two problematic situations.

A deadlock can happen when is_percpu is false because it can get
interrupted while holding the spinlock. Then it executes
ovs_flow_stats_update() in softirq context which tries to get
the same lock.

The second sitation is that when is_percpu is true, the code
correctly disables BH but only for the local CPU, so the
following can happen when locking the remote CPU without
disabling BH:

       CPU#0                            CPU#1
  ovs_flow_stats_get()
   stats_read()
 +->spin_lock remote CPU#1        ovs_flow_stats_get()
 |  <interrupted>                  stats_read()
 |  ...                       +-->  spin_lock remote CPU#0
 |                            |     <interrupted>
 |  ovs_flow_stats_update()   |     ...
 |   spin_lock local CPU#0 <--+     ovs_flow_stats_update()
 +---------------------------------- spin_lock local CPU#1

This patch disables BH for both cases fixing the deadlocks.
This bug is already fixed in OVS.
Could you point me to the commit? I am not finding anything
recent.
This is the commit:

commit 9d73c9cac76ba557fdac4a89c1b7eafe132b85a3
Author: Pravin B Shelar [off-list ref]
Date:   Tue Dec 17 15:43:30 2013 -0800

    datapath: Fix deadlock during stats update.

I thought that I had sent it in the most recent batch of changes for
net but it looks like I missed it.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help