Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Mar 2015 23:51:54 -0700
From:      Adrian Chadd <adrian@freebsd.org>
To:        "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>
Subject:   vm_reserv and VM domains (was Re: A quick dumpster dive through the busdma allocation path..)
Message-ID:  <CAJ-Vmo=fsBOgS7925A7xiO=DTw4VP0a5JSRBF=C0xda8rf-p6g@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
[snip]

So after some more digging and discussion, here's where I got to.

The problem seen here here is that the KVA allocation / vm_object
representation doesn't really have any concept of VM domains; so page
allocations just find space in the kmem vm_object, and then request a
physical page to back it. If it's already backed by a superpage the
vm_reserv code will return it, and not allocate another page. It then
comes out of memory from the wrong domain.

The quick (!) hack would be to just break the superpage and allow
adjacent pages to come from different physical memory from different
VM domains.

In the VM domain case, we don't want to just blindly allocate like
this - instead, we want to try and be more sparser with KVA
allocations so the superpages don't have to be broken down.

It looks like the vm_reserv code doesn't need to know about domains
until it's decided to break the superpage up to meet requirements.

It's been suggested that a layer be put between the malloc routines
and the calls into the kmem KVA allocation, to allocate larger,
(aligned) KVA regions that are multiples of the vm_reserv superpage
size. It'll be fine on amd64 and such platforms where there's plenty
of KVA. But, I don't really want to add another layer of complexity
here.

So, does anyone else have any other ideas?



-adrian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmo=fsBOgS7925A7xiO=DTw4VP0a5JSRBF=C0xda8rf-p6g>