Redflag: A Framework for Analysis of Kernel-Level Concurrency

  • Justin Seyster
  • Prabakar Radhakrishnan
  • Samriti Katoch
  • Abhinav Duggal
  • Scott D. Stoller
  • Erez Zadok
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7016)

Abstract

Although sophisticated runtime bug detection tools exist to root out several kinds of concurrency errors, they cannot easily be used at the kernel level. Our Redflag framework and system seeks to bring these essential techniques to the Linux kernel by addressing issues faced by other tools. First, other tools typically examine every potentially concurrent memory access, which is infeasible in the kernel because of the overhead it would introduce. Redflag minimizes overhead by using offline analysis together with an efficient in-line logging system and by supporting targeted configurable logging of specific kernel components and data structures. Targeted analysis reduces overhead and avoids presenting developers with error reports for components they are not responsible for. Second, other tools do not take into account some of the synchronization patterns found in the kernel, resulting in false positives. We explore two algorithms for detecting concurrency errors: one for race conditions and another for atomicity violations; we enhanced them to take into account some specifics of synchronization in the kernel. In particular, we introduce Lexical Object Availability (LOA) analysis to deal with multi-stage escape and other complex order-enforcing synchronization. We evaluate the effectiveness and performance of Redflag on two file systems and a video driver.

Keywords

Atomic Region Data Race Detect Concurrency Error Concurrency Error Atomicity Violation 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Bacik, J.: Possible race in btrfs (2010), http://article.gmane.org/gmane.comp.file-systems.btrfs/5243/
  2. 2.
    Callanan, S., Dean, D.J., Zadok, E.: Extending GCC with modular GIMPLE optimizations. In: Proceedings of the 2007 GCC Developers’ Summit, Ottawa, Canada (July 2007)Google Scholar
  3. 3.
    Corbet, J. write(), thread safety, and POSIX, http://lwn.net/Articles/180387/
  4. 4.
    Engler, D., Ashcraft, K.: RacerX: effective, static detection of race conditions and deadlocks. In: Proceedings of the 19th ACM Symposium on Operating Systems Principles, pp. 237–252. ACM Press, New York (2003)Google Scholar
  5. 5.
    Erickson, J., Musuvathi, M., Burckhardt, S., Olynyk, K.: Effective data-race detection for the kernel. In: 9th USENIX Symposium on Operating Systems Design and Implementation (OSDI). USENIX Association, Berkeley (2010)Google Scholar
  6. 6.
    Flanagan, C., Freund, S.N.: Atomizer: A dynamic atomicity checker for multithreaded programs. In: POPL 2004: Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 256–267. ACM, New York (2004)Google Scholar
  7. 7.
    Flanagan, C., Qadeer, S.: A type and effect system for atomicity. In: Proc. ACM SIGPLAN Conference on Programming Language Design and IMPLEMENTATION (PLDI), pp. 338–349. ACM Press, New York (2003)Google Scholar
  8. 8.
    Lamport, L.: Time, clocks, and the ordering of events in a distributed system. Communications of the ACM 21(7), 558–565 (1978)CrossRefMATHGoogle Scholar
  9. 9.
    Lipton, R.J.: Reduction: A method of proving properties of parallel programs. Commun. ACM 18(12), 717–721 (1975)MathSciNetCrossRefMATHGoogle Scholar
  10. 10.
    Lu, S., Tucek, J., Qin, F., Zhou, Y.: AVIO: Detecting atomicity violations via access interleaving invariants. In: ASPLOS-XII: Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems, pp. 37–48. ACM, New York (2006)CrossRefGoogle Scholar
  11. 11.
    Marino, D., Musuvathi, M., Narayanasamy, S.: LiteRace: Effective sampling for lightweight data-race detection. In: PLDI 2009: Proceedings of the 2009 ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 134–143. ACM, New York (2009)CrossRefGoogle Scholar
  12. 12.
  13. 13.
    Park, S., Lu, S., Zhou, Y.: Ctrigger: exposing atomicity violation bugs from their hiding places. In: Proc. 14th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), pp. 25–36. ACM, New York (2009)CrossRefGoogle Scholar
  14. 14.
    Sasturkar, A., Agarwal, R., Wang, L., Stoller, S.D.: Automated type-based analaysis of data races and atomicity. In: Proceedings of the Tenth ACM/SIGPLAN Symposium on Principles and Practice of Parallel Programming (June 2005)Google Scholar
  15. 15.
    Savage, S., Burrows, M., Nelson, G., Sobalvarro, P., Anderson, T.: ERASER: A Dynamic Data Race Detector for Multithreaded Programs. ACM Transactions on Computer Systems 15(4), 391–411 (1997)CrossRefGoogle Scholar
  16. 16.
    Modak, S.: Linux Test Project, LTP (2009), http://ltp.sourceforge.net/
  17. 17.
    Voung, J.W., Jhala, R., Lerner, S.: RELAY: static race detection on millions of lines of code. In: FSE 2007: Proceedings of the 6th ESEC/SIGSOFT International Symposium on Foundations of Software Engineering, pp. 205–214. ACM, New York (2007)Google Scholar
  18. 18.
    Wang, L., Stoller, S.D.: Run-time analysis for atomicity. In: Proceedings of the Third Workshop on Runtime Verification (RV). Electronic Notes in Theoretical Computer Science, vol. 89(2), Elsevier, Amsterdam (2003)Google Scholar
  19. 19.
    Wang, L., Stoller, S.D.: Runtime analysis of atomicity for multithreaded programs. IEEE Trans. Softw. Eng. 32(2), 93–110 (2006)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Justin Seyster
    • 1
  • Prabakar Radhakrishnan
    • 1
  • Samriti Katoch
    • 1
  • Abhinav Duggal
    • 1
  • Scott D. Stoller
    • 1
  • Erez Zadok
    • 1
  1. 1.Department of Computer ScienceStony Brook UniversityUSA

Personalised recommendations