From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753043AbcBOWRw (ORCPT ); Mon, 15 Feb 2016 17:17:52 -0500 Received: from mga11.intel.com ([192.55.52.93]:26902 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752852AbcBOWRv (ORCPT ); Mon, 15 Feb 2016 17:17:51 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,452,1449561600"; d="scan'208";a="885548828" Date: Tue, 16 Feb 2016 01:17:48 +0300 From: "Kirill A. Shutemov" To: Grazvydas Ignotas Cc: "linux-kernel@vger.kernel.org" , Andrew Morton Subject: Re: remap_file_pages regression Message-ID: <20160215221748.GB35514@black.fi.intel.com> References: <1455499975-8390-1-git-send-email-notasas@gmail.com> <20160215102628.GA53150@black.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 16, 2016 at 12:08:34AM +0200, Grazvydas Ignotas wrote: > On Mon, Feb 15, 2016 at 12:26 PM, Kirill A. Shutemov > wrote: > > 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. > > It works, thanks. > Tested-by: Grazvydas Ignotas > > > > >> 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? > > It works, but remap_file_pages() is just more convenient, you don't > need many mmap()/munmap() calls (less syscalls) mmap(MAP_FIXED) would do munmap() for you. > > Signed-off-by: Kirill A. Shutemov > > Cc: stable? > Fixes: c8d78c182 (I guess?) Right. Cc: stable@vger.kernel.org # v4.0+ Fixes: c8d78c1823f4 ("mm: replace remap_file_pages() syscall with emulation") -- Kirill A. Shutemov