fluidmem
fluidmem copied to clipboard
Test FluidMem with LRUBuffer size 1
I am facing an unexpected behavior when running a test with LRU size set to 1.
Here is the custom test that I run:
Expected behavior
FluidMem to capture 10 pagefaults in total. This is because the test case makes 10 accesses to 2 different pages in turn. Since the LRU buffer can only support 1 page, every access should result in a pagefault.
Actual results
From the ui tool, I get the following results:
Response received. size:357
LRU Buffer Size: 1
LRU Buffer Capacity: 1
Registered ufds: 0
Total Page Fault Count: 2
Zero Page Count: 2
Placed Data Page Count: 0
Zero Pages Encountered: 0
Page Eviction Count: 0
Cache Hit Count: 0
Cache Miss Count: 2
Cache Hit Percentage: 0
Writes Avoided: 0
Invalid Pages Dropped: 1
Page Fault Rate: 0.122843
Last Page Fault: [2020-08-31T21:40:30.693]
Also, FluidMem monitor process produces this log message:
[2020-08-31T21:40:30.692] [11749] [DEBG] (/home/anna/fluidmem/include/buffer_allocator_array.h:21) get_local_tmp_page: local_tmp_page=0x7f8d03d4b000
[2020-08-31T21:40:30.692] [11749] [DEBG] (userfault.c:672) evict_page: src: 0x161e000, dst 0x7f8d03d4b000, ufd: 9
[2020-08-31T21:40:30.692] [11749] [DEBG] (userfault.c:948) evict_to_externram: skipping page for invalid fd 9, rc: 22, pageaddr: 0x161e000
[2020-08-31T21:40:30.692] [11749] [DEBG] (userfault.c:1076) evict_to_externram: munmap to 0x7f8d03d4b000
[2020-08-31T21:40:30.693] [11749] [DEBG] (userfault.c:450) evict_if_needed: eviction of page 0x161e000 skipped
Steps to reproduce
Resize LRU Buffer to size 1:
ui 127.0.0.1 r 1
Compile the test case linking with userfault library
Run the test case
Notes
Is it possible this is related to the asynchronous eviction mechanism? I have also observed in another custom test bus error to occur in a non-deterministic manner. Also, from the "skipping page" log of monitor process, I have the suspicion that the program has exited, thus the ufd file descriptor is invalid for the UFFDIO_REMAP ioctl call.