Skip to content

Commit

Permalink
pvector: Document the entry destruction policy.
Browse files Browse the repository at this point in the history
This describes how to safely destroy pvector entries after removal.

Signed-off-by: Ilya Maximets <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
igsilya authored and blp committed Apr 15, 2019
1 parent da49e81 commit ead9425
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/pvector.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@
* 'temp' may contain NULL pointers and it may be in unsorted order. It is
* sorted before it is published at 'impl', which also removes the NULLs from
* the published vector.
*
* Since the vector is RCU protected, the entry destruction after removal must
* be RCU postponed. Also, if it happens before changes published with
* pvector_publish(), destruction must be double postponed, i.e., the second
* ovsrcu_postpone() call to destruct the entry should be called from the first
* RCU callback. This is required because readers could still obtain the
* unmodified vector until updated version is published.
*/

struct pvector_entry {
Expand Down

0 comments on commit ead9425

Please sign in to comment.