Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Jul 2018 11:10:34 +0930
From:      "O'Connor, Daniel" <darius@dons.net.au>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        Pratyush Yadav <pratyush@freebsd.org>, freebsd-hackers@freebsd.org
Subject:   Re: Can contigmalloc(9) fail even when M_NOWAIT is *not* specified?
Message-ID:  <51DA0343-0B43-4BC6-B736-DA52493C26F8@dons.net.au>
In-Reply-To: <77cc8c09-41e1-cbdf-7c79-90af75ee3cd9@FreeBSD.org>
References:  <CA%2BX=3T%2BBbcfY1BFGze=scxXFNPkh7Pn-Qx1kKGURi00adHCquw@mail.gmail.com> <77cc8c09-41e1-cbdf-7c79-90af75ee3cd9@FreeBSD.org>

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


> On 9 Jul 2018, at 17:02, Andriy Gapon <avg@freebsd.org> wrote:
> On 09/07/2018 09:21, Pratyush Yadav wrote:
>> Hi,
>>=20
>> The contigmalloc(9) man page says:
>>=20
>>> The contigmalloc() function does not sleep waiting for memory =
resources
>>> to be freed up, but instead actively reclaims pages before giving =
up.
>>> However, unless M_NOWAIT is specified, it may select a page for =
reclama-
>>> tion that must first be written to backing storage, causing it to =
sleep.
>>=20
>> So if M_NOWAIT is *not* specified, can contigmalloc() "give up", and
>> return NULL?
>=20
> Yes.

This seems pretty surprising to me.. Perhaps the man page could have a =
warning about it - right now it fairly strongly implies that !M_NOWAIT =
will wait forever.

--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
 -- Andrew Tanenbaum





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51DA0343-0B43-4BC6-B736-DA52493C26F8>