From owner-freebsd-stable@FreeBSD.ORG Thu Dec 15 08:10:25 2005 Return-Path: X-Original-To: stable@freebsd.org Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 24AC316A41F for ; Thu, 15 Dec 2005 08:10:25 +0000 (GMT) (envelope-from PeterJeremy@optushome.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4D37943D55 for ; Thu, 15 Dec 2005 08:10:24 +0000 (GMT) (envelope-from PeterJeremy@optushome.com.au) Received: from cirb503493.alcatel.com.au (c220-239-19-236.belrs4.nsw.optusnet.com.au [220.239.19.236]) by mail07.syd.optusnet.com.au (8.12.11/8.12.11) with ESMTP id jBF8AGvt004722 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 15 Dec 2005 19:10:22 +1100 Received: from cirb503493.alcatel.com.au (localhost.alcatel.com.au [127.0.0.1]) by cirb503493.alcatel.com.au (8.12.10/8.12.10) with ESMTP id jBF8AGHh081019; Thu, 15 Dec 2005 19:10:16 +1100 (EST) (envelope-from pjeremy@cirb503493.alcatel.com.au) Received: (from pjeremy@localhost) by cirb503493.alcatel.com.au (8.12.10/8.12.9/Submit) id jBF8ABVg081018; Thu, 15 Dec 2005 19:10:11 +1100 (EST) (envelope-from pjeremy) Date: Thu, 15 Dec 2005 19:10:11 +1100 From: Peter Jeremy To: Scott Long Message-ID: <20051215081011.GK77268@cirb503493.alcatel.com.au> References: <20051214222037.94FEF5D07@ptavv.es.net> <43A0A812.1060104@samsco.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43A0A812.1060104@samsco.org> User-Agent: Mutt/1.4.2.1i X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc Cc: stable@freebsd.org Subject: Re: Odd performance problems after upgrade from 4.11 to 6.0-Stable X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Dec 2005 08:10:25 -0000 On Wed, 2005-Dec-14 16:17:38 -0700, Scott Long wrote: >Also, taking out CPU_I586 is usually a bad idea. It offers no >performance penalties (unlike CPU_I386 and maybe CPU_I486), but >enables things like optimized bcopy. This doesn't quite mesh with my reading of -current and -stable. The following refers only to x86 kernels. Kernel references to {bcopy,bzero,copyin,copyout}() indirect through {bcopy,bzero,copyin,copyout}_vector. This is initialised to generic_{bcopy,bzero,copyin,copyout} in i386/i386/support.s. *_vector is over-ridden with optimised routines as follows: bcopy_vector: - (effectively) never bzero_vector: - i486_bzero if (cpu_class == CPUCLASS_486) in sys/i386/i386/identcpu.c copyin_vector: - (effectively) never copyout_vector: - (effectively) never The i586 optimised routines are defined in sys/i386/i386/support.s but (effectively) never used since v1.101 of sys/i386/isa/npx.c changed '#ifdef I586_CPU' to '#ifdef I586_CPU_XXX' (in 2001/05/22 21:20:49). Even then, they are inside if (cpu_class == CPUCLASS_586) which is not true for P-II and later CPUs. That said, it might be worthwhile revisiting the issue of cpu-specific optimisations. If there is better code then generic_*() for Athlon or P4 CPUs, we should implement it. If there isn't, we can get a (slight) performance improvement by removing the indirection through *_vector - I suspect that CPUs can't predict/pipeline an indirect branch as well as a direct branch. -- Peter Jeremy