Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jan 2007 16:44:51 +0100
From:      "Attilio Rao" <attilio@freebsd.org>
To:        "John Baldwin" <jhb@freebsd.org>
Cc:        Craig Rodrigues <rodrigc@crodrigues.org>, Randall Stewart <rrs@cisco.com>, freebsd-current@freebsd.org, Robert Watson <rwatson@freebsd.org>
Subject:   Re: Witness warning with SCTP
Message-ID:  <3bbf2fe10701110744r26f7f3cfve073f7154ab8a48d@mail.gmail.com>
In-Reply-To: <200701101431.57695.jhb@freebsd.org>
References:  <20070107171034.GA13836@crodrigues.org> <20070110142100.G52843@fledge.watson.org> <45A5004B.6090402@cisco.com> <200701101431.57695.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
2007/1/10, John Baldwin <jhb@freebsd.org>:
> On Wednesday 10 January 2007 10:03, Randall Stewart wrote:
> > Robert/All:
> >
> > Ok, here is the deal... I have looked in a bit
> > closer at this..
> >
> > Here is what is happening...
> >
> > When a cookie arrives, we get a "create lock" on
> > the socket this prevents the user on the same
> > socket from creating a assoc at the same exact time.
>
> Can't you do a model like this:
>
>        lock();
>        if (need to create pcb) {
>                unlock();
>                create_pcb();  // can sleep w/o holding lock
>                lock();
>                if (someone else created the pcb)
>                        free(pcb_I_just_created);
>        }
>        unlock();

But it is quite impossible to get rid of M_WAITOK in this case (IIUC,
this should be the sleeping point)?

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3bbf2fe10701110744r26f7f3cfve073f7154ab8a48d>