Reducing Exception Management Overhead with Software Restart
Total Page:16
File Type:pdf, Size:1020Kb
Reducing Exception Management Overhead with Software Restart Markers by Mark Jerome Hampton Bachelor of Science in Computer and Systems Engineering Bachelor of Science in Computer Science Rensselaer Polytechnic Institute, May 1999 Master of Science in Electrical Engineering and Computer Science Massachusetts Institute of Technology, June 2001 Submitted to the Department of Electrical Engineering and Computer Science in partial fulfillment of the requirements for the degree of Doctor of Philosophy at the MASSACHUSETTS INSTITUTE OF TECHNOLOGY February 2008 c Massachusetts Institute of Technology 2008. All rights reserved. Author............................................................................ Department of Electrical Engineering and Computer Science February 1, 2008 Certified by........................................................................ Krste Asanovi´c Associate Professor Thesis Supervisor Accepted by....................................................................... Terry P. Orlando Chair, Department Committee on Graduate Students 2 Reducing Exception Management Overhead with Software Restart Markers by Mark Jerome Hampton Submitted to the Department of Electrical Engineering and Computer Science on February 1, 2008, in partial fulfillment of the requirements for the degree of Doctor of Philosophy Abstract Modern processors rely on exception handling mechanisms to detect errors and to implement various features such as virtual memory. However, these mechanisms are typically hardware- intensive because of the need to buffer partially-completed instructions to implement precise exceptions and enforce in-order instruction commit, often leading to issues with performance and energy efficiency. The situation is exacerbated in highly parallel machines with large quantities of programmer-visible state, such as VLIW or vector processors. As architects increasingly rely on parallel architectures to achieve higher performance, the problem of exception handling is becoming critical. In this thesis, I present software restart markers as the foundation of an exception handling mechanism for explicitly parallel architectures. With this model, the compiler is responsible for delimiting regions of idempotent code. If an exception occurs, the operat- ing system will resume execution from the beginning of the region. One advantage of this approach is that instruction results can be committed to architectural state in any order within a region, eliminating the need to buffer those values. Enabling out-of-order commit can substantially reduce the exception management overhead found in precise exception im- plementations, and enable the use of new architectural features that might be prohibitively costly with conventional precise exception implementations. Additionally, software restart markers can be used to reduce context switch overhead in a multiprogrammed environment. This thesis demonstrates the applicability of software restart markers to vector, VLIW, and multithreaded architectures. It also contains an implementation of this exception han- dling approach that uses the Trimaran compiler infrastructure to target the Scale vector- thread architecture. I show that using software restart markers incurs very little perfor- mance overhead for vector-style execution on Scale. Finally, I describe the Scale compiler flow developed as part of this work and discuss how it targets certain features facilitated by the use of software restart markers. Thesis Supervisor: Krste Asanovi´c Title: Associate Professor 3 4 Acknowledgments As I come to the end of this phase of my life, it seems insufficient to try to distill several years of interactions and relationships into a handful of paragraphs. Thankfully this isn’t like an awards show where the producers will start playing music to cut off winners who take too long with their speeches. I’m free to ramble as long as I want. But in the spirit of “less is more,” I will try to succinctly encapsulate my gratitude to those who have helped me get to this point. Of course, given my penchant for being long-winded, my “less” will almost certainly be somebody else’s “more.” First and foremost, I have to give thanks to God the Father, the Giver of every good and perfect gift, and to Jesus Christ, who strengthens me daily. They richly deserve glory for anything I have achieved during my tenure in graduate school, and for anything that I may achieve in the future. In this earthly realm, I of course have to start with my advisor, Professor Krste Asanovi´c. When I first came to MIT, I had no idea who he was, and was initially intent on trying to secure another professor as my advisor. However, after I saw Krste give a presentation on the work he was doing, I knew which group I wanted to join. And I’ve never regretted my decision. Many of my former group members and colleagues in other groups have used all kinds of superlatives to describe Krste in their own thesis acknowledgments, and all of those descriptions hold true. Krste’s breadth of knowledge, his ability to digest and analyze new material at a rapid rate, and his seemingly inexhaustible supply of energy that allows him to juggle a countless number of projects, are all, in a word, “scary.” And yet he was willing to tolerate the inadequacies of a grad student like myself, who came to MIT with relatively little understanding of computer architecture. Even though I may know much more now (in large part thanks to him), I still can’t hold a candle to his knowledge about such a vast array of subjects. I want to thank him for all of his support through the years (not just financial, although that is greatly appreciated as well), for fostering a great research group environment, and for indulging my fascination with exception handling. I thank Professor Saman Amarasinghe and Professor Arvind for serving on my thesis committee and for providing feedback on my work. I have interacted with many fellow students over the years who have enriched my ex- perience in grad school. I want to begin by acknowledging my two original officemates, with whom I have developed valuable relationships. Since I listed them in one order in the Acknowledgments section of my Master’s thesis, I list them in reverse order here. Jessica Tseng was the first person in Krste’s group whom I contacted when I came to MIT. She showed me how to use the simulator that I needed for my work, and then she subsequently became one of my officemates—and a very tolerant one at that, as she put up with my singing in the office. Even after we moved to different offices, I enjoyed being able to walk downstairs and strike up a conversation when I didn’t feel like doing any work (which occurred frequently). I want to thank her for her friendship and support. 5 Mike Zhang, my other original officemate, is truly passionate about his convictions, including his love of the Yankees. Our frequent arguments about creation vs. evolution were definitely interesting, and while it’s probably not the effect he intended, they also strengthened my faith. But at the end of the day, even though he may have viewed my religious convictions as silly, and I may have viewed his atheist beliefs as silly, we still respected one another, which was great. Ronny Krashinsky entered MIT at the same time I did, earned his Master’s degree at the same time I did, but then decided to break the mold and become a doctor before me. Given the vast amount of work that he did for his thesis, the fact that he was able to complete it when he did is truly awe-inspiring. I’m sure that no matter what lies in store for him, he will have a very successful future, and who knows, maybe someday I’ll be working for “Ronny, Inc.” after all. Heidi Pan, even though you decided you didn’t want to be my officemate anymore (just kidding), I appreciate the time that we did share an office—even if you didn’t want to get roped into the crazy discussions that the rest of us had. Steve Gerding, I’m very glad that Jessica, Mike, and I had to kick out our imaginary officemate and actually let a real person occupy the fourth spot in our office. Your devotion to all things related to Los Angeles—especially UCLA—is pretty scary, but also admirable in its steadfastness. Sam Larsen was responsible for the bulk of the compiler front end work that made it possible for me to use SUIF and Trimaran together. His thesis work also provided a template for my parallelization phase. Beyond those contributions, I thank him for the sense of humor he brought to the various discussions which took place in our office, even though he frequently looked so serious. I thank Mark Stephenson—a.k.a. “The Fastest Man in Computer Architecture”—not only for allowing me to witness his speed on the track (unofficially), but also for facilitating the only opportunity I had to practice my thesis defense. While I had hoped for a smoother presentation than actually occurred, the feedback I received was invaluable. Ian Bratt created the initial port of Trimaran for the RAW architecture that I was subsequently able to adapt for Scale. I thank all of the past and present members of Krste’s group, including Seongmoo Heo, Chris Batten, Ken Barr, Emmett Witchel, Albert Ma, Rose Liu, Jae Lee, and Asif Khan. I also thank other lab members whom I have had the pleasure to meet, including Rodric Rabbah, Mike Gordon, and Michal Karczmarek. Outside of the lab, my primary social and support network on campus consisted of members of the Black Graduate Student Association (BGSA) during the first half of my graduate career, and members of the Academy of Courageous Minority Engineers (ACME) during the second half of my graduate career. I thank BGSA for giving me a much-needed outlet for relieving stress, and I especially thank the members who helped convince me to 6 stay at MIT beyond my Master’s degree and to pursue a Ph.D.