[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH v7 0/5] add support for generic memory allocators
This patch series addresses a few bugs and design issues in ukalloc in order to ease the port of new allocators to unikraft. "lib/ukalloc: cleanup page allocation interface" and "lib/ukalloc: change page allocation api to take a number of pages" both clean up the memory allocation api, removing unused macros, undefined functions and modifying the palloc and pfree api to take as parameter a number of pages instead of an order. "lib/ukalloc: implement new allocator helpers" implements new helpers for generic, malloc based memory allocators. Unfortunately, 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. We address this issue in "lib/uksched: use posix_memalign to allocate stack" and "lib/ukalloc: fix multiple issues in uk_posix_memalign_ifpages" which adds support for alignment > page size to uk_posix_memalign_ifpages. This patch also addresses an out-of-bounds issue in uk_posix_memalign_ifpages with allocation aligned at less than a page. Changes v7: - fix style issues reported by checkpatch - update a few comments for clarity - fix typos in commit messages - in "lib/ukalloc: fix multiple issues in uk_posix_memalign_ifpages": check for ptr >= __PAGE_SIZE + sizeof(struct metadata_ifpages) instead of ptr > __PAGE_SIZE (see comments). - change uk_alloc_init_malloc to rather be a helper that initializes the struct for allocators that just don't support palloc() and pfree(). Hugo Lefeuvre (5): lib/ukalloc: cleanup page allocation interface lib/ukalloc: change page allocation api to take a number of pages 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/Config.uk | 6 -- lib/ukalloc/alloc.c | 199 ++++++++++++++++++++++++------------ lib/ukalloc/exportsyms.uk | 3 + lib/ukalloc/include/uk/alloc.h | 46 ++++----- lib/ukalloc/include/uk/alloc_impl.h | 32 ++++-- lib/ukallocbbuddy/Config.uk | 1 - lib/ukallocbbuddy/bbuddy.c | 26 ++++- lib/uksched/sched.c | 4 +- plat/xen/drivers/9p/9pfront.c | 14 +-- plat/xen/drivers/blk/blkfront.c | 4 +- plat/xen/gnttab.c | 2 +- plat/xen/x86/mm.c | 10 +- 12 files changed, 224 insertions(+), 123 deletions(-) -- 2.7.4 _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |