From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <13d15d40fb3dd28b987e0a0db26e3a5e.axp-list@archive.invalid> X-Archive-Original-Message-ID: <9610160906.ZM4094@vinnetou.site.cas.cz> Date: Wed, 16 Oct 1996 10:18:45 +0300 (EET DST) From: Linus Torvalds Subject: Re: Linux-2.1.4 In-Reply-To: <9610160531.AA04330@feral.com> On Tue, 15 Oct 1996, Matthew Jacob wrote: > > Linus wrote: > > > > - there are some functions that essentially think that user accesses are > > "cheap". They do loops like this: > > > > while (count) { > > count--; > > put_user(0,buff++); > > } > > But, Mr. Torvalds- this is actually one of the real reasons why > Linux has been so successful- it is *because* the slick x86 > inline stuff made it *really* fast (like, snappier than just > about everything....) Actually, the new code uses inline asm too, and it's a lot slicker than the old code. It's just that the new code _does_ a lot more (it essentially does both the old "put_user()" _and_ the old "verify_area()" code). Do take a look at include/asm-i386/segment.h. That's some _really_ hairy stuff to make all this go extremely fast. However, the old "while (count) do_one_byte()" stuff was _never_ very fast. It was slow before, and it just got slower. Doing things one byte at a time simply sucks, when you should do them at _least_ one long-word at a time. So the old code was bad, but it didn't show up as clearly before. It was particularly bad on an alpha, which doesn't even have any byte store instruction.. Trust me, the new code still _is_ snappier than just about everything. In fact, I can more-or-less guarantee that it cannot be done faster than we do it now (modulus some localized optimizations). But the new code is also _different_ than the old code, and doing loops a byte at a time degraded from just "stupid" (in 2.0.x) to outright "insane" (in 2.1.x). Linus -- To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null