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

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 26 May 2010 15:37:31 +0530
"C. Jayachandran" <c.jayachandran@gmail.com> wrote:

>> 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.
>> >
>> >>> +    for (;;) {
>> >>> +            m = vm_phys_alloc_contig(1, 0, MIPS_KSEG0_LARGEST_PHYS,
>> >>> +                PAGE_SIZE, PAGE_SIZE);
>> >>> +            if (m != NULL)
>> >>> +                    break;
>> >>> +            if ((wait & M_WAITOK) == 0)
>> >>> +                    return (NULL);
>> >>> +            VM_WAIT;
>> >>> +    }
>> >
>> > 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.

OK, then looks good to me too :)


-- 
Alexandr Rybalko <ray@dlink.ua> 
aka Alex RAY <ray@ddteam.net>



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