From mboxrd@z Thu Jan 1 00:00:00 1970 Mime-Version: 1.0 (Apple Message framework v612) In-Reply-To: <5a05620eae26919c3e145b7cb21bf9e5@terzarima.net> References: <5a05620eae26919c3e145b7cb21bf9e5@terzarima.net> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <9962F440-6A2A-11D8-B24B-000A95D0C144@mightycheese.com> Content-Transfer-Encoding: 7bit From: Rob Pike Subject: Re: [9fans] Threads: Sewing badges of honor onto a Kernel To: 9fans@cse.psu.edu Date: Sat, 28 Feb 2004 12:13:40 -0800 Topicbox-Message-UUID: 031b4d82-eacd-11e9-9e20-41e7f4b1d025 >>> For Linux such experiments had been done and results were very clear >>> - >>> price of TLB flushes was considerable and that's aside of the >>> complexity >>> of supporting a lot of mappings with partial VM sharing. For Plan 9 >>> the > > were those real applications or a synthetic test? i'm curious what it > actually did. > sorry, wrong question. can you please point me to the paper and/or > file that might answer them? > i wonder about the claimed `complexity'. then again, i've seen > signal.h > not to mention sys/types.h mike burrows and i talked about this yesterday and concluded that there is certainly a cost for plan 9's model, since you must, depending on the MMU, do at least one of: - share the TLB among >1 task ids - fault in some MMU entries from memory after a context switch, since the root of the MMU tree must be different for each process. however, there are two mitigating factors. first, the cost of sharing the TLB will be very program dependent. sometimes it will hurt, but often it will not. for typical plan 9 programs with most of the non-main procs just doing an i/o loop, the cost will be minimal. for a program that's a multithreaded memset or its equivalent, it's probably a measurable factor but not deal-breaking except in unrealistic pathological situations. in any case, this issue matters more on MIPS-like MMUs than on the x86, i believe. second, the total overhead to fault in the TLB path to the pages you're using after a context switch is something like a couple of microseconds in current processors, perhaps as high as 10 microseconds for a very bad and unusual case. if those few microseconds are a performance issue for your program, you should be pretty happy. if performance is your dominant concern, you could turn these points into a condemnation of plan 9's model. i've never been in that position, though. for me, performance is but one factor in the figure of merit of a system and is often offset by other factors. -rob