[prev in list] [next in list] [prev in thread] [next in thread] 

List:       drbd-dev
Subject:    Re: [Drbd-dev] Avoid nested sleeping on TCP connect
From:       Lars Ellenberg <lars.ellenberg () linbit ! com>
Date:       2017-02-22 8:18:42
Message-ID: 20170222081842.GP21236 () soda ! linbit
[Download RAW message or body]

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 ret=
urning -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 time=
out 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=AE and LINBIT=AE are registered trademarks of LINBIT
_______________________________________________
drbd-dev mailing list
drbd-dev@lists.linbit.com
http://lists.linbit.com/mailman/listinfo/drbd-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic