kernel icon indicating copy to clipboard operation
kernel copied to clipboard

add configuration and build instructions

Open matu3ba opened this issue 2 years ago • 3 comments
trafficstars

Common configuration bits for usage of external software are missing and lookup is not explained.

For example, things like rg 'define.*_SC_PAGE_SIZE' -B 1 --vimgrep do not return any results and I am surprised, that your unikernel does not support (configurable) paging for improved performance. The hermit-playground neither provides instruction for configuration.

Am I missing anything essential?

Posix specifies sysconf(_SC_PAGE_SIZE) to be used for the default page size the Kernel loader fills the aux vector with.

matu3ba avatar Aug 02 '23 20:08 matu3ba

We map more or less everything at boot time. Only the stack will be mapped on demand (4K pages). For the heap, we try to use 1G pages as much as possible. Afterwards, we use 2M pages and in the end 4K pages. Consequently, we try to optimize performance with the usage of large pages.

stlankes avatar Aug 10 '23 12:08 stlankes

For the heap, we try to use 1G pages as much as possible. Afterwards, we use 2M pages and in the end 4K pages. Consequently, we try to optimize performance with the usage of large pages.

So user space must assume 4KB page size then and code optimizations to take into account pointer alignment or page alignment sizes are not supported (yet)? As example, one may want to use as small as possible indices types (ie to use the additional bits for tagging) or could plan beforehand with internal fragmentation and without allocation, if the page size can be relied upon.

matu3ba avatar Aug 10 '23 13:08 matu3ba

Ah, you want to have a guarantee that the data is stored on a certain page size. Hm, currently, you have to assume 4K pages.

I will think about. Maybe be it exists a better solution to setup the heap.

stlankes avatar Aug 10 '23 13:08 stlankes