Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • rust
  • kernel
  • time.rs
Find file BlameHistoryPermalink
  • Alice Ryhl's avatar
    rust: time: add msecs to jiffies conversion · 82e17087
    Alice Ryhl authored Jan 08, 2024
    
    
    Defines type aliases and conversions for msecs and jiffies.
    
    This is used by Rust Binder for process freezing. There, we want to
    sleep until the freeze operation completes, but we want to be able to
    abort the process freezing if it doesn't complete within some timeout.
    The freeze timeout is supplied in msecs.
    
    Note that we need to convert to jiffies in Binder. It is not enough to
    introduce a variant of `CondVar::wait_timeout` that takes the timeout in
    msecs because we need to be able to restart the sleep with the remaining
    sleep duration if it is interrupted, and if the API takes msecs rather
    than jiffies, then that would require a conversion roundtrip jiffies->
    msecs->jiffies that is best avoided.
    
    Suggested-by: default avatarBoqun Feng <boqun.feng@gmail.com>
    Reviewed-by: default avatarBoqun Feng <boqun.feng@gmail.com>
    Reviewed-by: default avatarBenno Lossin <benno.lossin@proton.me>
    Reviewed-by: default avatarMartin Rodriguez Reboredo <yakoyoku@gmail.com>
    Reviewed-by: default avatarTiago Lam <tiagolam@gmail.com>
    Signed-off-by: default avatarAlice Ryhl <aliceryhl@google.com>
    Link: https://lore.kernel.org/r/20240108-rb-new-condvar-methods-v4-2-88e0c871cc05@google.com
    
    
    Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
    82e17087
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7