From: Lars Ellenberg <lars.ellenberg@linbit.com>
To: drbd-dev@lists.linbit.com
Subject: Re: [Drbd-dev] Avoid nested sleeping on TCP connect
Date: Wed, 22 Feb 2017 09:18:42 +0100 [thread overview]
Message-ID: <20170222081842.GP21236@soda.linbit> (raw)
In-Reply-To: <a56aa3ed-f241-e7aa-9778-2741695c1d7f@digide.net>
On Mon, Feb 20, 2017 at 05:58:16PM +0100, Andreas Osterburg wrote:
> Thanks for your investigations.
> I didn't use a loop since the old behaviour was to leave the function returning -EAGAIN
> on timeout or interrupt. There is just one difference: When an event from the socket occures
> and no TCP-connection is established, the function leaves before the timeout elapses.
Exactly.
There may well be several incoming TCP connections,
and we want to wait for the right one.
> It makes no real difference to an interrupt, so I didn't handle it
> specially.
Usually there is no interrupt.
Interrupt would mean someone cancels the connection attemt,
tears down the connection before it is even established.
So yes, it could make a significant difference in some setups.
Anyways: right now, best to just leave it alone.
The inner mutex is supposed to have no real contention, the worst thing
that would happen if we should have to block for it, and the condition
is still not met, is one extra iteration in the outer wait_event loop,
which is harmless.
--
: Lars Ellenberg
: LINBIT | Keeping the Digital World Running
: DRBD -- Heartbeat -- Corosync -- Pacemaker
: R&D, Integration, Ops, Consulting, Support
DRBD® and LINBIT® are registered trademarks of LINBIT
prev parent reply other threads:[~2017-02-22 8:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-20 10:54 [Drbd-dev] Avoid nested sleeping on TCP connect Andreas Osterburg
2017-02-20 14:07 ` Lars Ellenberg
2017-02-20 16:58 ` Andreas Osterburg
2017-02-22 8:18 ` Lars Ellenberg [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=20170222081842.GP21236@soda.linbit \
--to=lars.ellenberg@linbit.com \
--cc=drbd-dev@lists.linbit.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