From: Stas Sergeev <stsp@aknet.ru>
To: Hugh Dickins <hugh@veritas.com>
Cc: Andrew Morton <akpm@osdl.org>, Christoph Rohland <cr@sap.com>,
linux-kernel@vger.kernel.org
Subject: Re: [patch][rfc] expandable anonymous shared mappings
Date: Tue, 29 Jun 2004 21:06:36 +0400 [thread overview]
Message-ID: <40E1A19C.6090607@aknet.ru> (raw)
In-Reply-To: <Pine.LNX.4.44.0406282242320.14234-100000@localhost.localdomain>
Hi Hugh.
Hugh Dickins wrote:
> But I've never heard that complained of before,
> you're exaggerating to say we're deeply in a mess here. I'd
What I wanted to say is only that shmem_file_setup()
does exactly the same thing - creates and truncates
the file itself. But this is no longer important
as I finally realized your points.
> Sorry, I was talking SysV shm there.
Excellent point btw! I verified that, mremap() on
the SysV shm gives me the same nice SIGBUS. I feel
much better right now:) I was wrong assuming that
expanding the shared mapping with mremap() should
be valid in any case, SysV shm is an obvious example,
and it resembles the anon-shm the way they both do
not have an FD accessible.
So yes, I finally realized that my proposal is
nothing more than an extension to the otherwise
functional interface, and should not be traded as
a bugfix. And yes, the inability to shrink it back
is also not friendly. As for not allowing children
to expand, I'd vote for MAP_DONTEXPAND flag, but
this already have nothing to do with my original
proposal, so no need to worry about it.
Thanks for you time and explanations, after all they
worked out right:)
>> http://www.ussg.iu.edu/hypermail/linux/kernel/9603.2/0692.html
> up past history to support your case. But I'm afraid this does
> not actually add support to your case (certainly doesn't subtract
> from it either) - it's about using mremap to track extensions
> to a file extended by other means.
Well, what I meant pointing to this URL, was this:
---
In most
cases (at least for the malloc case) this will be a anonymous mapping,
but it's by no means an error to extend any mapping you have created.
---
Either I read it the completely wrong way, or it
is no longer valid, but in the light of the above,
it seems like indeed this doesn't add the support
to my case.
> Yes, it would make it simpler, but not significantly simpler.
You are right.
> You could ask instead for an mtruncate system call (similarly
Good idea, why not? :)
> [snip surprise at SIGBUS beyond end of shared object]
But you snipped the most important part:)
Now I understand, however, the problems I had with
mremap(), have nothing special to do with the anon-shm,
it just seems to be the usual thing with that syscall.
It is full of surprises, it will map a zero-page to you,
it will give you a SIGBUS, it will do everything
but not what you really want from it:) I always
wanted to have the more reliable mremap(). Not the
one that can expand everything in the world, but
the one that returns the value you can rely upon,
as all the other syscalls do. But the way I wanted
to achieve it (by implementing the "proper" nopage handler
for anon-shm) is definitely not the right one. That's
why I was very happy when you proposed the .mremap
handlers per vma, but since this have nothing to do
with the current subject, I should probably go
complaining about mremap() elsewhere.
Thank you and Christoph for the very usefull
discussion. It was usefull maybe again only
for me, but I hope you weren't bored with it too
much either.
Thanks!
next prev parent reply other threads:[~2004-06-29 17:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-16 18:12 [patch][rfc] expandable anonymous shared mappings Stas Sergeev
2004-06-18 20:46 ` Hugh Dickins
2004-06-19 9:07 ` Stas Sergeev
2004-06-20 0:20 ` Hugh Dickins
2004-06-20 9:46 ` Stas Sergeev
2004-06-23 11:23 ` Christoph Rohland
2004-06-23 18:45 ` Stas Sergeev
2004-06-28 14:25 ` Christoph Rohland
2004-06-28 14:22 ` Hugh Dickins
2004-06-28 18:48 ` Stas Sergeev
2004-06-28 21:44 ` Hugh Dickins
2004-06-29 17:06 ` Stas Sergeev [this message]
2004-06-29 17:41 ` Hugh Dickins
2004-06-29 19:03 ` Stas Sergeev
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=40E1A19C.6090607@aknet.ru \
--to=stsp@aknet.ru \
--cc=akpm@osdl.org \
--cc=cr@sap.com \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.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