avoiding scheduler subversion using scheduler cooperative
play

Avoiding Scheduler Subversion using Scheduler - Cooperative Locks - PowerPoint PPT Presentation

Avoiding Scheduler Subversion using Scheduler - Cooperative Locks Yuvraj Patel , Leon Yang , Leo Arulraj , Andrea Arpaci - Dusseau , Remzi Arpaci - Dusseau , Michael Swift University of Wisconsin - Madison Once upon a time .... Processes P0 P1


  1. Avoiding Scheduler Subversion using Scheduler - Cooperative Locks Yuvraj Patel , Leon Yang , Leo Arulraj , Andrea Arpaci - Dusseau , Remzi Arpaci - Dusseau , Michael Swift University of Wisconsin - Madison

  2. Once upon a time .... Processes P0 P1 Accessing a kernel service 1

  3. Once upon a time .... Processes P0 P1 Default priority Accessing a kernel service 1

  4. Once upon a time .... *Linux CFS Scheduler Processes P0 P1 Accessing a kernel service Default priority 1

  5. Schedulers are important for resource sharing 2

  6. Let us now introduce a lock .... 3

  7. A ticket lock reduces wait - time and avoids starvation 4

  8. If P0 holds the lock twice as long as P1 5

  9. P1 If P0 holds the lock P0 twice as long as P1 Time 5

  10. P1 If P0 holds the lock P0 twice as long as P1 Time While in critical section, P0 uses twice much CPU as P1 5

  11. P1 If P0 holds the lock P0 twice as long as P1 Time 5

  12. P1 If P0 holds the lock P0 twice as long as P1 Time 5

  13. P1 If P0 holds the lock P0 twice as long as P1 Time Every time P0 enters critical section, it uses twice as much CPU as P1 5

  14. Despite 50 : 50 allocation , P0 uses twice as much CPU as P1 ' s 6

  15. Scheduler Subversion Locks determine the CPU allocation instead of the scheduler 7

  16. When does scheduler subversion happen ? 8

  17. Two reasons 9

  18. Different critical section lengths 10

  19. Different critical section lengths Thread dwelling longer in critical section becomes dominant user of CPU 11

  20. Majority locked run time 12

  21. Majority locked run time Threads have to spend a lot of time in the critical section 1 , 2 , 3 , 4 and it is often a case 1 . Lock – Unlock : Is That All ? A Pragmatic Analysis of Locking in Software Systems . ACM Trans . Comput . Syst ., 36 ( 1 ), March 2019 . 2 . Remote Core Locking : Migrating Critical - Section Execution to Improve the Performance of Multithreaded Applications . USENIX ATC 2012 3 . Understanding Manycore Scalability of File Systems , USENIX ATC 2016 4 . Non - scalable locks are dangerous . Linux Symposium , 2012 13

  22. Every concurrent system can be prone to scheduler subversion 14

  23. Remedy 15

  24. Three design components Track lock usage of users 16

  25. Three design components Example x Track lock usage of users P1 Track the time P0 spent by each process in critical section 16

  26. Three design components Example x Track lock usage of users P1 Track the time P0 spent by each process in 2x critical section 16

  27. Three design components Example x Track lock usage of users P1 P0 Penalize dominant users 2x 16

  28. Three design components Example x Track lock usage of users P1 Penalize while P0 acquiring the Penalize dominant users lock again 2x 16

  29. Three design components Example x x Track lock usage of users P1 P0 Penalize dominant users 2x 16

  30. Three design components Example x x Track lock usage of users P1 P0 Penalize dominant users 2x Provide appropriate opportunity to each user 16

  31. Three design components Example x x x Track lock usage of users P1 P0 Penalize dominant users 2x Penalizing P0 creates Provide appropriate enough opportunity to let P1 acquire the opportunity to each user lock multiple times 16

  32. Three design components Example x x x Track lock usage of users P1 P0 Penalize dominant users 2x Opportunity depends on Provide appropriate the scheduling goals opportunity to each user 16

  33. Scheduler - Cooperative Locks ( SCL ) Ticket Lock SCL 17

  34. Conclusion We introduce the scheduler subversion problem We introduce scheduler - cooperative locks ( SCL ) to mitigate scheduler subversion

  35. Thank you !!! Queries ??

Recommend


More recommend