Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Nov 2014 15:01:13 +0000
From:      "Robert N. M. Watson" <rwatson@FreeBSD.org>
To:        Marko Zec <zec@fer.hr>
Cc:        Craig Rodrigues <rodrigc@freebsd.org>, FreeBSD Net <freebsd-net@freebsd.org>, "Bjoern A. Zeeb" <bz@FreeBSD.org>
Subject:   Re: VIMAGE UDP memory leak fix
Message-ID:  <A4211137-9CE8-45A6-BA73-DCD767236C48@FreeBSD.org>
In-Reply-To: <20141121120201.6c77ea5b@x23>
References:  <CAG=rPVehky00X4MuQQ-_Oe5ezWg52ZZrPASAh9GBy7baYv78CA@mail.gmail.com> <20141121002937.4f82daea@x23> <A4D676B3-6C50-47F7-8CFD-50B44FF4BE98@FreeBSD.org> <9300CB5F-6140-4C49-B026-EB69B0E8B37E@FreeBSD.org> <20141121120201.6c77ea5b@x23>

next in thread | previous in thread | raw e-mail | index | archive | help

On 21 Nov 2014, at 11:02, Marko Zec <zec@fer.hr> wrote:

>> I had convinced myself for UDP many years ago that it was ok to
>> remove it.  People have touched the code however so it=92s =
definitively
>> worth re-checking again.
>>=20
>> For TCP we clearly cannot do it (yet, and couldn=92t back then).   =
But
>> TCP was the only of the few cases I had left unfixed back then.
>> Can=92t remember what the others were (was like 3 or 4 of them;  =
could
>> also be some of the fixes were indeed committed back then.
>=20
> Now that we've found ourselves in this discussion, I'm really
> becoming curious why exactly do we need UMA_ZONE_NOFREE for network
> stack zones at all?   Admittedly, I always thought that the primary
> purpose of UMA_ZONE_NOFREE was to prevent uma_reclaim() from paging =
out
> _used_ zone pages, but reviewing the uma code reveals that this might
> not be the case, i.e. that NOFREE only prevents _unused_ pages to be
> freed by uma_reclaim().
>=20
> Moreover, all uma_zalloc() calls as far as I can see are flagged as
> M_NOWAIT and are followed by checks for allocation failures, so that
> part seems to be covered.
>=20
> So, what's really the problem which UMA_ZONE_NOFREE flagging is =
supposed
> to solve these days? (you claim that we clearly need it for TCP - =
why)?

Bjoern and I chatted for the last twenty or so minutes about the code, =
and believe that as things stand, it is *not* safe to turn off =
UMA_ZONE_NOFREE for TCP due to a teardown race in TCP that has been =
known about and discussed for several years, but is some work to resolve =
and that we've not yet found time to do so. The XXXRW's in tcp_timer.c =
are related to this. We're pondering ways to fix it but think this is =
not something that can be rushed.

Robert=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A4211137-9CE8-45A6-BA73-DCD767236C48>