From owner-freebsd-mips@FreeBSD.ORG Mon Nov 5 17:01:17 2012 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EA7DBE52 for ; Mon, 5 Nov 2012 17:01:17 +0000 (UTC) (envelope-from stas@freebsd.org) Received: from mx0.deglitch.com (cl-414.sto-01.se.sixxs.net [IPv6:2001:16d8:ff00:19d::2]) by mx1.freebsd.org (Postfix) with ESMTP id 9433E8FC0C for ; Mon, 5 Nov 2012 17:01:17 +0000 (UTC) Received: from [10.0.1.4] (c-71-198-21-109.hsd1.ca.comcast.net [71.198.21.109]) by mx0.deglitch.com (Postfix) with ESMTPSA id D5BFA8FC2B; Mon, 5 Nov 2012 21:01:13 +0400 (MSK) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: CACHE_LINE_SIZE macro. From: Stanislav Sedov In-Reply-To: Date: Mon, 5 Nov 2012 09:01:09 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <2427F526-B96B-49C2-ACCB-4AA51BDCB0D6@freebsd.org> References: <201211041828.qA4ISomC076058@pdx.rh.CN85.ChatUSA.com> To: Warner Losh X-Mailer: Apple Mail (2.1499) Cc: "Rodney W. Grimes" , Juli Mallett , "freebsd-mips@FreeBSD.org" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 17:01:18 -0000 On Nov 5, 2012, at 8:49 AM, Warner Losh wrote: >=20 > Is that an out-of-kernel interface? >=20 > If we did that, we'd have to make it run-time settable, because = there's no one right answer for arm and MIPS cpus: they are all = different. >=20 IIRC, several linux application use getconf to retrieve the host CPU = cache line value at the compile time to use for the alignment. I don't really like = this solution as it makes the binaries unportable between different CPUs. OTOH, it looks like at least for ARM all cpus with a certain ARM core = share the same cache line size, and we don't guarantee that e.g. ARMv5 executable = will be able to run on ARMv7 without performance penalty. So it might be a = good solution for ARM. I don't know about MIPS though. -- ST4096-RIPE