[ovs-git] [openvswitch/ovs] c50eaa: pvector: Use acquire-release semantics for size.

Ilya Maximets noreply at github.com
Sun Mar 15 12:46:30 UTC 2020


  Branch: refs/heads/branch-2.12
  Home:   https://github.com/openvswitch/ovs
  Commit: c50eaa3d0b9d8325cd3b53f52105465b5bf9bce9
      https://github.com/openvswitch/ovs/commit/c50eaa3d0b9d8325cd3b53f52105465b5bf9bce9
  Author: Yanqin Wei <Yanqin.Wei at arm.com>
  Date:   2020-03-13 (Fri, 13 Mar 2020)

  Changed paths:
    M lib/pvector.c
    M lib/pvector.h

  Log Message:
  -----------
  pvector: Use acquire-release semantics for size.

Read/write concurrency of pvector library is implemented by a temp vector
and RCU protection. Considering performance reason, insertion does not
follow this scheme.
In insertion function, a thread fence ensures size increment is done
after new entry is stored. But there is no barrier in the iteration
fuction(pvector_cursor_init). Entry point access may be reordered before
loading vector size, so the invalid entry point may be loaded when vector
iteration.
This patch fixes it by acquire-release pair. It can guarantee new size is
observed by reader after new entry stored by writer. And this is
implemented by one-way barrier instead of two-way memory fence.

Fixes: fe7cfa5c3f19 ("lib/pvector: Non-intrusive RCU priority vector.")
Reviewed-by: Gavin Hu <Gavin.Hu at arm.com>
Reviewed-by: Lijian Zhang <Lijian.Zhang at arm.com>
Signed-off-by: Yanqin Wei <Yanqin.Wei at arm.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: d35f18ca6aac73a7867ce4c2cba55b13bb6cb2f3
      https://github.com/openvswitch/ovs/commit/d35f18ca6aac73a7867ce4c2cba55b13bb6cb2f3
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2020-03-13 (Fri, 13 Mar 2020)

  Changed paths:
    M lib/dpif-netdev.c

  Log Message:
  -----------
  dpif-netdev: Enter quiescent state after each offloading operation.

If the offloading queue is big and filled continuously, offloading
thread may have no chance to quiesce blocking rcu callbacks and
other threads waiting for synchronization.

Fix that by entering momentary quiescent state after each operation
since we're not holding any rcu-protected memory here.

Fixes: 02bb2824e51d ("dpif-netdev: do hw flow offload in a thread")
Reported-by: Eli Britstein <elibr at mellanox.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2020-February/049768.html
Acked-by: Eli Britstein <elibr at mellanox.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/511918e6a822...d35f18ca6aac


More information about the git mailing list