Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Jun 2010 04:10:16 +0530
From:      "C. Jayachandran" <c.jayachandran@gmail.com>
To:        Alan Cox <alc@cs.rice.edu>
Cc:        "Jayachandran C." <jchandra@freebsd.org>, Konstantin Belousov <kostikbel@gmail.com>, mips@freebsd.org
Subject:   Re: svn commit: r208589 - head/sys/mips/mips
Message-ID:  <AANLkTinmFOZY3OlaoKStxlNIRBt2G2I4ILkQ1P0CjozG@mail.gmail.com>
In-Reply-To: <4C09345F.9040300@cs.rice.edu>
References:  <201005271005.o4RA5eVu032269@svn.freebsd.org> <4C058145.3000707@cs.rice.edu> <AANLkTil955Ek-a3tek4Ony9NqrK5l2j7lNA4baRVPBzb@mail.gmail.com> <4C05F9BC.40409@cs.rice.edu> <AANLkTikdnvXsTwm8onl3MZPQmVfV-2GovB9--KMNnMgC@mail.gmail.com> <4C0731A5.7090301@cs.rice.edu> <AANLkTimIa3jmBPMhWIOcY6DenGpZ2ZYmqwDTWspVx0-u@mail.gmail.com> <AANLkTil2gE1niUWCHnsTlQvibhxBh7QYwD0TTWo0rj5c@mail.gmail.com> <AANLkTinA2D5iTDGPbflHVzLyAZW-ZewjJkUWWL8FVskr@mail.gmail.com> <4C07E07B.9060802@cs.rice.edu> <AANLkTimjyPc_AXKP1yaJaF1BN7CAGBeNikVzcp9OCb4P@mail.gmail.com> <4C09345F.9040300@cs.rice.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
--00c09f83a1ccaf805d0488501fb1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Fri, Jun 4, 2010 at 10:44 PM, Alan Cox <alc@cs.rice.edu> wrote:
> C. Jayachandran wrote:
>>
>> On Thu, Jun 3, 2010 at 10:33 PM, Alan Cox <alc@cs.rice.edu> wrote:
>>
>
> [snip]
>>
>>> Add a static counter to pmap_ptpgzone_allocf(). =A0When the counter rea=
ches
>>> some not-too-small prime number, don't call vm_phys_alloc_contig(),
>>> instead
>>> set "m" to NULL and reset the counter to zero. =A0Setting "m" to NULL
>>> should
>>> then trigger the vm_contig_grow_cache() call. =A0Make sense?
>>>
>>
>> Is this to move the vm_contig_grow_cache() out of the
>> pmap_ptpgzone_allocf() and into the function calling uma_zalloc()? =A0I
>> am wondering why the prime number is needed.
>>
>> Another implementation I had thought about was to have a kernel
>> process maintain a pool of direct mapped pages for MIPS. This will be
>> woken up if the pool goes below a low water mark - any comments on
>> this?
>>
>>
>
> Here is how the page table page allocation should be done. =A0It's not mu=
ch
> harder than the vm_contig_grow_cache() change.
>
> 1. Look at vm/vm_phys.c, in particular, vm_phys_init(). =A0Create a new
> freelist, like =A0 =A0 =A0VM_FREELIST_ISADMA, for the direct-mapped memor=
y on
> MIPS. =A0Perhaps, call it VM_FREELIST_LOWMEM. =A0The controlling macros s=
hould
> be defined in mips/include/vmparam.h.
>
> 2. Trivially refactor vm_phys_alloc_pages(). =A0Specifically, take the bo=
dy of
> the outer for loop and make it a new function, vm_phys_alloc_freelist(),
> =A0that takes the variable "flind" as a parameter.
>
> 3. Eliminate the UMA zone for page table pages. =A0In place of
> vm_phys_alloc_contig() call your new function with VM_FREELIST_LOWMEM. =
=A0(The
> vm_contig_grow_cache() remains unchanged.) =A0Go back to calling
> vm_page_free() to release page table pages.
>
> For the record, the changes that you made to start using a zone for page
> table page allocation introduced at least one possible race condition
> between pmap_remove_pages() and pmap_remove_all(). =A0Specifically, by
> dropping and reacquiring the page queues and pmap lock when you free a pa=
ge
> table page, you allow a pmap_remove_all() call while pmap_remove_pages() =
is
> running to leave the variable "npv" in pmap_remove_pages() pointing at a
> freed pv entry.

