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

Wrap mutable states of VCpu with SpinLock (partially done) #39

Merged
merged 17 commits into from Aug 29, 2019

Conversation

efenniht
Copy link
Collaborator

@efenniht efenniht commented Aug 27, 2019

이 PR은 아직 완성된 것은 아닙니다. 개인적인 생각으로는,

  • Cpuis_on 그리고 lock이 굉장히 수상합니다. is_on을 수정할 때만 락을 거는 게 아니라 실제로 PSCI에 명령을 주고 완료될 때까지 걸려있어야 할 것 같아요. 별로 좋은 생각이 아니었습니다.
  • VCpuLockedPair 라는 이름과 그 방식이 너무 구려요. 더 좋은 방법을 생각해야 합니다.
  • VCpuInner는 락이 걸리면서 그 내부가 invalidate됩니다. 타입으로 나타내면 좋을 듯...? AtomicOption 따위가 없을까요?
  • VCpuInner의 락 (execution_lock)은 다른 하프늄의 락과 달리 하프늄을 벗어날 때 락이 걸려 있습니다. 지금은 문제가 없지만 한 VCPU가 Hafnium을 통해 다른 VCPU를 접근할 때는 매우 조심해야 합니다.
    • 다른 VCPU의 락을 걸지 못합니다. 기본적으로 락을 거는 행위가 실행 중을 나타내는 시멘틱이기도 하고, 락을 걸다가 deadlock이 터질 수도 있습니다 (lock ordering 규칙을 만족하기 어려워요)
    • 그래서 접근하려는 다른 VcpuInner에 대한 락이 안 걸려 있는 지 수동으로 체크해야 합니다.

Copy link
Member

@jeehoonkang jeehoonkang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 일단 코멘트 남깁니다.
  • 이 PR은 제가 마무리할게요. 애써주셔서 감사합니다!

hfo2/src/spinlock.rs Outdated Show resolved Hide resolved
hfo2/src/cpu.rs Outdated Show resolved Hide resolved
hfo2/src/cpu.rs Outdated Show resolved Hide resolved
hfo2/src/cpu.rs Outdated Show resolved Hide resolved
hfo2/src/cpu.rs Outdated Show resolved Hide resolved
hfo2/src/api.rs Outdated Show resolved Hide resolved
hfo2/src/api.rs Outdated Show resolved Hide resolved
hfo2/src/api.rs Show resolved Hide resolved
hfo2/src/api.rs Outdated Show resolved Hide resolved
hfo2/src/api.rs Outdated Show resolved Hide resolved
@efenniht efenniht marked this pull request as ready for review August 28, 2019 01:29
@efenniht
Copy link
Collaborator Author

@jeehoonkang 제 생각이 따로 있는 것들에 대해서는 모두 댓글을 달았습니다. 감사합니다 (__)

@efenniht efenniht merged commit b633e69 into kaist-cp:hfo2 Aug 29, 2019
@efenniht efenniht deleted the hfo2-17-api-cpu branch August 29, 2019 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants