Page MenuHomeFreeBSD

Allocate the vm_page_array on domain correct memory.
ClosedPublic

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

Details

Summary

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

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

Event Timeline

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

I suspect the diff generation missed vm_phys.c.

sys/amd64/amd64/pmap.c
1436 ↗(On Diff #60748)

spaces around '/'

1439 ↗(On Diff #60748)

and there

1593 ↗(On Diff #60748)

you probably can set pg_nx there.

sys/vm/vm_reserv.c
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.Sat, Aug 17, 8:44 AM
sys/amd64/include/pmap.h
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)Sun, Aug 18, 8:32 AM
jeff updated this revision to Diff 60959.

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

jeff added inline comments.Sun, Aug 18, 8:35 AM
sys/amd64/include/pmap.h
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.Sun, Aug 18, 6:43 PM
This revision is now accepted and ready to land.Sun, Aug 18, 6:43 PM