Skip to content

Commit

Permalink
[LibOS] Fix memmgr free list performance bug
Browse files Browse the repository at this point in the history
Fixes the memmgr performance bug described in gramineproject#2033 by changing the `CHECK_LIST_HEAD` macro in `common/include/list.h` in release mode to `(void)0`.

Signed-off-by: Adrian Lutsch <adrian.lutsch@cs.tu-darmstadt.de>
  • Loading branch information
adrianlut committed Nov 7, 2024
1 parent a08a455 commit 4f42e8d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions common/include/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@
(CURSOR) != (HEAD)->first && (HEAD)->first; (CURSOR) = (TMP), (TMP) = (TMP)->FIELD.next)

/* Assertion code written in Gramine project */
#ifdef DEBUG
#define CHECK_LIST_HEAD(TYPE, HEAD, FIELD) \
do { \
TYPE pos; \
Expand All @@ -290,6 +291,9 @@
assert(pos->FIELD.next->FIELD.prev == pos); \
} \
} while (0)
#else
#define CHECK_LIST_HEAD(TYPE, HEAD, FIELD) ((void)0)
#endif

// Add NEW to OLD at position first (assuming first is all we need for now)
// Can probably drop TYPE with some preprocessor smarts
Expand Down

0 comments on commit 4f42e8d

Please sign in to comment.