Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936045AbdIYOwn (ORCPT ); Mon, 25 Sep 2017 10:52:43 -0400 Received: from mx2.suse.de ([195.135.220.15]:56703 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934386AbdIYOwl (ORCPT ); Mon, 25 Sep 2017 10:52:41 -0400 Date: Mon, 25 Sep 2017 16:52:38 +0200 From: Michal Hocko To: Florian Weimer Cc: Mike Kravetz , mtk.manpages@gmail.com, linux-man@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Andrea Arcangeli , "Kirill A . Shutemov" , Vlastimil Babka , Anshuman Khandual , linux-mm@kvack.org Subject: Re: [patch] mremap.2: Add description of old_size == 0 functionality Message-ID: <20170925145238.gic2n37ffc6ytyvx@dhcp22.suse.cz> References: <20170915213745.6821-1-mike.kravetz@oracle.com> <20170925123508.pzjbe7wgwagnr5li@dhcp22.suse.cz> <20170925125207.4tu24sbpnihljknu@dhcp22.suse.cz> <765cd0cb-aa35-187c-456d-05d8752caa04@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <765cd0cb-aa35-187c-456d-05d8752caa04@redhat.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 989 Lines: 25 On Mon 25-09-17 15:16:09, Florian Weimer wrote: > On 09/25/2017 02:52 PM, Michal Hocko wrote: > > So, how are you going to deal with the CoW and the implementation which > > basically means that the newm mmap content is not the same as the > > original one? > > I don't understand why CoW would kick in. So you can guarantee nobody is going to write to that memory? Moreover for the anonymous mapping you really get zero pages rather than the original content AFAIR. > The approach I outlined is > desirable because it avoids the need to modify any executable pages, so this > is not a concern. The point is to create a potentially unbounded number of > thunks *without* run-time code generation. > > If the file is rewritten on disk, that's already undefined today, so it's > not something we need to be concerned with. (Anything which replaces ELF > files needs to use the rename-into-place approach anyway.) Yeah that part is not all that interesting. -- Michal Hocko SUSE Labs