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 23:03:38 +0400 [thread overview]
Message-ID: <40E1BD0A.2020400@aknet.ru> (raw)
In-Reply-To: <Pine.LNX.4.44.0406291828030.16640-100000@localhost.localdomain>
Hi.
Hugh Dickins wrote:
>> It is full of surprises, it will map a zero-page to you,
>> it will give you a SIGBUS, it will do everything
> From this attack on poor little mremap(), I think perhaps there's
> something else you didn't realize, that I'd assumed you did realize.
OK, the last time I was messing around the
mremap, it was mapping the anonymous pages
to me when I was trying to expand the /dev/mem
mapping (missing nopage handler apparently,
having the failure could be much better in that
case I think).
> So mremap() is entirely consistent to allow you to extend a mapping
> beyond the end of the object, such that you'll get SIGBUS if you
> try to access the end of your mapping.
Yes, as for SIGBUS - now I see why it works that
way (not necessary accept its correctness, but
what you said, sounds perfectly valid to me, so
the complete retirement on my side:)
> The deficiency with shared anonymous is that there's no way to expand
> or shrink the underlying object to match the mapping, whereas you can
> ftruncate a real file.
... and/or expand the anonymous private mapping without
the truncation (nothing to truncate). So yes, after all,
it was specific to the anon-shm, which is a special case.
And introducing the per-vma mremap handlers to fix only
this special case (by doing the truncation immediately)
is an overkill and is not required by anyone except myself.
And 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.
---
may just mean that it is never an error, but you have
to deal with the consequences yourself if you expanded
only the mapping and not the object (except for the
case of anon-shm, where you can't deal with the
consequences anyhow since you can't expand the object).
Have I got everything properly this time, or failed the
homework agan? :)
prev parent reply other threads:[~2004-06-29 19:03 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
2004-06-29 17:41 ` Hugh Dickins
2004-06-29 19:03 ` Stas Sergeev [this message]
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=40E1BD0A.2020400@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