public inbox for gnu-gabi@sourceware.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Cary Coutant <ccoutant@gmail.com>, James Y Knight <jyknight@google.com>
Cc: gnu-gabi@sourceware.org
Subject: Re: gABI extension proposal: PT_SHMMAP
Date: Sun, 01 Jan 2017 00:00:00 -0000	[thread overview]
Message-ID: <6aaa36ce-15a4-418d-d3c6-d64d19f9c963@zytor.com> (raw)
In-Reply-To: <CAJimCsFaVCo48abjrZUTOyuyfzfzQatQgaXp2fzE5msjtXA+RA@mail.gmail.com>

On 06/07/17 17:30, Cary Coutant wrote:
>> Why is MAP_SHARED even needed for the linux vdso use-case?
>>
>> All the mappings created for the vdso are read-only mappings, right?
>> And on Linux, MAP_PRIVATE mappings already reflect changes made to the
>> underlying file, so long as the process hasn't written to the page, I
>> think?
>>
>> So, if you're intending to use this to implement the "vvar" mapping,
>> isn't the default MAP_PRIVATE already sufficient?
> 
> He mentioned that this was for the kernel-provided *data* page,
> implying to me that he wants a writable, but still sharable (i.e., not
> copy-on-write) mapping.
> 
> It seems generally useful to me. I probably wouldn't object to a new
> gABI bit, but a little more background would be helpful in deciding.
> 

It's not writable, at least not in the intended usage.  I will
experiment and see if PT_LOAD might just do the right thing.  Even so,
it might be safer to have a PF_MMAP bit indicating that this *must* be
mmapped.

That legacy Unix kernels doesn't support this feature is in my opinion a
total red herring.  If anything, this would permit these systems to
error out rather than do something that is completely unexpected.

The user space usage I was considering would amount to a shared bss
section.  This way multiple processes could have a shared memory area
with symbols.  It could either be done as an anonymous mapping (p_memsz
> p_filesz) in which case it would be shared among fork() clients, or as
a file-based mapping (in which case the file would, unfortunately, have
to be writable.)

However, if the consensus is that this is not interesting outside this
particular use case, then putting it under PF_MASKOS makes sense.

	-hpa

  reply	other threads:[~2017-06-08 20:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-01  0:00 H. Peter Anvin
2017-01-01  0:00 ` James Y Knight via gnu-gabi
2017-01-01  0:00   ` Cary Coutant
2017-01-01  0:00     ` H. Peter Anvin [this message]
2017-01-01  0:00     ` Suprateeka R Hegde
2017-01-01  0:00       ` H. Peter Anvin
2017-01-01  0:00         ` Suprateeka R Hegde
2017-01-01  0:00 ` Cary Coutant
2017-01-01  0:00   ` hpa
2017-01-01  0:00     ` Suprateeka R Hegde
2017-01-01  0:00       ` H. Peter Anvin

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=6aaa36ce-15a4-418d-d3c6-d64d19f9c963@zytor.com \
    --to=hpa@zytor.com \
    --cc=ccoutant@gmail.com \
    --cc=gnu-gabi@sourceware.org \
    --cc=jyknight@google.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).