From: Florian Westphal <fw@strlen.de>
To: Jethro Beekman <jethro@fortanix.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH iptables] xshared: Implement xtables lock timeout using signals
Date: Sun, 13 Feb 2022 22:10:40 +0100 [thread overview]
Message-ID: <Yglz0Oi9snooOto6@strlen.de> (raw)
In-Reply-To: <256b8216-77db-cc28-4099-30c7dafb986e@fortanix.com>
Jethro Beekman <jethro@fortanix.com> wrote:
> Previously, if a lock timeout is specified using `-w`, flock() is called
> using LOCK_NB in a loop with a sleep. This results in two issues.
>
> The first issue is that the process may wait longer than necessary when
> the lock becomes available. For this the `-W` option was added, but this
> requires fine-tuning.
>
> The second issue is that if lock contention is high, invocations using
> `-w` without a timeout will always win lock acquisition from
> invocations that use `-w` *with* a timeout. This is because invocations
> using `-w` are actively waiting on the lock whereas the others only
> check from time to time whether the lock is free, which will never be
> the case.
>
> This patch removes the `-W` option and the sleep loop. Instead, flock()
> is always called in a blocking fashion, but the alarm() function is used
> with a non-SA_RESTART signal handler to cancel the system call.
Doesn't apply anymore, if you send a rebased version I'll apply it.
prev parent reply other threads:[~2022-02-13 21:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-23 15:32 [PATCH iptables] xshared: Implement xtables lock timeout using signals Jethro Beekman
2022-02-13 21:10 ` Florian Westphal [this message]
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=Yglz0Oi9snooOto6@strlen.de \
--to=fw@strlen.de \
--cc=jethro@fortanix.com \
--cc=netfilter-devel@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 NNTP newsgroup(s).