public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: ynorov@caviumnetworks.com (Yury Norov)
To: linux-arm-kernel@lists.infradead.org
Subject: [Question] New mmap64 syscall?
Date: Wed, 7 Dec 2016 18:09:44 +0530	[thread overview]
Message-ID: <20161207123944.GA11799@yury-N73SV> (raw)
In-Reply-To: <0F280FED-870A-42B5-ABC4-1976ACA32462@theobroma-systems.com>

Hi Philipp,

On Wed, Dec 07, 2016 at 12:07:24PM +0100, Dr.Philipp Tomsich wrote:
> [Resend, as my mail-client had insisted on using the wrong MIME type?]
> 
> > On 07 Dec 2016, at 11:34, Yury Norov <ynorov@caviumnetworks.com> wrote:
> > 
> >> If there is a use case for larger than 16TB offsets, we should add
> >> the call on all architectures, probably using your approach 3. I don't
> >> think that we should treat it as anything special for arm64 though.
> > 
> > From this point of view, 16+TB offset is a matter of 16+TB storage,
> > and it's more than real. The other consideration to add it is that
> > we have 64-bit support for offsets in syscalls like sys_llseek().
> > So mmap64() will simply extend this support.
> 
> I believe the question is rather if the 16TB offset is a real use-case for ILP32.

This is not for ilp32, but for all 32-bit architectures - both native
and compat. And because the scope is so generic, I think it's the
strong reason for us to support true 64-bit offset in mmap().

> This seems to bring the discussion full-circle, as this would indicate that 64bit is the 
> preferred bit-width for all sizes, offsets, etc. throughout all filesystem-related calls 
> (i.e. stat, seek, etc.).

AARCH64/ILP32 (and all new arches) exposes ino_t, off_t, blkcnt_t,
fsblkcnt_t, fsfilcnt_t and rlim_t as 64-bit types. (Size_t should
be 32-bit of course, because it's the same lengths as pointer.)

It allows to make syscalls that pass it support 64-bit values, refer
Documentation/arm64/ilp32.txt for details. Stat and seek are both
supporting 64-bit types. From this point of view, mmap() is the (only?)
exception in current ILP32 ABI.

> But if that is the case, then we should have gone with 64bit arguments in a single
> register for our ILP32 definition on AArch64.
 
There are 2 unrelated matters - the size of types, and the size of
register. Most of 32-bit architectures has hardware limitation on
register size (consider aarch32). And it doesn't mean that they are
forced to stuck with 32-bit off_t etc. This is still opened question
how to pass 64-bit parameters in aarch64/ilp32 because there we have
the choice (the reason why it's RFC). If you have new ideas - welcome
to that discussion. This topic also covers architectures that has to
pass 64-bit parameters in a pair.

> 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.

Yury

  reply	other threads:[~2016-12-07 12:39 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-06 18:54 [Question] New mmap64 syscall? Yury Norov
2016-12-06 21:20 ` Arnd Bergmann
2016-12-07 10:34   ` Yury Norov
2016-12-07 11:07     ` Dr. Philipp Tomsich
2016-12-07 12:39       ` Yury Norov [this message]
2016-12-07 16:32         ` Catalin Marinas
2016-12-07 16:43           ` Dr. Philipp Tomsich
2016-12-07 21:30             ` Arnd Bergmann
2016-12-10  9:10               ` Pavel Machek
2016-12-10  9:21                 ` Pavel Machek
2016-12-11 12:56                   ` Yury Norov
2016-12-11 12:56                     ` [PATCH 1/3] mm: move argument checkers of mmap_pgoff() to separated routine Yury Norov
2016-12-11 12:56                     ` [PATCH 2/3] sys_mmap64() Yury Norov
2016-12-11 14:48                       ` kbuild test robot
2016-12-11 14:56                       ` kbuild test robot
2016-12-11 12:56                     ` [PATCH 3/3] mm: make pagoff_t type 64-bit Yury Norov
2016-12-11 13:31                       ` kbuild test robot
2016-12-11 13:41                       ` kbuild test robot
2016-12-11 14:59                       ` Arnd Bergmann
2016-12-16 10:55                         ` Yury Norov
2016-12-16 11:02                           ` Arnd Bergmann
2016-12-18  9:23                           ` Christoph Hellwig
2016-12-07 13:23 ` [Question] New mmap64 syscall? Florian Weimer
2016-12-07 15:48   ` Yury Norov
2016-12-08 15:47     ` Florian Weimer
2017-01-03 20:54       ` Pavel Machek
2017-01-12 16:13         ` Florian Weimer
2017-01-12 21:51           ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161207123944.GA11799@yury-N73SV \
    --to=ynorov@caviumnetworks.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox