Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.mira.net.au!news.vbc.net!vbcnet-west!samba.rahul.net!rahul.net!a2i!olivea!news.sgi.com!enews.sgi.com!decwrl!tribune.usask.ca!rover.ucs.ualberta.ca!gpu5.srv.ualberta.ca!not-for-mail From: jgg@gpu5.srv.ualberta.ca (J Gunthorpe) Newsgroups: comp.os.linux.misc,comp.os.linux.networking,comp.os.linux.setup,comp.unix.bsd.bsdi.misc,comp.unix.bsd.misc Subject: Re: User-space file systems. (Re: Linux vs BSD) Followup-To: comp.os.linux.misc,comp.os.linux.networking,comp.os.linux.setup,comp.unix.bsd.bsdi.misc,comp.unix.bsd.misc Date: 6 Mar 1997 17:11:53 GMT Organization: University of Alberta Lines: 69 Message-ID: <5fmtsp$112u@pulp.ucs.ualberta.ca> References: <5e6qd5$ivq@cynic.portal.ca> <5fj9q4$s0i@pulp.ucs.ualberta.ca> <5fjek4$gtm@cynic.portal.ca> <5fl7gf$urs@pulp.ucs.ualberta.ca> <5flmlf$6a3@cynic.portal.ca> NNTP-Posting-Host: gpu5.srv.ualberta.ca X-Newsreader: TIN [UNIX 1.3 950824BETA PL0] Xref: euryale.cc.adfa.oz.au comp.os.linux.misc:163066 comp.os.linux.networking:71033 comp.os.linux.setup:101235 comp.unix.bsd.bsdi.misc:6230 comp.unix.bsd.misc:2734 Curt Sampson (cjs@cynic.portal.ca) wrote: : In article <5fl7gf$urs@pulp.ucs.ualberta.ca>, : J Gunthorpe <jgg@gpu3.srv.ualberta.ca> wrote: : : >Full User-User Switch Times: : >QNX 4.2 (P5/133) 1.73 secs, 57.65/millisec 17 microsec/switch : >Linux (P5/120) 5.59 secs, 17.90/millisec 56 microsec/switch : : Well, let's assume for the sake of argument that QNX is doing a : protection mode change with every kernel/user boundary crossing. : (I don't know if this is the case.) Assuming they've optimised it Neigther do I, but I'm not sure how they could transition from Ring3 tasks to Ring 0 tasks without it. (QNX can run processes at Ring 0, for device manager) : so well that that 17 microseconds is mostly the protection mode : changes at two boundary crossings, we're talking about well over : 30 microseconds spent doing boundary crossings for every NFS request. : A Pentium CPU can do a fair amount of work in 30 microseconds. Why : do you want to throw this work away? Keep in mind that the kernel has to do a protection switch at somepoint to get from whatever is executing NOW to the NFS code when a packet comes in, you can't advoid them they happen constantly. By taking 20ums off switch times you could easially increase the speed of everything. The times the QNX ppl qoute on their web page are actually considerably lower than what that benchmark measured.. Context switching: 3.1 microseconds (full, user-level switch) Interrupt latency: 4.3 microseconds Scheduling latency: 7.8 microseconds * Measured on a Pentium/133 with an Adaptec 2940 Wide SCSI I'm not sure why these number are so different than the above, possibly marketing, or just the test program didn't actualy test context switch times on QNX (It has a disclaimer about 'adding in other factors'). For the sake of theory, if you could switch task-task in 3.1us, would you make a userland NFS daemon? TCP/IP Stack? Network layer? Filesystem? I would ;> Actually, I do have 1 question, you have been saying a protection switch is taking > 20 us (Is it even that much?) but have you run/seen any benchmarks on things like this? 20us is an awefull lot of time for a P120, lets say it does 120MIPS, that's about 2400 instructions! A quick look at my asm guide shows that on a 486 a call through a call gate can take > 77 Clock cycles to complete, a pretty big time, but not a horrific time, and not at all close to 20us. If you ever see a single CPU instruction which takes 20us to execute on a P120 be very afraid! : quick bit of code to deal with requests, to save on that side of : it as well (so we've just saved 1 and 2), and we're set. Oops! : We've just put an NFS server in the kernel! Well, no, you've put a 'generic' nfs server in the kernel, at least that would be the idea. Add a call that can benifite alot of applications, and not just NFS. Ie a Web server could use this FD/FD copy to stream files from the disk to the network, 1 call to send a whole web document etc. : That's all right. I am. If you doubt, compare, say, NetBSD to : Windows NT. (The easiest way to do this is to read the paper on : this in the Feb. '96 _ACM Transactions on Computing_.) Protection : mode switches kill NT performance. If you ask me NT is not exactly the model micro kernel, if it could even be called that. (Marketing speak in alot of cases) Jason