Improves the performance of OVSDB avoiding the chain reaction produced when modifing rows with a strong reference and the pointed rows have more strong references.
The approach taken was using the change bitmap to avoid triggering a change count when the column hasn't changed. One way to trigger the issue is emulating a simple linked list with strong references within a table, where each new row points to the previous. Without the fix OVSDB creates a ovsdb_txn_row (and a copy of the row) for each row in the table. With the fix it only creates two ovsdb_txn_row: the new row and the directly pointed row. Signed-off-by: Esteban Rodriguez Betancourt <esteb...@hpe.com> --- ovsdb/transaction.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/ovsdb/transaction.c b/ovsdb/transaction.c index 84ccfa3..9e12a62 100644 --- a/ovsdb/transaction.c +++ b/ovsdb/transaction.c @@ -271,16 +271,18 @@ update_row_ref_count(struct ovsdb_txn *txn, struct ovsdb_txn_row *r) const struct ovsdb_column *column = node->data; struct ovsdb_error *error; - if (r->old) { - error = ovsdb_txn_adjust_row_refs(txn, r->old, column, -1); - if (error) { - return OVSDB_WRAP_BUG("error decreasing refcount", error); + if (bitmap_is_set(r->changed, column->index)) { + if (r->old) { + error = ovsdb_txn_adjust_row_refs(txn, r->old, column, -1); + if (error) { + return OVSDB_WRAP_BUG("error decreasing refcount", error); + } } - } - if (r->new) { - error = ovsdb_txn_adjust_row_refs(txn, r->new, column, 1); - if (error) { - return error; + if (r->new) { + error = ovsdb_txn_adjust_row_refs(txn, r->new, column, 1); + if (error) { + return error; + } } } } -- 1.9.1 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev