Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Aug 2015 15:45:39 -0300
From:      Luiz Otavio O Souza <loos.br@gmail.com>
To:        Guy Helmer <guy.helmer@gmail.com>
Cc:        Ed Schouten <ed@nuxi.nl>, Luiz Otavio O Souza <loos@freebsd.org>, src-committers@freebsd.org,  svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r286142 - head/sys/net
Message-ID:  <CAJ8CS7q5B2gZvC=OYvGQxnhk0qmSF1h5XEVi1ZEPzdoTZynwpA@mail.gmail.com>
In-Reply-To: <EB54E04B-2312-495E-8D36-DD283582E256@gmail.com>
References:  <201507312143.t6VLhSBm046797@repo.freebsd.org> <CABh_MKn5vfXB4Hv3mfAVgy7g98_U%2BcQ=XKyVTLdVJO3pp0-05Q@mail.gmail.com> <EB54E04B-2312-495E-8D36-DD283582E256@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Aug 1, 2015 at 6:02 PM, Guy Helmer wrote:
>
>> On Aug 1, 2015, at 4:50 AM, Ed Schouten wrote:
>>
>> Hi Luiz,
>>
>> 2015-07-31 23:43 GMT+02:00 Luiz Otavio O Souza <loos@freebsd.org>:
>>> -               while (d->bd_hbuf_in_use)
>>> -                       mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock,
>>> -                           PRINET, "bd_hbuf", 0);
>>
>> Would it make sense to replace them by an assertion, instead of
>> omitting them entirely?
>>
>> KASSERT(!d->bd_hbuf_in_use, ("..."));
>
> I would appreciate the confidence that would provide.
>
> Guy

Yeah, I agree.  The KASSERT() makes the code even easier to understand.

Note that only one KASSERT() is needed here, because to other case is
specific to zero-copy buffers and the zero-copy buffers cannot be read
with read(2) and this way they never set the in use flag for the hold
buffer.

Committed in r286243.

Thanks!

Luiz



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