Page MenuHomeFreeBSD

jemalloc: set LG_VADDR to 64 on amd64
Needs ReviewPublic

Authored by kib on Mon, Sep 16, 11:10 PM.
Tags
None
Referenced Files
F95973637: D46686.diff
Mon, Sep 23, 5:13 AM
F95884714: D46686.diff
Sun, Sep 22, 11:03 PM
F95833656: D46686.id.diff
Sun, Sep 22, 7:31 PM
Unknown Object (File)
Sun, Sep 22, 5:35 AM
Unknown Object (File)
Sat, Sep 21, 5:04 PM
Unknown Object (File)
Sat, Sep 21, 10:29 AM
Unknown Object (File)
Sat, Sep 21, 10:29 AM
Unknown Object (File)
Sat, Sep 21, 10:29 AM
Subscribers

Details

Summary

The current value 48 causes immediate breakage on la57 kernels. In principle, the value can be increased to 57, but I do not see a reason.

With this change, and the series of fixes to the trampoline, I can boot la57 on real hardware.

PS. Arm64 would need a similar fix.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.Mon, Sep 16, 11:10 PM

I don't think you'll see any difference between 57 and 64.

It looks like LG_VADDR is used to decide which bits in an internal pointer can be reused. On arm64 if the value is at most 56 then RTREE_LEAF_COMPACT is defined so parts of the pointer are reused, if it's 57 then it's not and struct rtree_leaf_elm_s pulls the index and slab bit out.

On arm64 the value could be 52 for when FEAT_LPA2 is implemented.

Do you see any performance or memory usage change with this?

I don't think you'll see any difference between 57 and 64.

It looks like LG_VADDR is used to decide which bits in an internal pointer can be reused. On arm64 if the value is at most 56 then RTREE_LEAF_COMPACT is defined so parts of the pointer are reused, if it's 57 then it's not and struct rtree_leaf_elm_s pulls the index and slab bit out.

On arm64 the value could be 52 for when FEAT_LPA2 is implemented.

Do you see any performance or memory usage change with this?

Machine which I have is unusable for any perf work (BIOS is too broken). Perhaps I should add an option for small/large jemalloc VADDR. default to large?

kib added a reviewer: emaste.

Add build option to revert back to 48 bit wide.

tools/build/options/WITH_LG_VADDR_WIDE
3
kib marked an inline comment as done.

Fix grammar in the option' description.

share/mk/src.opts.mk
365–368

I don't think we generally have options that have a default on one arch and do not exist on other archs, ping @imp

What does make makeman think of this?

This will presumably be coming to at least arm64 as well it seems, and I imagine we should just have a MI on-by-default option for it.

Rename option to JEMALLOC_LG_ADDR_WIDE
Make it MI, with the only effect on amd64.