Re: remap_file_pages regression

From: Kirill A. Shutemov
Date: Mon Feb 15 2016 - 05:26:36 EST


On Mon, Feb 15, 2016 at 03:32:55AM +0200, Grazvydas Ignotas wrote:
> Hi,
>
> since remap_file_pages() rework the following simple program fails.
> I haven't actually bisected this, only know it worked on 3.19 at least
> (I bought a new system now and need 4.2+ for hardware support).

The patch below should fix the issue. Please test.

> If you are curious, the program is an emulator and is using
> remap_file_pages() to implement memory mirroring efficiently (and to
> remap things during run time).

Could you elaborate on this?

Why creating file on tmpfs/shmem (using memfd_create() for example) plus
plain mmap()s wouldn't work for you?