Skip to content

Conversation

@igchor
Copy link

@igchor igchor commented May 16, 2022

This change is Reviewable

@igchor igchor force-pushed the optimize_mmcontainer_locking_hetero branch 3 times, most recently from c6e0fd2 to ec20142 Compare June 2, 2022 10:28
Remove the item from mmContainer and drop the lock before attempting
eviction.

Use moving bit for synchronization in findEviction

moving bit is used to give exclusive right to evict the item
to a particular thread.

Originially, there was an assumption that whoever marked the item
as moving will try to free it until he succeeds. Since we don't want
to do that in findEviction (potentially can take a long time) we need
to make sure that unmarking is safe.

This patch checks the flags after unmarking (atomically) and if ref is
zero it also recyles the item. This is needed as there might be some
concurrent thread releasing the item (and decrementing ref count). If
moving bit is set, that thread would not free the memory back to
allocator, resulting in memory leak on unmarkMoving().
@igchor igchor force-pushed the optimize_mmcontainer_locking_hetero branch 2 times, most recently from 8938190 to 0f2fe81 Compare June 10, 2022 13:57
@igchor igchor force-pushed the optimize_mmcontainer_locking_hetero branch from ebff039 to ed2af50 Compare June 13, 2022 13:47
@igchor igchor merged commit 681bcbc into pmem:develop Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant