From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kirill Tkhai Subject: Re: [PATCH v2 0/7] mm: process_vm_mmap() -- syscall for duplication a process mapping Date: Mon, 3 Jun 2019 17:38:58 +0300 Message-ID: <4228b541-d31c-b76a-2570-1924df0d4724@virtuozzo.com> References: <155836064844.2441.10911127801797083064.stgit@localhost.localdomain> <20190522152254.5cyxhjizuwuojlix@box> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190522152254.5cyxhjizuwuojlix@box> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: "Kirill A. Shutemov" Cc: akpm@linux-foundation.org, dan.j.williams@intel.com, mhocko@suse.com, keith.busch@intel.com, kirill.shutemov@linux.intel.com, alexander.h.duyck@linux.intel.com, ira.weiny@intel.com, andreyknvl@google.com, arunks@codeaurora.org, vbabka@suse.cz, cl@linux.com, riel@surriel.com, keescook@chromium.org, hannes@cmpxchg.org, npiggin@gmail.com, mathieu.desnoyers@efficios.com, shakeelb@google.com, guro@fb.com, aarcange@redhat.com, hughd@google.com, jglisse@redhat.com, mgorman@techsingularity.net, daniel.m.jordan@oracle.com, jannh@google.com, kilobyte@angband.pl, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org List-Id: linux-api@vger.kernel.org On 22.05.2019 18:22, Kirill A. Shutemov wrote: > On Mon, May 20, 2019 at 05:00:01PM +0300, Kirill Tkhai wrote: >> This patchset adds a new syscall, which makes possible >> to clone a VMA from a process to current process. >> The syscall supplements the functionality provided >> by process_vm_writev() and process_vm_readv() syscalls, >> and it may be useful in many situation. > > Kirill, could you explain how the change affects rmap and how it is safe. > > My concern is that the patchset allows to map the same page multiple times > within one process or even map page allocated by child to the parrent. Speaking honestly, we already support this model, since ZERO_PAGE() may be mapped multiply times in any number of mappings. Kirill