All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nft 0/6] shrink memory usage for interval sets
@ 2024-12-17 21:15 Pablo Neira Ayuso
  2024-12-17 21:15 ` [PATCH nft 1/6] intervals: add helper function to set previous element Pablo Neira Ayuso
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Pablo Neira Ayuso @ 2024-12-17 21:15 UTC (permalink / raw)
  To: netfilter-devel

Hi,

This is a continuation in the effort to reduce memory consumption for
sets from userspace.

Patch #1 adds a helper function as preparation work.

Patch #2 fixes invalid auto-merging of elements with different timeout.

Patch #3 add EXPR_RANGE_VALUE to reduce memory consumption of ranges,
which now require two struct expr instead of four.

Patch #4 makes a simple constification of a helper function to detect
interval sets with single key.

Patch #5 renames a field from set to init in mnl_nft_setelem_batch()
to prepare for passing struct set.

Patch #6 reworks the transformation from range to the singleton elements
that represents intervals through EXPR_F_INTERVAL_END to create them
only before the netlink message.

This shrinks runtime userspace memory consumption from 70.50 Mbytes to
43.38 Mbytes for a 100k intervals set sample.

Pablo Neira Ayuso (6):
  intervals: add helper function to set previous element
  intervals: do not merge intervals with different timeout
  src: add EXPR_RANGE_VALUE expression and use it
  rule: constify set_is_non_concat_range()
  mnl: rename list of expression in mnl_nft_setelem_batch()
  src: rework singleton interval transformation to reduce memory consumption

 include/expression.h |  13 ++
 include/intervals.h  |   2 +
 include/list.h       |   8 ++
 include/mnl.h        |   3 +-
 include/rule.h       |   2 +-
 src/expression.c     |  85 +++++++++++++
 src/intervals.c      | 280 +++++++++++++++++++++++++------------------
 src/mergesort.c      |   2 +
 src/mnl.c            |  81 +++++++++++--
 src/rule.c           |   4 +-
 10 files changed, 345 insertions(+), 135 deletions(-)

-- 
2.30.2


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

end of thread, other threads:[~2024-12-17 21:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-17 21:15 [PATCH nft 0/6] shrink memory usage for interval sets Pablo Neira Ayuso
2024-12-17 21:15 ` [PATCH nft 1/6] intervals: add helper function to set previous element Pablo Neira Ayuso
2024-12-17 21:15 ` [PATCH nft 2/6] intervals: do not merge intervals with different timeout Pablo Neira Ayuso
2024-12-17 21:15 ` [PATCH nft 3/6] src: add EXPR_RANGE_VALUE expression and use it Pablo Neira Ayuso
2024-12-17 21:15 ` [PATCH nft 4/6] rule: constify set_is_non_concat_range() Pablo Neira Ayuso
2024-12-17 21:15 ` [PATCH nft 5/6] mnl: rename list of expression in mnl_nft_setelem_batch() Pablo Neira Ayuso
2024-12-17 21:15 ` [PATCH nft 6/6] src: rework singleton interval transformation to reduce memory consumption Pablo Neira Ayuso

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.