Page MenuHomeFreeBSD

Allocate the vm_page_array on domain correct memory.

Authored by jeff on Aug 13 2019, 5:41 PM.



This gives us lower latency and lower interconnect bandwidth on many benchmarks that process a lot of pages. We probably should also affinitize the vm threads after this for maximum benefit.

I used a separate pml4 entry because it made life easier for me. There isn't a strong technical reason to do so. Given that the page array is 3% of memory I don't think this is an unreasonable use. There is a small downside that you can't skip allocating pages for the page array since it is not at the very end of memory anymore. This creates a waste of 3% of 3%. or .1% of memory. I find this acceptable.

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jeff created this revision.Aug 13 2019, 5:41 PM
jeff edited the summary of this revision. (Show Details)Aug 13 2019, 5:47 PM
jeff added reviewers: alc, kib, markj, gallatin.
kib added a comment.Aug 16 2019, 7:42 PM

I suspect the diff generation missed vm_phys.c.

1436 ↗(On Diff #60748)

spaces around '/'

1439 ↗(On Diff #60748)

and there

1593 ↗(On Diff #60748)

you probably can set pg_nx there.

1368 ↗(On Diff #60748)

Put {} around the loop body, it has more than one line.

1372 ↗(On Diff #60748)

And there too.

kib added inline comments.Aug 17 2019, 8:44 AM
230 ↗(On Diff #60748)

So the page array pml4 entry is just below DMAP, am I right ? And the large map max size is reduced by 512G ?

You should update the map in amd64/include/vmparam.h under the comment 'Virtual addresses of things'.

237 ↗(On Diff #60748)

This is strange, this line should be shown as changed. Do you have some issue with the patch generation ?

jeff updated this revision to Diff 60959.Aug 18 2019, 8:32 AM
jeff edited the summary of this revision. (Show Details)

Address review feedback. Move the page array between the direct map and kva.

jeff added inline comments.Aug 18 2019, 8:35 AM
230 ↗(On Diff #60748)

After this comment I decided to move it down and make sure it had a guard region on either side.

There was a gap between KPML4BASE and DMPML4I that was just big enough. If direct map must be naturally aligned then when it doubles there will still be space even if kva doubles.

I verified the vmparam.h values with gdb.

kib accepted this revision.Aug 18 2019, 6:43 PM
This revision is now accepted and ready to land.Aug 18 2019, 6:43 PM