From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8846 invoked by alias); 19 Nov 2013 20:56:50 -0000 Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org Received: (qmail 8830 invoked by uid 89); 19 Nov 2013 20:56:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=AWL,BAYES_50,RDNS_NONE autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from Unknown (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 19 Nov 2013 20:56:49 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1VisLY-0001NX-K1 from Maciej_Rozycki@mentor.com ; Tue, 19 Nov 2013 12:56:33 -0800 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 19 Nov 2013 12:56:32 -0800 Received: from [172.30.64.178] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Tue, 19 Nov 2013 20:56:30 +0000 Date: Wed, 20 Nov 2013 19:57:00 -0000 From: "Maciej W. Rozycki" To: Andrew Pinski CC: Andrew Stubbs , "libc-ports@sourceware.org" Subject: Re: [PATCH] PAGE_SIZE definition for MIPS XLP In-Reply-To: Message-ID: References: <528A0813.10005@codesourcery.com> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2013-11/txt/msg00041.txt.bz2 On Tue, 19 Nov 2013, Andrew Pinski wrote: > > MIPS' sys/user.h currently has a constant definition for PAGE_SIZE, and the > > other related settings. This is not appropriate for XLP (and other MIPS?) > > where the actual page size is a kernel configuration option. > > The whole Octeon series of MIPS64 processors also supports other > PAGE_SIZEs. Also the generic MIPS glibc should support other page > sizes too. Virtually all MIPS processors that have a TLB MMU, except a few old oddballs, support a configurable page size (on a page-by-page basis, but Linux sets the size globally). The exceptions are the R2000/R3000 MIPS I ISA CPUs and their variations (fixed 4kB page size) and the R6000 MIPS II ISA CPU (fixed 16kB page size). The latter hardly ever seen anywhere (being a costly ECL discrete CPU chip set) and never supported by Linux. Therefore there's no point ever in hardcoding any particular page size for the MIPS port. Of the sizes offered by standard hardware, ranging from 1kB up to 256TB at the every other power of 2, Linux chose to support 4kB, 16kB and 64kB pages. > > Apart from the general principle of not having incorrect definitions, the > > actual problem that needs to be solved is in > > sysdeps/unix/sysv/linux/ifaddrs.c in which PAGE_SIZE is used by preference > > as an optimization. Most of the other possible use cases prefer to call > > __getpagesize or use sysconf, and so are unaffected. The case of ifaddrs.c seems ill-conceived to me. If such a kind of optimisation is desired, then I think on targets that have a fixed page size getpagesize should simply be implemented as a static inline function so that GCC can reduce any calls to an instantiation of the constant returned. Maciej