All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nf-next v2 0/2] netfilter: nf_tables: avoid atomic allocations for set flush
@ 2025-08-22  8:15 Florian Westphal
  2025-08-22  8:15 ` [PATCH nf-next v2 1/2] netfilter: nf_tables: allow iter callbacks to sleep Florian Westphal
  2025-08-22  8:15 ` [PATCH nf-next v2 2/2] netfilter: nf_tables: all transaction allocations can now sleep Florian Westphal
  0 siblings, 2 replies; 6+ messages in thread
From: Florian Westphal @ 2025-08-22  8:15 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Florian Westphal

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-08-28 23:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-22  8:15 [PATCH nf-next v2 0/2] netfilter: nf_tables: avoid atomic allocations for set flush Florian Westphal
2025-08-22  8:15 ` [PATCH nf-next v2 1/2] netfilter: nf_tables: allow iter callbacks to sleep Florian Westphal
2025-08-28 14:30   ` Pablo Neira Ayuso
2025-08-28 15:10     ` Florian Westphal
2025-08-28 23:46       ` Florian Westphal
2025-08-22  8:15 ` [PATCH nf-next v2 2/2] netfilter: nf_tables: all transaction allocations can now sleep Florian Westphal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.