On Mon, Apr 22, 2013 at 3:55 PM, David Miller <[email protected]> wrote:
> From: Pravin Shelar <[email protected]>
> Date: Mon, 22 Apr 2013 13:41:41 -0700
>
>> Therefore scatchpad in SKB is protected and parallel netlink dump operations
>> can go only on different netlink sockets.
>
> What about configuration changes running in parallel with the dump?
>
> You must synchronize with those too, otherwise protecting the
> intra-dump state is meaningless since the underlying objects
> can change underneath the dump.
That is synchronized using rw-sem.
This is how locking looks like:
genl_dump() (if lockless = true)
SEM_READ_LOCK()
Per_sock_mutex()
-->netlink_dump()
Per_sock_unmutex()
SEM_READ_UNLOCK()
---
genl_conf_changes:
SEM_WRITE_LOCK()
GENL_LOCK()
conf_changes()
GENL_UNLOCK()
SEM_WRITE_UNLOCK()
---
Now I think I shld call this parallel operations rather than lockless
operations, since I do take read lock for entire genl-ops
.
Let me send updated patch.
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev