[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH 0/3] add support for generic memory allocators



"lib/ukalloc: implement new allocator helpers" implements new helpers for
generic, malloc based memory allocators.

However, using this patch with a generic allocator results in page fault
during uk_thread_current because the stack is not aligned at STACK_SIZE.
This is because the stack is allocated via palloc and not posix_memalign,
hence only guaranteeing page alignment.

"lib/uksched: use posix_memalign to allocate stack" addresses this issue.

Unfortunately, uk_posix_memalign_ifpages (default implementation of
posix_memalign in unikraft) does not support alignment > page size which
makes allocations aligned at STACK_SIZE impossible.

"lib/ukalloc: fix multiple issues in uk_posix_memalign_ifpages" adds
support for this to uk_posix_memalign_ifpages.

This patch also addresses an out-of-bounds issue in
uk_posix_memalign_ifpages, which previously resulted in page faults on
specific alignment and size values.

Hugo Lefeuvre (3):
  lib/ukalloc: fix multiple issues in uk_posix_memalign_ifpages
  lib/uksched: use posix_memalign to allocate stack
  lib/ukalloc: implement new allocator helpers

 lib/ukalloc/alloc.c                 | 73 ++++++++++++++++++++++++++++++++-----
 lib/ukalloc/exportsyms.uk           |  3 ++
 lib/ukalloc/include/uk/alloc_impl.h | 22 ++++++++++-
 lib/uksched/sched.c                 |  2 +-
 4 files changed, 89 insertions(+), 11 deletions(-)

-- 
2.7.4


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.