{"id":37003,"date":"2004-12-15T07:01:00","date_gmt":"2004-12-15T07:01:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2004\/12\/15\/the-hunt-for-a-faster-syscall-trap\/"},"modified":"2004-12-15T07:01:00","modified_gmt":"2004-12-15T07:01:00","slug":"the-hunt-for-a-faster-syscall-trap","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20041215-00\/?p=37003","title":{"rendered":"The hunt for a faster syscall trap"},"content":{"rendered":"<p>The performance of the syscall trap gets a lot of attention.<\/p>\n<p> I was reminded of a meeting that took place between Intel and Microsoft over fifteen years ago.  (Sadly, I was not myself at this meeting, so the story is second-hand.) <\/p>\n<p> Since Microsoft is one of Intel&#8217;s biggest customers, their representatives often visit Microsoft to show off what their latest processor can do, lobby the kernel development team to support a new processor feature, and solicit feedback on what sort of features would be most useful to add. <\/p>\n<p> At this meeting, the Intel representatives asked, &#8220;So if you could ask for only one thing to be made faster, what would it be?&#8221; <\/p>\n<p> Without hesitation, one of the lead kernel developers replied, &#8220;Speed up faulting on an invalid instruction.&#8221; <\/p>\n<p> The Intel half of the room burst out laughing. &#8220;Oh, you Microsoft engineers are so funny!&#8221; And so the meeting ended with a cute little joke. <\/p>\n<p> After returning to their labs, the Intel engineers ran profiles against the Windows kernel and lo and behold, they discovered that Windows spent a lot of its time dispatching invalid instruction exceptions.  How absurd!  Was the Microsoft engineer not kidding around after all? <\/p>\n<p> No he wasn&#8217;t. <\/p>\n<p> It so happens that on the 80386 chip of that era, the fastest way to get from V86-mode into kernel mode was to execute an invalid instruction!  Consequently, Windows\/386 used an invalid instruction as its syscall trap. <\/p>\n<p> What&#8217;s the moral of this story?  I&#8217;m not sure. Perhaps it&#8217;s that when you create something, you may find people using it in ways you had never considered. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>The performance of the syscall trap gets a lot of attention. I was reminded of a meeting that took place between Intel and Microsoft over fifteen years ago. (Sadly, I was not myself at this meeting, so the story is second-hand.) Since Microsoft is one of Intel&#8217;s biggest customers, their representatives often visit Microsoft to [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[2],"class_list":["post-37003","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-history"],"acf":[],"blog_post_summary":"<p>The performance of the syscall trap gets a lot of attention. I was reminded of a meeting that took place between Intel and Microsoft over fifteen years ago. (Sadly, I was not myself at this meeting, so the story is second-hand.) Since Microsoft is one of Intel&#8217;s biggest customers, their representatives often visit Microsoft to [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/37003","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=37003"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/37003\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=37003"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=37003"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=37003"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}