Skip to content
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.

When to enable memory pool locks #4

Open
hkim15 opened this issue Jun 29, 2019 · 0 comments
Open

When to enable memory pool locks #4

hkim15 opened this issue Jun 29, 2019 · 0 comments

Comments

@hkim15
Copy link
Contributor

hkim15 commented Jun 29, 2019

mpool_locks_enabled begin with false initially, It is set to true only after Hafnium's own stage-1 page table is intialized.

/* Enable locks now that mm is initialised. */
dlog_enable_lock();
mpool_enable_locks();

According to the comment, it appears that the author thought lock should be enabled because Hafnium's stage-1 page table is initialized. Stage-1 page table does not appear relevant. But, presence of multiple, competing threads should have triggered switching from false to true.

In the current code, there is only one thread available when one_time_init() is executed. Therefore, it should be safe to move both dlog_enable_lock() and mpool_enable_locks() to the end of one_time_init(), where TLB invalidation is turned on.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant