[lkml]   [2001]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: mmap not working?
Date (Rogier Wolff) writes:

> I'm not sure wether the kernel has been wrong all the time or if
> something changed recently. I posted the "workaround" the first time
> through, which also works from userspace. I can change my application.
> I can modify my libc.
> However, I'd rather have "mmap" fixed, as that fixes it for all other
> applications too. Not just for mine on my system.
> The SGI manpage says:
> All implementations interpret an addr value of
> zero as granting the system complete freedom in selecting pa, subject to
> constraints described below. A non-zero value of addr is taken to be a
> suggestion of a process address near which the mapping should be placed.
> which hints at a possible non-alignment. It also mentions that
> "offset" should be page-aligned, which I disagree with here:
> everything has been set up to "do the right thing" when the mapping is
> possible with an unaligned offset.

Except there is no way to give you enough information to munmap the page.
As the address passed to munmap must be page aligned.

The current policy appears to make an application think as up front
as possible about the need to be page aligned when talking to mmap,
while not being overly harsh. We do have the silent rounding
up of length until it is a multiple of PAGE_SIZE.

Beyond this the internal linux implementation of mmap does not even
see the extra bits in the offset. Instead the most recent syscall
entry point takes an argument as to which page you want to mmap from
the device. This allows much larger devices to be mmaped while
still using 32bit arithmetic.

So I neither see that it is easy or even desirable to ``fix'' mmap.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:13    [W:0.076 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site