Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934176AbdIYMfN (ORCPT ); Mon, 25 Sep 2017 08:35:13 -0400 Received: from mx2.suse.de ([195.135.220.15]:45904 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932814AbdIYMfL (ORCPT ); Mon, 25 Sep 2017 08:35:11 -0400 Date: Mon, 25 Sep 2017 14:35:08 +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: <20170925123508.pzjbe7wgwagnr5li@dhcp22.suse.cz> References: <20170915213745.6821-1-mike.kravetz@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 877 Lines: 26 On Tue 19-09-17 14:11:19, Florian Weimer wrote: > On 09/18/2017 07:11 PM, Mike Kravetz wrote: [...] > > I can drop this wording, but would still like to suggest memfd_create as > > the preferred method of creating duplicate mappings. It would be good if > > others on Cc: could comment as well. > > mremap seems to work with non-anonymous mappings, too: only for shared mappings in fact. Because once we have CoW then mremap will not provide you with the same content as the original mapping. [...] > > Just curious, does glibc make use of this today? Or, is this just something > > that you think may be useful. > > To my knowledge, we do not use this today. But it certainly looks very > useful. What would be the usecase. I mean why don't you simply create a new mapping by a plain mmap when you have no guarantee about the same content? -- Michal Hocko SUSE Labs