Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 May 2010 15:37:31 +0530
From:      "C. Jayachandran" <c.jayachandran@gmail.com>
To:        Alexandr Rybalko <ray@dlink.ua>
Cc:        freebsd-mips@freebsd.org
Subject:   Re: Fixes to the new pagetable page allocation code.
Message-ID:  <AANLkTimex-OVTC2OfLAQSJyzDnSnlwc0gMgaFf8wKaL_@mail.gmail.com>
In-Reply-To: <20100526122719.5f163434.ray@dlink.ua>
References:  <AANLkTiluuD6YtgYBRj25FixyzGyrGNwQZmvB_nOeCFWN@mail.gmail.com> <20100526122719.5f163434.ray@dlink.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, May 26, 2010 at 2:57 PM, Alexandr Rybalko <ray@dlink.ua> wrote:
> Hi,
>
> On Wed, 26 May 2010 10:33:58 +0530
> "C. Jayachandran" <c.jayachandran@gmail.com> wrote:
>
>>> The attached patch (also at
>>> http://people.freebsd.org/~jchandra/for-review/pmap-alloc-page-fix.diff=
)
>>> has two fixes for the new pagetable page allocation code, one to
>>> handle NULL return from the allocating function, and another to call
>>> VM_WAIT in cases we can wait. It also removes the variable 'req' left
>>> over from an earlier change.
>>>
>>> Please let me know if you have any comments...
>>>
>>> JC.
>
>>> + =A0 =A0for (;;) {
>>> + =A0 =A0 =A0 =A0 =A0 =A0m =3D vm_phys_alloc_contig(1, 0, MIPS_KSEG0_LA=
RGEST_PHYS,
>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0PAGE_SIZE, PAGE_SIZE);
>>> + =A0 =A0 =A0 =A0 =A0 =A0if (m !=3D NULL)
>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break;
>>> + =A0 =A0 =A0 =A0 =A0 =A0if ((wait & M_WAITOK) =3D=3D 0)
>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (NULL);
>>> + =A0 =A0 =A0 =A0 =A0 =A0VM_WAIT;
>>> + =A0 =A0}
>
> So under low memory, subsystem will blocked forever if set M_WAITOK?
> I don`t think is good idea.

This seems to be standard pattern followed for VM_WAIT usage, I had
checked a few other architectures for the usage.

Unfortunately, I don't have the sufficient background in FreeBSD VM to
say why it is so.

JC.



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