From: David Woodhouse <dwmw2@infradead.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: maze@druid.if.uj.edu.pl (Maciej Zenczykowski),
linux-kernel@vger.kernel.org
Subject: Re: [OT] Wrapping memory.
Date: Sun, 02 Dec 2001 17:53:37 +0000 [thread overview]
Message-ID: <12969.1007315617@redhat.com> (raw)
In-Reply-To: <E16AIZ8-0008Re-00@the-village.bc.nu>
In-Reply-To: <E16AIZ8-0008Re-00@the-village.bc.nu>
alan@lxorguk.ukuu.org.uk said:
> > I would like to have a 64 KBarray (of char), that's trivial, however
> > what I would like is for the last 4 KB [yes thankfully this is exactly
> > one page... (assume i386)] to reference the same physical memory as the
> > first four.
> mmap will do what you need. Create a 60K object on disk and mmap it at
> the base address and then 60K further on for 4K.
You said 'assume i386', but just to make it clear - this is likely to break
horribly on some non-i386 platforms, due to dcache aliasing. You may find
that the second mmap(MAP_FIXED) fails, or if it succeeds then changes made
with one virtual address won't be instantly visible through the other
mapping. About the best case on such hardware is that Linux will just map
the offending page uncached.
--
dwmw2
next prev parent reply other threads:[~2001-12-02 17:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-01 22:03 [OT] Wrapping memory Maciej Zenczykowski
2001-12-01 22:24 ` Alan Cox
2001-12-02 1:52 ` Benjamin LaHaise
2001-12-02 10:24 ` Christoph Rohland
2001-12-02 17:53 ` David Woodhouse [this message]
2001-12-03 7:44 ` Christoph Rohland
2001-12-03 9:11 ` David Woodhouse
2001-12-04 10:40 ` Russell King
2001-12-04 16:39 ` Jamie Lokier
2001-12-04 21:03 ` Russell King
2001-12-04 10:45 ` David Woodhouse
2001-12-04 10:59 ` Russell King
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=12969.1007315617@redhat.com \
--to=dwmw2@infradead.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=maze@druid.if.uj.edu.pl \
/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