DragonFly kernel List (threaded) for 2008-08
DragonFly BSD
DragonFly kernel List (threaded) for 2008-08
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: [netmp] socket accesses


From: Aggelos Economopoulos <aoiko@xxxxxxxxxxxxxx>
Date: Mon, 18 Aug 2008 02:53:35 +0300

On Monday 18 August 2008, Matthew Dillon wrote:
> :So, atomic or non-atomic op, if we race here, the mbufs can stay in the sockbuf
> :for ever...
> 
>     The current code does not clean out the sockbuf when setting
>     SS_CANTRCVMORE.  I think data already queued stays in there until read
>     by userland or until the socket is closed.  So it shouldn't matter if
>     an extra packet or two gets in there while the socket is still open.

Right.

> :..
> :> if (so->so_state & SS_CANTRCVMORE) {
> :>         soisdisconnected(so);
> :>         callout_reset(tp->tt_2msl, tcp_maxidle,
> :>                       tcp_timer_2msl, tp);
> :> }
> :
> :And if we race here, we'll never disconnect the socket.
> :..
> :Aggelos
> 
>     This code looks like an optimization to me.  It shouldn't matter whether
>     the conditional occurs or not.  All it does is shortcut the FIN2 state
>     because there are no longer any readers that might need data received
>     during that state.
> 
>     If it misses the case it would be as if the user shutdown a microsecond
>     after the remote end initiated a close sequence instead of a microsecond
>     before.

Hmm. Yeah, makes sense. All is well then. Thanks!

Aggelos



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]