[PATCH nf-next v2 0/2] netfilter: nf_tables: avoid atomic allocations for set flush

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sven Auhagen reports memory allocation errors during set flush.
This is because of GFP_ATOMIC allocations because rhashtable walker
uses rcu and cannot sleep.

Build a linear list in rhashtable walker, drop rcu read lock and
then call the iter callback in a second loop.

This allows use of GFP_KERNEL allocations.

The second loop has no noticeable impact on set flush durations, even
for large (800k entries) sets.

Florian Westphal (2):
  netfilter: nf_tables: allow iter callbacks to sleep
  netfilter: nf_tables: all transaction allocations can now sleep

 include/net/netfilter/nf_tables.h |   2 +
 net/netfilter/nf_tables_api.c     |  47 ++++++--------
 net/netfilter/nft_set_hash.c      | 102 +++++++++++++++++++++++++++++-
 net/netfilter/nft_set_rbtree.c    |  35 +++++++---
 4 files changed, 147 insertions(+), 39 deletions(-)

-- 
2.49.1




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux