libhermit icon indicating copy to clipboard operation
libhermit copied to clipboard

Set page size to 2MB

Open stlankes opened this issue 7 years ago • 8 comments

To reduce the TLB misses, we should per default use a page size of 2MB. Currently, only the code and bss segment use a page size of 2MB.

stlankes avatar Apr 15 '17 07:04 stlankes

Any chance this will be configurable via cmake / compiler switch? L2 TLB was unified with Haswell (1024 entries for 4K/2MB pages, 8 way associative), but L1 TLB is still 128 entries for 4K pages, 8 way associative / 8 per thread for 2 MB pages. I am wondering if one can see a difference on some workloads.

If you are looking into automatic stuff like this based on the hardware see Processor Identification CPUID Instruction Note.pdf

jbreitbart avatar Apr 15 '17 12:04 jbreitbart

@stlankes Is this issue open to working on?

yash982000 avatar Oct 09 '20 06:10 yash982000

Hello @stlankes ! Right now I am working on this project as my University course project and I am keen to solve this issue and do the enhancement if possible. Can you please guide me by throwing some light on this problem?

Thank you in advance!

meetakbari avatar Dec 02 '20 12:12 meetakbari

Do you want to develop this feature on the C version? The Rust version is more active and easier to support.

stlankes avatar Dec 02 '20 12:12 stlankes

@stlankes Is it possible to first develop on C and then on Rust? We have no issues with the rust version but just the issue is we don't know rust language. So, will that be an issue? If not, we can try to develop it on rust and later see for the relevant changes in C.

yash982000 avatar Dec 02 '20 12:12 yash982000

FYI. @stlankes me and @yash982000 are in same team.

meetakbari avatar Dec 02 '20 12:12 meetakbari

AFAIK the Rust version already uses LargePages. Besides that, I think that porting code from C to Rust is only applicable in limited cases, as the languages simply work a bit different. @meet-akbari you can of course try to tackle the issue, but keep in mind that this is not an easy issue, it requires a lot of testing for correctness, and the impact will be little, as Hermitcore is not developed active anymore.

If you need some resources to get some technical background:

  • https://wiki.osdev.org/Paging
  • https://wiki.osdev.org/Page_Tables
  • https://cirosantilli.com/x86-paging

jounathaen avatar Dec 02 '20 22:12 jounathaen

Okay! Thank you @jounathaen for your guidance and suggestion. As you have said it is not an easy issue, but still we will try it out by going through the resources you have given and some of by ourselves.

meetakbari avatar Dec 03 '20 04:12 meetakbari