netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anton <anton.khazan@gmail.com>
To: netfilter@vger.kernel.org
Subject: What happens if the machine runs out of memory while adding new nftables sets atomically?
Date: Tue, 6 Feb 2024 12:47:19 +0200	[thread overview]
Message-ID: <CAJE3=wmUcJ0E8nobG=T084XkiEK9UUgR4kyfLHk2enZOunH_1A@mail.gmail.com> (raw)

Hi folks,

While experimenting with adding nftables sets on memory-constrained
devices, I have run into OOM conditions. Currently many embedded
devices such as routers are balancing on the verge of not enough
memory if using nft sets (at least interval sets).

I know that there has been progress on the front of reducing memory
footprint, but it's not yet in the nftables versions supplied by the
distributions, so for now I have to work with the current state of
things.

To be on the safe side, currently my scripts add sets separately from
adding rules and removing sets. I'd like to ask the devs, is it safe
under these conditions to attempt performing all these actions in one
atomic operation? Is previous firewall configuration guaranteed to be
successfully restored if the operation runs into OOM?

             reply	other threads:[~2024-02-06 10:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 10:47 Anton [this message]
2024-02-06 11:12 ` What happens if the machine runs out of memory while adding new nftables sets atomically? Florian Westphal
2024-02-06 12:15   ` Anton
2024-02-06 12:15     ` Anton
2024-02-06 12:18       ` Florian Westphal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJE3=wmUcJ0E8nobG=T084XkiEK9UUgR4kyfLHk2enZOunH_1A@mail.gmail.com' \
    --to=anton.khazan@gmail.com \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).