Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1648305ioo; Sun, 22 May 2022 22:58:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyK1qy5nmGtF2irpw3dB2OtS+4Uv14P8WbY/7wnR2VoQGEdjnwVOfvQwxgJxFsbVf/GRrJW X-Received: by 2002:a17:902:b18e:b0:15f:b2c:6ca with SMTP id s14-20020a170902b18e00b0015f0b2c06camr21504150plr.84.1653285509273; Sun, 22 May 2022 22:58:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653285509; cv=none; d=google.com; s=arc-20160816; b=EJV/yjYLJ9QeT5JgjfzA6+IGB+7gdumXRxZfHT40y1GBagXaZvqVBd1iM3DIFWudiZ 30K9DUdIOIGiPJ9b9iwDXL2pDjl3bmNLc6wgbf2oFtrrh5uil5+KbU9lD5dSf9J70L89 s8UuZAURcP7+Cht/R6dnU3DQdkIGlKY02CZRaLc3hDyNHYN686apebeP8ehAoskiJTGd mCFeoSJhRD0mr7RnlDPgMpn2KxsR/4hvBisU6GcRyOlYVgxMxqiVNw6/uxuda1nmfdYP tviA4qPGZ0jtVYKNmF1C0qe/muGWvRUhAOF9+3zAxXKHOoddHiRCU2ePdJjiIho39bti +KlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=VJOiU6BQi5P886CY3iFuhDrifu3rFeIvy3Ts/J6ugWs=; b=iSUzKmm1yTdIC5uJlpwCX9X/ebbYNglvSMdGRgrFmb7qhKxlKHGL0peChBhAFVCm8W Ep7z1Wy7qOLVWtLkb3V1GrnxHXM3fEcbOzheHF1ssBKKvO99740UXbfJaIzIFRvfOJjI 6mS8+sv7a8cFjqZ4UXuuW41bcbW08z/LrUiJD08rLd1l3jHexMSlg1QXkymRFos/X+FD /7WfX+CAlKkPWd2tCb3OIHiwr9qhLblLaZ9AdpQ9HX0Fy5cuLx5ZFjuTNMq58FT42AnK soHRj7q2WRqNxu+7QdQ+2ZLvCd1/SB8smDRZ31BzMd36y7fB7MSUNVM8ncguz5RDQWso K1wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=rQdbGHWU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id m8-20020a634c48000000b003f9d5d31d8bsi8694805pgl.312.2022.05.22.22.58.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 May 2022 22:58:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=rQdbGHWU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6EE392EA19; Sun, 22 May 2022 22:53:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240457AbiEVTmP (ORCPT + 99 others); Sun, 22 May 2022 15:42:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230252AbiEVTmO (ORCPT ); Sun, 22 May 2022 15:42:14 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57C362FFC1 for ; Sun, 22 May 2022 12:42:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=VJOiU6BQi5P886CY3iFuhDrifu3rFeIvy3Ts/J6ugWs=; b=rQdbGHWULvJr/+YfcZL2BWrq9P oblMQR2ONoZ8H6J19kBsRKhePWr3eYFB20yLweMhTw3F/IwXNEXqmYc9+BPeM+yUyyl/QUnXNSkhU a0+0SPge7Oy2nI1lnaebibi+fSjO6GMLNeGwTncNF33YaBhDJURU8vgfKWmj+PQ7YnDsHeccvwH8T rCLiLgGsZNYiRpKCN/VuHJZxZW743LKi6358SohTqtJdBgsvihnj8N+gu2BLyLcHLqrjZ2ZM10hiB DeW/V8ci9utfz5HFPMr+zRk9RMMS/R4wnBVyYVFaFjJtQsxIB5aokIgduAGC3FpL0+5PQvQ+ngtcW sHW9DZXw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nsrRU-00FZ4M-P3; Sun, 22 May 2022 19:40:44 +0000 Date: Sun, 22 May 2022 20:40:44 +0100 From: Matthew Wilcox To: Andy Lutomirski Cc: David Hildenbrand , Chih-En Lin , Andrew Morton , linux-mm@kvack.org, Ingo Molnar , "Peter Zijlstra (Intel)" , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Christian Brauner , Vlastimil Babka , William Kucharski , John Hubbard , Yunsheng Lin , Arnd Bergmann , Suren Baghdasaryan , Colin Cross , Feng Tang , "Eric W. Biederman" , Mike Rapoport , Geert Uytterhoeven , Anshuman Khandual , "Aneesh Kumar K.V" , Daniel Axtens , Jonathan Marek , Christophe Leroy , Pasha Tatashin , Peter Xu , Andrea Arcangeli , Thomas Gleixner , Sebastian Andrzej Siewior , Fenghua Yu , Linux Kernel Mailing List , Kaiyang Zhao , Huichun Feng , Jim Huang Subject: Re: [RFC PATCH 0/6] Introduce Copy-On-Write to Page Table Message-ID: References: <20220519183127.3909598-1-shiyn.lin@gmail.com> <64d0da08-6ffd-4bce-bc66-5097913937b4@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 22, 2022 at 08:20:05AM -0700, Andy Lutomirski wrote: > On Sat, May 21, 2022, at 5:31 PM, Matthew Wilcox wrote: > > On Sat, May 21, 2022 at 03:19:24PM -0700, Andy Lutomirski wrote: > >> I can see a rather different use for this type of shared-pagetable > >> technology, though: monstrous MAP_SHARED mappings. For database and some VM > >> users, multiple processes will map the same file. If there was a way to > >> ensure appropriate alignment (or at least encourage it) and a way to handle > >> mappings that don't cover the whole file, then having multiple mappings > >> share the same page tables could be a decent efficiently gain. This doesn't > >> even need COW -- it's "just" pagetable sharing. > > > > The mshare proposal did not get a warm reception at LSFMM ;-( > > > > The conceptual model doesn't seem to work for the MM developers who were > > in the room. "Fear" was the most-used word. Not sure how we're going > > to get to a model of sharing page tables that doesn't scare people. > > FWIW, I didn’t like mshare. mshare was weird: it seemed to have > one mm own some page tables and other mms share them. I’m talking > about having a *file* own page tables and mms map them. This seems less > fear-inducing to me. Circular dependencies are impossible, mmap calls > don’t need to propagate, etc. OK, so that doesn't work for our use case. We need an object to own page tables that can be shared between different (co-operating) processes. Because we need the property that calling mprotect() changes the protection in all processes at the same time. Obviously we want that object to be referenced by a file descriptor, and it can also have a name. That object doesn't have to be an mm_struct. Maybe that would be enough of a change to remove the fear.