Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the memory allocator of the standalone kernel #511

Open
tomaka opened this issue Jul 19, 2020 · 2 comments
Open

Change the memory allocator of the standalone kernel #511

tomaka opened this issue Jul 19, 2020 · 2 comments
Labels
A-standalone-arm Issues specific to ARM A-standalone-x86_64 Issues specific to x86_64

Comments

@tomaka
Copy link
Owner

tomaka commented Jul 19, 2020

At the moment we use the linked-list-allocator crate.
While it works fine, it is a very naive allocator and clearly isn't meant to be used when the load of allocations/deallocations is heavy.

Additionally, the allocator is single-threaded and is wrapped around a Spinlock. Multiple CPUs cannot at the moment allocate memory in parallel.

It would be rather hard to measure how much time the kernel spends inside of the memory allocator, but I can totally imagine a world where it is the allocator that is currently the biggest choke point.

@tomaka tomaka added A-standalone-arm Issues specific to ARM A-standalone-x86_64 Issues specific to x86_64 labels Jul 19, 2020
@tomaka
Copy link
Owner Author

tomaka commented Jul 19, 2020

It would be rather hard to measure how much time the kernel spends inside of the memory allocator,

It's actually not that hard. This patch shows that the median time for a memory allocation or deallocation seems to be around 256µs on QEmu.

@tomaka
Copy link
Owner Author

tomaka commented Jul 19, 2020

Note that 256µs remains a lot even from within an emulator. The time malloc takes on a desktop computer is more in the range of the hundreds of nanoseconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-standalone-arm Issues specific to ARM A-standalone-x86_64 Issues specific to x86_64
Projects
None yet
Development

No branches or pull requests

1 participant