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

[Minios-devel] [UNIKRAFT PATCH v2 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.

Changes v2:
  - define uk_alloc_order_to_size as a macro instead of static inline
  - use __unused instead of __attribute__((unused))
  - define _compat helpers outside of #if CONFIG_LIBUKALLOC_IFPAGES block

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                 | 69 ++++++++++++++++++++++++++++++++-----
 lib/ukalloc/exportsyms.uk           |  3 ++
 lib/ukalloc/include/uk/alloc_impl.h | 22 +++++++++++-
 lib/uksched/sched.c                 |  2 +-
 4 files changed, 85 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®.