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

[Minios-devel] [UNIKRAFT/RUBY PATCH 07/16] patches: Limit all memory allocations to maximum 4K bytes



We currently do not support allocations greater than 4K and that is because we
do not have a proper page tables implementation yet and a complete mmap()
implementation. Therefore this patch should be removed when we will have these
in Unikraft.

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 ...01-Set-maximum-allocation-size-to-4K.patch | 42 +++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 patches/0001-Set-maximum-allocation-size-to-4K.patch

diff --git a/patches/0001-Set-maximum-allocation-size-to-4K.patch 
b/patches/0001-Set-maximum-allocation-size-to-4K.patch
new file mode 100644
index 0000000..f0edcfd
--- /dev/null
+++ b/patches/0001-Set-maximum-allocation-size-to-4K.patch
@@ -0,0 +1,42 @@
+From 2cf7cf83a62d613255bfbe60a5f3b52bff94594a Mon Sep 17 00:00:00 2001
+From: Costin Lupu <costin.lupu@xxxxxxxxx>
+Date: Sun, 1 Dec 2019 12:38:07 +0200
+Subject: [PATCH] Set maximum allocation size to 4K
+
+This should be reverted once we will have page tables support.
+
+Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
+---
+ gc.c             | 2 +-
+ transient_heap.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gc.c b/gc.c
+index 0df7189..f926c69 100644
+--- a/gc.c
++++ b/gc.c
+@@ -650,7 +650,7 @@ typedef struct rb_objspace {
+ 
+ 
+ /* default tiny heap size: 16KB */
+-#define HEAP_PAGE_ALIGN_LOG 14
++#define HEAP_PAGE_ALIGN_LOG 12
+ #define CEILDIV(i, mod) (((i) + (mod) - 1)/(mod))
+ enum {
+     HEAP_PAGE_ALIGN = (1UL << HEAP_PAGE_ALIGN_LOG),
+diff --git a/transient_heap.c b/transient_heap.c
+index 55a7963..01bdac2 100644
+--- a/transient_heap.c
++++ b/transient_heap.c
+@@ -51,7 +51,7 @@
+ #define TRANSIENT_HEAP_PROMOTED_DEFAULT_SIZE 1024
+ 
+                                           /*  K      M */
+-#define TRANSIENT_HEAP_BLOCK_SIZE  (1024 *   32       ) /* 32KB int16_t */
++#define TRANSIENT_HEAP_BLOCK_SIZE  (1024 *    4       ) /* 32KB int16_t */
+ #define TRANSIENT_HEAP_TOTAL_SIZE  (1024 * 1024 *   32) /* 32 MB */
+ #define TRANSIENT_HEAP_ALLOC_MAX   (1024 *    2       ) /* 2 KB */
+ #define TRANSIENT_HEAP_BLOCK_NUM   (TRANSIENT_HEAP_TOTAL_SIZE / 
TRANSIENT_HEAP_BLOCK_SIZE)
+-- 
+2.20.1
+
-- 
2.20.1


_______________________________________________
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®.