My first attempt is attached, it comes up multiuser but crashes if I
stress it a bit (panic: Bad link elm 0xc0078f00 prev->next !=3D elm).
Will look at this tomorrow, and see if I can find the cause.

In the meantime, it may be worth looking at the patch to see if this
is in line with the approach you had suggested. I have tried to  use
VM_FREELIST_HIGHMEM which is already there, instead of adding
VM_FREELIST_LOWMEM.

JC.

--00c09f83a1ccaf805d0488501fb1
Content-Type: application/octet-stream; name="vm_pagetable_pages.patch"
Content-Disposition: attachment; filename="vm_pagetable_pages.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_ga30gbg90

SW5kZXg6IHN5cy9taXBzL2luY2x1ZGUvdm1wYXJhbS5oCj09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9taXBz
L2luY2x1ZGUvdm1wYXJhbS5oCShyZXZpc2lvbiAyMDg4NDgpCisrKyBzeXMvbWlwcy9pbmNsdWRl
L3ZtcGFyYW0uaAkod29ya2luZyBjb3B5KQpAQCAtMTAzLDggKzEwMyw5IEBACiAjZGVmaW5lCVZN
X01BWFVTRVJfQUREUkVTUwkoKHZtX29mZnNldF90KTB4ODAwMDAwMDApCiAjZGVmaW5lCVZNX01B
WF9NTUFQX0FERFIJVk1fTUFYVVNFUl9BRERSRVNTCiAKLSNkZWZpbmUJVk1fTUlOX0tFUk5FTF9B
RERSRVNTCQkoKHZtX29mZnNldF90KTB4QzAwMDAwMDApCi0jZGVmaW5lCVZNX01BWF9LRVJORUxf
QUREUkVTUwkJKCh2bV9vZmZzZXRfdCkweEZGRkZDMDAwKQorI2RlZmluZQlWTV9NSU5fS0VSTkVM
X0FERFJFU1MJKCh2bV9vZmZzZXRfdCkweEMwMDAwMDAwKQorI2RlZmluZQlWTV9NQVhfS0VSTkVM
X0FERFJFU1MJKCh2bV9vZmZzZXRfdCkweEZGRkZDMDAwKQorI2RlZmluZSBWTV9ISUdITUVNX0FE
RFJFU1MJKCh2bV9wYWRkcl90KTB4MjAwMDAwMDApCiAjaWYgMAogI2RlZmluZQlLRVJOQkFTRQkJ
KFZNX01JTl9LRVJORUxfQUREUkVTUykKICNlbHNlCkBAIC0xNjgsMTMgKzE2OSwxNSBAQAogI2Rl
ZmluZQlWTV9GUkVFUE9PTF9ESVJFQ1QJMQogCiAvKgotICogd2Ugc3VwcG9ydCAxIGZy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BhZGRy
X3QgaGlnaCwKICAgICB1bnNpZ25lZCBsb25nIGFsaWdubWVudCwgdW5zaWduZWQgbG9uZyBib3Vu
ZGFyeSk7Cit2bV9wYWdlX3Qgdm1fcGh5c19hbGxvY19mcmVlbGlzdF9wYWdlcyhpbnQgZmxpbmQs
IGludCBwb29sLCBpbnQgb3JkZXIpOwogdm1fcGFnZV90IHZtX3BoeXNfYWxsb2NfcGFnZXMoaW50
IHBvb2wsIGludCBvcmRlcik7CiB2bV9wYWRkcl90IHZtX3BoeXNfYm9vdHN0cmFwX2FsbG9jKHZt
X3NpemVfdCBzaXplLCB1bnNpZ25lZCBsb25nIGFsaWdubWVudCk7CiB2b2lkIHZtX3BoeXNfZnJl
ZV9wYWdlcyh2bV9wYWdlX3QgbSwgaW50IG9yZGVyKTsK
--00c09f83a1ccaf805d0488501fb1--



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