Skip to content
Snippets Groups Projects
  • Nika Layzell's avatar
    645fce5d
    Bug 1841660 - Fix potential deadlock waiting for StartupCache ThreadedPrefetch, r=jesup a=RyanVM · 645fce5d
    Nika Layzell authored
    In a previous change to this logic, we missed a hidden early return in
    the `MMAP_FAULT_HANDLER_CATCH()` macro which can early return on both
    Linux and Windows. If this is hit, we could end up blocking at various
    points waiting for the StartupCache to be prefetched.
    
    This patch changes the logic to notify to happen in a ScopeExit instead,
    ensuring that it'll happen on all return paths.
    
    In addition, there was another potential deadlock due to the
    ThreadedPrefetch thread acquiring mTableLock. This was fixed by passing
    in the pointers in the runnable instead. This should be OK as we are
    making sure to block on ThreadedPrefetch before we clear the startup
    data already.
    
    Differential Revision: https://phabricator.services.mozilla.com/D182732
    645fce5d
    History
    Bug 1841660 - Fix potential deadlock waiting for StartupCache ThreadedPrefetch, r=jesup a=RyanVM
    Nika Layzell authored
    In a previous change to this logic, we missed a hidden early return in
    the `MMAP_FAULT_HANDLER_CATCH()` macro which can early return on both
    Linux and Windows. If this is hit, we could end up blocking at various
    points waiting for the StartupCache to be prefetched.
    
    This patch changes the logic to notify to happen in a ScopeExit instead,
    ensuring that it'll happen on all return paths.
    
    In addition, there was another potential deadlock due to the
    ThreadedPrefetch thread acquiring mTableLock. This was fixed by passing
    in the pointers in the runnable instead. This should be OK as we are
    making sure to block on ThreadedPrefetch before we clear the startup
    data already.
    
    Differential Revision: https://phabricator.services.mozilla.com/D182732