[ovs-dev] [PATCH v2 2/5] classifier: Make classifier_find_rule_exactly() lockless.
Ben Pfaff
blp at nicira.com
Thu Nov 6 19:24:07 UTC 2014
On Mon, Nov 03, 2014 at 11:39:01AM -0800, Jarno Rajahalme wrote:
> struct cls_match 'list' member was recently changed to an rculist.
> This allows classifier_find_rule_exactly() to be made lockless.
>
> Since subtable's 'max_priority' member would still require a lock, we
> no longer check it before calling find_equal(). This adds a hash table
> lookup in cases where the subtable may already be known to not contain
> any rule of the target priority. If this is deemed a significant
> change, we could change the 'max_priority' member to be an atomic
> variable so that it could be safely accessed without a lock.
>
> Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
classifier_find_rule_exactly() isn't called on any fast paths, so I'm
not worried about this. I doubt that the priority check is a big
optimization anyway. I do like getting rid of the lock.
Acked-by: Ben Pfaff <blp at nicira.com>
More information about the dev
mailing list