From owner-cvs-all@FreeBSD.ORG Wed Apr 2 22:34:24 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2698437B404; Wed, 2 Apr 2003 22:34:24 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 922ED43F85; Wed, 2 Apr 2003 22:34:22 -0800 (PST) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.8/8.12.8) with ESMTP id h336YK9o055217; Thu, 3 Apr 2003 08:34:21 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: Peter Wemm From: "Poul-Henning Kamp" In-Reply-To: Your message of "Wed, 02 Apr 2003 15:53:30 -0800." <200304022353.h32NrUVZ042513@repoman.freebsd.org> Date: Thu, 03 Apr 2003 08:34:20 +0200 Message-ID: <55216.1049351660@critter.freebsd.dk> cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/conf options.i386 src/sys/i386/i386 machdep.c mp_machdep.c pmap.c swtch.s src/sys/i386/include md_var.h pmap.h smp.h src/sys/i386/isa apic_vector.s intr_machdep.h src/sys/kern kern_switch.c kern_synch.c kern_thr.c kern_thread.c subr_witness.c ... X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2003 06:34:24 -0000 In message <200304022353.h32NrUVZ042513@repoman.freebsd.org>, Peter Wemm writes : >peter 2003/04/02 15:53:30 PST > > FreeBSD src repository > > Modified files: > sys/conf options.i386 > sys/i386/i386 machdep.c mp_machdep.c pmap.c swtch.s > sys/i386/include md_var.h pmap.h smp.h > sys/i386/isa apic_vector.s intr_machdep.h > sys/kern kern_switch.c kern_synch.c kern_thr.c > kern_thread.c subr_witness.c > sys/sparc64/sparc64 mp_machdep.c swtch.S > sys/sys proc.h > Log: > Commit a partial lazy thread switch mechanism for i386. it isn't as lazy > as it could be and can do with some more cleanup. Currently its under > options LAZY_SWITCH. What this does is avoid %cr3 reloads for short > context switches that do not involve another user process. A naïve benchmark consisting of dd if=/dev/ad0 of=/dev/null count=200000 run five times on a disk-less Athlon 700 in singleuser mode from a serial console indicates a pezzimization of about 2 microseconds for each sector read: With LAZY_SWITCH: S+ N 5 Average: 0.000310656 Stddev: 0.000000443 Without LAZY_SWITCH: S- N 5 Average: 0.000307986 Stddev: 0.000000618 Raw data: # S/U + LAZY echo -n "S+ " echo ' 102400000 bytes transferred in 61.990546 secs (1651865 bytes/sec) 102400000 bytes transferred in 62.175809 secs (1646943 bytes/sec) 102400000 bytes transferred in 62.144970 secs (1647760 bytes/sec) 102400000 bytes transferred in 62.117270 secs (1648495 bytes/sec) 102400000 bytes transferred in 62.227536 secs (1645574 bytes/sec) ' | awk 'NR > 0 && NF > 5 {print$5 / 200000.0}' | stddev # S/U - LAZY echo -n "S- " echo ' 102400000 bytes transferred in 61.495447 secs (1665164 bytes/sec) 102400000 bytes transferred in 61.732293 secs (1658775 bytes/sec) 102400000 bytes transferred in 61.688183 secs (1659961 bytes/sec) 102400000 bytes transferred in 61.444021 secs (1666558 bytes/sec) 102400000 bytes transferred in 61.626133 secs (1661633 bytes/sec) ' | awk 'NR > 0 && NF > 5 {print$5 / 200000.0}' | stddev -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.