Article View: fa.netbsd.tech.kern
Article #121Re: equivalent of MAP_32BIT
From: Alexander Nasonov
Date: Sun, 26 May 2013 21:59
Date: Sun, 26 May 2013 21:59
31 lines
2982 bytes
2982 bytes
Justin Cormack wrote: > I have been informed that there might be an undocumented ability to > get mmap to return addresses in the lower 4G of address space on a 64 > bit machine by passing ~(unsigned)0 as the first parameter (or > (1<<31)-1 for 2GB). Is this correct? Or is it possibley to use > netbsd32_mmap()? Linux and some other OSs support a MAP_32BIT flag to > achieve this, looking for a way to port some code to NetBSD that > requires this. I will not ask which code do you want to port because it's very obvious ;-) It was on my todo list to look into testing LuaJIT on amd64 this weekend but I spend my spare time cycling with kids instead. Adding __NetBSD__ to this list: #elif LJ_TARGET_OSX || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) /* OSX and FreeBSD mmap() use a naive first-fit linear search. ** That's perfect for us. Except that -pagezero_size must be set for OSX, ** otherwise the lower 4GB are blocked. And the 32GB RLIMIT_DATA needs ** to be reduced to 250MB on FreeBSD. in src/lj_alloc.c seems to work but I neither extensively tested it nor checked with NetBSD kernel sourses whether it uses a linear search. Alex
Technical Details
Message-ID:
<fa.p/gcB3NmSwkkYg6HsZ/F0mHplnk@ifi.uio.no>Path:
arc1-ca.pugleaf.net!d5ni14061pbl.0!nntp.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news.glorb.com!uio.no!nntp.uio.no!.POSTED!not-for-mailReferences:
<fa.Sxbi1y2U7NfWhxooWVNWVMH9cDU@ifi.uio.no>Show Full Headers
Complete Article Headers
X-Google-Thread: b7e13b6095,dcb504ca0aebd161
X-Google-Attributes: gidb7e13b6095,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII-7-bit
X-Received: by 10.66.191.132 with SMTP id gy4mr2784982pac.19.1369605580176;
Sun, 26 May 2013 14:59:40 -0700 (PDT)
Path: arc1-ca.pugleaf.net!d5ni14061pbl.0!nntp.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news.glorb.com!uio.no!nntp.uio.no!.POSTED!not-for-mail
From: Alexander Nasonov <alnsn@yandex.ru>
Newsgroups: fa.netbsd.tech.kern
Subject: Re: equivalent of MAP_32BIT
Date: Sun, 26 May 2013 21:59:39 UTC
Organization: Internet mailing list
Lines: 31
Sender: tech-kern-owner@NetBSD.org
Message-ID: <fa.p/gcB3NmSwkkYg6HsZ/F0mHplnk@ifi.uio.no>
References: <fa.Sxbi1y2U7NfWhxooWVNWVMH9cDU@ifi.uio.no>
NNTP-Posting-Host: mail-jess.uio.no
Mime-Version: 1.0
X-Trace: readme.uio.no 1369605579 27283 129.240.7.9 (26 May 2013 21:59:39 GMT)
X-Complaints-To: abuse@uio.no
NNTP-Posting-Date: Sun, 26 May 2013 21:59:39 +0000 (UTC)
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: tech-kern@netbsd.org
To: Justin Cormack <justin@specialbusservice.com>
Delivered-To: tech-kern@netbsd.org
X-Virus-Scanned: amavisd-new at NetBSD.org
In-Reply-To: <CAK4o1Wx7PhTzpDBSCpidbLzbH_uGywPq6J8vX+fXpocS=kuX_A@mail.gmail.com>
X-Operating-System: Linux 3.4.0 on armv7l
X-SHELL: /bin/bash
X-FCEDIT: /bin/ed
X-EDITOR: /usr/bin/vi
X-VISUAL: vim
List-Id: tech-kern.NetBSD.org
Original-Date: Sun, 26 May 2013 22:59:09 +0100
Original-Message-Id: <20130526215909.GC1639@x1000.localdomain>
Original-References: <CAK4o1Wx7PhTzpDBSCpidbLzbH_uGywPq6J8vX+fXpocS=kuX_A@mail.gmail.com>
X-Received-Bytes: 2607
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline