Re: parisc: fix mmap(MAP_FIXED|MAP_SHARED) to already mmapped address - optimized patches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 22.02.2015 18:54, John David Anglin wrote:
At one time, we thought this value needed to be 4 MB.
Helge was working on improving the mmap allocation scheme but this
work stalled after some improvement.

The patches are still available:
http://git.kernel.org/cgit/linux/kernel/git/deller/parisc-linux.git/commit/?h=parisc-mmap&id=34ae0a4620b50d27ce2f1314322275cbea7f2055
and
http://git.kernel.org/cgit/linux/kernel/git/deller/parisc-linux.git/commit/?h=parisc-mmap&id=7a6e51ddfd3ab3b11a4ebdd995e26672e69a8efa

Basically the idea is:
- Currently we have a static calculation where the mapping should happen inside the 4MB range:
  see: arch/parisc/kernel/sys_parisc.c: (filp ? ((unsigned long) filp->f_mapping) >> 8 : 0UL)
- Replace that by a dynamic mapping, which searches best fit address in free mem area *if* the file hasn't been mapped yet, and save this mapping in the struct address_space. If another process then maps the same file again, then just reuse the last calculated "dynamic" mapping (offset).

This helps a lot to prevent userspace memory fragmentation, but Linus didn't liked this approach and proposed instead:
 https://lkml.org/lkml/2014/5/1/368

Sadly his patch didn't worked out of the box. I did tried various ways (I'm sure it can work somehow), but I couldn't solve it yet.
Maybe some Linux mm expert could help here?

Helge --
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux