diff options
author | Maria Matejka <mq@ucw.cz> | 2023-05-05 09:39:13 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2023-05-06 10:50:32 +0200 |
commit | a95141111c89803347c36501185a76fc73a9764a (patch) | |
tree | a96a54914cf2498d02546ed49f8e2b852680229b /sysdep/unix/Makefile | |
parent | 00f30ac40bda76b289b1dc5c5aa8a5d2e4941985 (diff) |
Fixed a bug in hot page global storage
The original algorithm was suffering from an ABA race condition:
A: fp = page_stack
B: completely allocates the same page and writes into it some data
A: unsuspecting, loads (invalid) next = fp->next
B: finishes working with the page and returns it back to page_stack
A: compare-exchange page_stack: fp => next succeeds and writes garbage
to page_stack
Fixed this by using an implicit spinlock in hot page allocator.
Diffstat (limited to 'sysdep/unix/Makefile')
-rw-r--r-- | sysdep/unix/Makefile | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sysdep/unix/Makefile b/sysdep/unix/Makefile index 6f6b0d26..efbf3c70 100644 --- a/sysdep/unix/Makefile +++ b/sysdep/unix/Makefile @@ -5,4 +5,7 @@ $(cf-local) $(conf-y-targets): $(s)krt.Y src := $(filter-out main.c, $(src)) + +tests_src := alloc_test.c +tests_targets := $(tests_targets) $(tests-target-files) tests_objs := $(tests_objs) $(src-o-files) |