Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possibly dead lock #2080

Closed
zhizhouzh opened this issue Jan 18, 2018 · 7 comments
Closed

possibly dead lock #2080

zhizhouzh opened this issue Jan 18, 2018 · 7 comments
Labels

Comments

@zhizhouzh
Copy link
Contributor

Hi experts,

I met a dead lock issue, the log is shown as below:

D/TC:1 pgt_alloc:527 Waiting for page tables
D/TC:1 __wq_rpc:38 sleep thread 1 0x100069158 -2 core/arch/arm/mm/pgt_cache.c:529
D/TC:0 __wq_rpc:38 sleep thread 0 0x1000695a8 1 core/kernel/tee_ta_manager.c:216
D/TC:2 tee_ta_close_session:403 tee_ta_close_session(0x8fb40)
D/TC:2 __wq_rpc:38 sleep thread 2 0x1000695a8 1 core/kernel/tee_ta_manager.c:216

It seems, one thread holds &tee_ta_mutex and tries to seize &pgt_mu by condvar_wait(&pgt_cv, &pgt_mu);. It's probably because of there is no enough pgt_cache entries, then this thread hangs itself to wait other thread to exit and to free pgt.

But on the other side, the other thread is waiting for &tee_ta_mutex in tee_ta_close_session(). But this lock is seized by the first thread. So this thread is not able to free pgt. Finally results dead lock.

Could anyone help to confirm it? Thanks!

@jenswi-linaro
Copy link
Contributor

Thanks @zhizhouzh, your analysis is correct as far as I can tell. I'll try to fix this.

@jenswi-linaro
Copy link
Contributor

Please test #2083 and tell if it fixes the deadlock.

@zhizhouzh
Copy link
Contributor Author

Thanks, This issue does not reproduce any more with this patchset.

@jforissier
Copy link
Contributor

Re-opening since the fix (#2083) causes stability issues, and was reverted (#2103).

@zhizhouzh
Copy link
Contributor Author

Hi, any updates about this issue? Thanks!

@jenswi-linaro
Copy link
Contributor

Unfortunately no.

@github-actions
Copy link

This issue has been marked as a stale issue because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.

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

No branches or pull requests

3 participants