]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: flower: don't call synchronize_rcu() on mask creation
authorVlad Buslov <vladbu@mellanox.com>
Thu, 13 Jun 2019 14:54:04 +0000 (17:54 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 15 Jun 2019 02:29:57 +0000 (19:29 -0700)
commit7f22cdb178d43d9ec4bb18b2e25c58b08bfc59f2
tree3315f9e1d75ea2f8a030260f42a4bb626b6d3593
parentac1d393dd1e1a6b2f83a5514a4a591818417b194
net: sched: flower: don't call synchronize_rcu() on mask creation

Current flower mask creating code assumes that temporary mask that is used
when inserting new filter is stack allocated. To prevent race condition
with data patch synchronize_rcu() is called every time fl_create_new_mask()
replaces temporary stack allocated mask. As reported by Jiri, this
increases runtime of creating 20000 flower classifiers from 4 seconds to
163 seconds. However, this design is no longer necessary since temporary
mask was converted to be dynamically allocated by commit ec98919166f0
("net/sched: cls_flower: allocate mask dynamically in fl_change()").

Remove synchronize_rcu() calls from mask creation code. Instead, refactor
fl_change() to always deallocate temporary mask with rcu grace period.

Fixes: 0f26292f3f53 ("net: sched: flower: handle concurrent mask insertion")
Reported-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Tested-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_flower.c