From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Liping Zhang <zlpnobody@gmail.com>
Cc: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>,
netfilter-devel@vger.kernel.org
Subject: Re: [PATCH iptables] xtables: use exponential delay when waiting for xtables lock
Date: Thu, 28 Apr 2016 11:25:41 +0200 [thread overview]
Message-ID: <20160428092541.GB1529@salvia> (raw)
In-Reply-To: <CAML_gOfhesCGBk5WWpmAsi3GQNHu5ZZpe9Wg36HCjGgQuRNeOg@mail.gmail.com>
On Thu, Apr 28, 2016 at 09:37:32AM +0800, Liping Zhang wrote:
> 2016-04-08 11:07 GMT+08:00 Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>:
> > @@ -257,10 +258,15 @@ bool xtables_lock(int wait)
> > return true;
> > else if (wait >= 0 && waited >= wait)
> > return false;
> > - if (++i % 2 == 0)
> > + if ((++i % 2 == 0) && (base_delay >= 200000))
> > fprintf(stderr, "Another app is currently holding the xtables lock; "
> > "waiting (%ds) for it to exit...\n", waited);
> > waited++;
> > - sleep(1);
>
> This break the "-w" option's semantic, i.e. if the user input
> "iptables -w 1", and concurrency happen,
> we will just only wait 10ms and return an error.
If there's any chance this patch can break existing setups then we
can't take this.
I'd suggest you add support to express millisecond precision using a
dot notation, ie.
-w .000001
that means 10 ms.
next prev parent reply other threads:[~2016-04-28 9:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-08 3:07 [PATCH iptables] xtables: use exponential delay when waiting for xtables lock Subash Abhinov Kasiviswanathan
2016-04-28 1:37 ` Liping Zhang
2016-04-28 9:25 ` Pablo Neira Ayuso [this message]
2016-04-28 19:14 ` subashab
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=20160428092541.GB1529@salvia \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=subashab@codeaurora.org \
--cc=zlpnobody@gmail.com \
/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).