Page MenuHomeFreeBSD

Allocate the vm_page_array on domain correct memory.

Authored by jeff on Aug 13 2019, 5:41 PM.
Referenced Files
F55859897: D21252.diff
Sat, Feb 4, 6:18 PM
Unknown Object (File)
Nov 26 2022, 2:54 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 - subversion
Lint Not Applicable
Tests Not Applicable

Event Timeline

jeff added reviewers: alc, kib, markj, gallatin.

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.

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 edited the summary of this revision. (Show Details)

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

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.

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