From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFCC6C282E1 for ; Thu, 23 May 2019 16:19:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 83CCE217D4 for ; Thu, 23 May 2019 16:19:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558628360; bh=Wv0O6tMsqxBwrYSLzxmAH+HjOtWLDhHqgQXa2NMoUIM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=bglUxWZliKBsO0ePcjtgh1mtgu4HKcQzLXx8bPLCN0crV1bUhP9hJ4PqzKHk8+39W R60VOxnpyIKjv8Z+Jw0mcNx7hV0vDJLPSzLvsMtnqVGpq3k072IY9aOeJdn2S38/fQ pjQhE6y3rzEIdbwxD4iwDPQ0aqbANhE32TQRY9l8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731660AbfEWQTT (ORCPT ); Thu, 23 May 2019 12:19:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:55810 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731117AbfEWQTR (ORCPT ); Thu, 23 May 2019 12:19:17 -0400 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C60C32189E for ; Thu, 23 May 2019 16:19:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558628357; bh=Wv0O6tMsqxBwrYSLzxmAH+HjOtWLDhHqgQXa2NMoUIM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=m8wcPZW/M5eX6YmtPExOOjXbCs1Fo1YueQMdcV589nhOSyRRfgxcT1t4ux70n1ALe sdXuQDKIaa0saOhmp7SlCZBenDx2VVUEyRbkHBeLGunh1nk+LkWLYGyCdNi3rQp4CK WzeOTXr3vBI3tiirMj/acZjWjunbW3S/efBcfh08= Received: by mail-wr1-f43.google.com with SMTP id w8so6951445wrl.6 for ; Thu, 23 May 2019 09:19:16 -0700 (PDT) X-Gm-Message-State: APjAAAVrLy0ttMqogV+QubmQ6g6271//GekICqVX0XVuHWwy/raHOmvW BASRnxNYqGWkBvNSHeGCz5ivNA8q9PG5BYDuLHUdnw== X-Google-Smtp-Source: APXvYqxJ9cxvpQ95yya8qpavKNpqTd10CO30B7bHS2mBUkOpNhogJ1RkrwPQlmFMEfwJOzNxSeCDw2Nl2Dls9GVaNWg= X-Received: by 2002:adf:e90b:: with SMTP id f11mr4069510wrm.291.1558628353521; Thu, 23 May 2019 09:19:13 -0700 (PDT) MIME-Version: 1.0 References: <155836064844.2441.10911127801797083064.stgit@localhost.localdomain> <9638a51c-4295-924f-1852-1783c7f3e82d@virtuozzo.com> <67d1321e-ffd6-24a3-407f-cd26c82e46b8@virtuozzo.com> In-Reply-To: <67d1321e-ffd6-24a3-407f-cd26c82e46b8@virtuozzo.com> From: Andy Lutomirski Date: Thu, 23 May 2019 09:19:01 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 0/7] mm: process_vm_mmap() -- syscall for duplication a process mapping To: Kirill Tkhai Cc: Andy Lutomirski , Andrew Morton , Dan Williams , Michal Hocko , Keith Busch , "Kirill A. Shutemov" , alexander.h.duyck@linux.intel.com, Weiny Ira , Andrey Konovalov , arunks@codeaurora.org, Vlastimil Babka , Christoph Lameter , Rik van Riel , Kees Cook , Johannes Weiner , Nicholas Piggin , Mathieu Desnoyers , Shakeel Butt , Roman Gushchin , Andrea Arcangeli , Hugh Dickins , Jerome Glisse , Mel Gorman , daniel.m.jordan@oracle.com, Jann Horn , Adam Borowski , Linux API , LKML , Linux-MM Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 21, 2019 at 10:44 AM Kirill Tkhai wrote: > > On 21.05.2019 19:43, Andy Lutomirski wrote: > > On Tue, May 21, 2019 at 8:52 AM Kirill Tkhai wrote: > >> > >> On 21.05.2019 17:43, Andy Lutomirski wrote: > > Do you mean that the code you sent rejects this case? If so, please > > document it. In any case, I looked at the code, and it seems to be > > trying to handle MAP_SHARED and MAP_ANONYMOUS. I don't see where it > > would reject copying a vDSO. > > I prohibit all the VMAs, which contain on of flags: VM_HUGETLB|VM_DONTEXPAND|VM_PFNMAP|VM_IO. > I'll check carefully, whether it's enough for vDSO. I think you could make the new syscall a lot more comprehensible bg restricting it to just MAP_ANONYMOUS, by making it unmap the source, or possibly both. If the new syscall unmaps the source (in order so that the source is gone before the newly mapped pages become accessible), then you avoid issues in which you need to define sensible semantics for what happens if both copies are accessed simultaneously. --Andy