Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932948AbcLGVbu convert rfc822-to-8bit (ORCPT ); Wed, 7 Dec 2016 16:31:50 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:50608 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932645AbcLGVbs (ORCPT ); Wed, 7 Dec 2016 16:31:48 -0500 From: Arnd Bergmann To: "Dr. Philipp Tomsich" Cc: Catalin Marinas , Yury Norov , libc-alpha@sourceware.org, linux-arch@vger.kernel.org, LKML , szabolcs.nagy@arm.com, heiko.carstens@de.ibm.com, cmetcalf@ezchip.com, "Joseph S. Myers" , zhouchengming1@huawei.com, "Kapoor, Prasun" , Alexander Graf , geert@linux-m68k.org, kilobyte@angband.pl, manuel.montezelo@gmail.com, Andrew Pinski , linyongting@huawei.com, Alexey Klimov , broonie@kernel.org, "Zhangjian (Bamvor)" , linux-arm-kernel , Maxim Kuvyrkov , Nathan Lynch , Martin Schwidefsky , davem@davemloft.net, christoph.muellner@theobroma-systems.com Subject: Re: [Question] New mmap64 syscall? Date: Wed, 07 Dec 2016 22:30:24 +0100 Message-ID: <12011325.PfzMMUCfyS@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: References: <20161206185440.GA4654@yury-N73SV> <20161207163210.GB31779@e104818-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K0:d/Ew7k8SKUNq7DqsRlLN1SJg75qq0eB1k0bP/7wcnKxGRDTCr+h XnzjRnaKWB123T6xBwcE64Wde/9B08ZMGP3WhVV2s3EKfrLXBqDr5C0IA2IbxtrZG7pImao aN+4pOWgGSGE3UavAUzz6ZalgWyHwU7JBg8xpW4m6kuS9I/xgxlUh8qECLb4tQfX1Qeu+sc Ks2KeeVJcIwsUi3dG7FCg== X-UI-Out-Filterresults: notjunk:1;V01:K0:/yzFG18t9W0=:8ndDWLWTun0qzJO1jx/67F jU55ox3A02t5oauUnk440feAJb258d0QuCm5PTF24TD6++TWQ0fYwOa74syB2XLc/r1wwu7tf cWem0yDDBcHnzEHwCKiKReI5+WjqhsChA/9vsXm1SpAlhfau2VER9fUP6soXVi9MaHe93yKeW DYMNx72zDf17LihL7aUEGwpYF4ulVB2aouUIIuOw+SySol571dG04cJdOX4kfbDOdC09F61hj aVoW15NtJUEXuEnyv0x+RLB18htUyu/l6mdtxw7pfLLJN3rr+gJyl6zhNvBnHmUO1YOQtnoN+ qOMEFo0xWNzbw8BjfxLNhkijXKThWdVJ/Bv7d5KUXOl5R9PCUVR/MmKMVNTvqlFoUsC11NoXe 1T1CMsJ+xU07ySxgfprAs71/42Dx7khJRQe9MYrz1hwKIRW6xX6BP928RHTPs75cP+/S5HkXC i/sZWp+rxaRZDjUk96THpbMiRRUMHyMON9TEPTYYZ/hFBLyjtGIWnLlGbJkNsSY884PfUG2fa Dm95Eq37jN5uTgV/KvjQB6a/fGy2jGn9U8BJZPDrStWUYc5fAYtzFTJy3SaZKMuB8BU0Ez9oF BqX57XQnTASGzhaZ9uXGY3CYh/JfVy/80W31F9UUV7Qov7DILoDD4s+DBcrcUA+Dn9JZsIx67 PdvNSih/u6pcptTaYq6YewpCSmk1B1Lsm9DywQM3CwL4/AdFSZmSYUA8q+Ki/V8CeMbxl3cMt nFDluVDGEU97PVSD Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2388 Lines: 48 On Wednesday, December 7, 2016 5:43:27 PM CET Dr. Philipp Tomsich wrote: > Catalin, > > > On 07 Dec 2016, at 17:32, Catalin Marinas wrote: > > > >>> In other words: Why not keep ILP32 simple an ask users that need a 16TB+ offset > >>> to use LP64? It seems much more consistent with the other choices takes so far. > >> > >> If user can switch to lp64, he doesn't need ilp32 at all, right? > >> Also, I don't understand how true 64-bit offset in mmap64() would > >> complicate this port. > > > > It's more like the user wanting a quick transition from code that was > > only ever compiled for AArch32 (or other 32-bit architecture) with a > > goal of full LP64 transition on the long run. I have yet to see > > convincing benchmarks showing ILP32 as an advantage over LP64 (of > > course, I hear the argument of reading a pointer a loop is twice as fast > > with a half-size pointer but I don't consider such benchmarks relevant). > > Most of the performance advantage in benchmarks comes from a reduction > in the size of data-structures and/or tighter packing of arrays. In other words, > we can make slightly better use of the caches and push the memory subsystem > a little further when running multiple instances of benchmarks. > > Most of these advantages should eventually go away, when struct-reorg makes > it way into the compiler. That said, it’s a marginal (but real) improvement for a > subset of SPEC. > > In the real world, the importance of ILP32 as an aid to transition legacy code > that is not 64bit clean… and this should drive the ILP32 discussion. That we > get a boost in our SPEC scores is just a nice extra that we get from it To bring this back from the philosophical questions of ABI design to the specific point of what file offset width you want for mmap() on 32-bit architectures. For all I can tell, using mmap() to access a file that is many thousand times larger than your virtual address space is completely crazy. Adding a new mmap64() syscall on all 32-bit architectures would be trivial if there was a use case for it, without one we but without at least one specific application asking for it (with good reasons), we shouldn't even be talking about that. Note that until commit f8b7256096a2 ("Unify sys_mmap"), we actually had a sys_mmap64 implementation on a couple of architectures, but removed it. Arnd