AIFM-sys / AIFM

AIFM: High-Performance, Application-Integrated Far Memory
MIT License
104 stars 34 forks source link

Log allocator mark-compact #2

Closed YangZhou1997 closed 3 years ago

YangZhou1997 commented 3 years ago

Hi,

Very nice code! Just wondering where you implement the log allocator mark-compact scheme, probably running in another thread somehow. But I could find the exact code location. Is it also in void FarMemManager::gc_cache(), where you do mark-evacuate for cold entries?

Here is the text quoted from the paper: near the end of sec5.2

To free an object, the runtime marks the object as free. AIFM leverages a mark- compact evacuator to achieve a low memory fragmentation ratio, as shown with other copying log allocators [63].

Best, Yang

zainryan commented 3 years ago

Hi Yang,

Thanks for your interest. Marking happens here. Compacting is part of the cold data write-back procedure which invokes the swap-out method on all marked objects; if it finds out that the object is hot, it will copy the object into a new location (i.e., compacting) rather than writing back the data to the remote.

Thanks, Zain

YangZhou1997 commented 3 years ago

Hi Zain,

Thanks for the quick reply! So it sounds that log allocator compaction is mixed with GC evacuation.

I also notice that in the log selection phase,

The evacuator picks logs in FIFO order from the global non-temporal used list, and then picks from the global temporal used list if necessary, to prioritize non-temporal objects. Does it mean the log allocation compaction also has such prioritization?

Best, Yang

zainryan commented 3 years ago

Yes, since it compacts selected logs.

YangZhou1997 commented 3 years ago

Cool. My puzzle resolved. Thanks!