Fixes to the new pagetable page allocation code.

C. Jayachandran c.jayachandran at gmail.com
Wed May 26 10:07:32 UTC 2010


On Wed, May 26, 2010 at 2:57 PM, Alexandr Rybalko <ray at dlink.ua> wrote:
> Hi,
>
> On Wed, 26 May 2010 10:33:58 +0530
> "C. Jayachandran" <c.jayachandran at 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.


More information about the freebsd-mips mailing list