On Nov 6, 2014, at 12:34 PM, Ben Pfaff <b...@nicira.com> wrote: > On Mon, Nov 03, 2014 at 11:39:04AM -0800, Jarno Rajahalme wrote: >> Previously, accurate iteration required writers to be excluded during >> iteration. This patch adds an rculist to struct cls_subtable, and a >> corresponding list node to struct cls_rule, which makes iteration more >> straightforward, and allows the iterators to remain ignorant of the >> internals of the cls_match. This new list allow iteration of rules in >> the classifier by traversing the RCU-friendly subtables vector, and >> the rculist of rules in each subtable. Classifier modifications may >> be performed concurrently, but whether or not the concurrent iterator >> sees those changes depends on the timing of change. This is similar >> to having writers excluded by a mutex, where visibility of changes >> depends on the timing of mutex acquisition. >> >> The subtable's rculist also allows to make classifier_rule_overlaps() >> lockless. >> >> Signed-off-by: Jarno Rajahalme <jrajaha...@nicira.com> >> --- >> v2: Using a separate list element for iteration, split out changes to >> individual patches to make review easier. > > The patch description seems straightforward: basically, we add a new > rculist to allow for robust, lockless iteration. The actual patch is > really big and complicated, though. Why?
At some point in developing this I figured it would be better if we did not keep rules not visible to lookups in the index cmaps and tries. I also ended up folding in the insert_rule() to classifier_replace() to make it symmetric with classifier_remove(). I’ll separate these out into patches of their own and repost. Jarno _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev