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=-8.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 99256C433E2 for ; Fri, 4 Sep 2020 19:42:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 67519208CA for ; Fri, 4 Sep 2020 19:42:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="vqK+QfWl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727865AbgIDTlu (ORCPT ); Fri, 4 Sep 2020 15:41:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726441AbgIDTls (ORCPT ); Fri, 4 Sep 2020 15:41:48 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC6D2C061245 for ; Fri, 4 Sep 2020 12:41:47 -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=3XphRgx8UKKTziy8WhApuAQLUL4SuQrn1if9cGELvRs=; b=vqK+QfWlRKK9hrJvyTRswgGBlV hzVazHMiNCIES6LUe9bW7PqML+xMmOg/NGa7yOpQijX5maK1FgQBa+f8Ld/u6JJqpjjv80hQVz2h1 3hKDHNbW2vyr0FopJ78Uz7xXfwl6KP451GoFlAgBEwvxwunNpuFab3RfXjEN68YkSZzFta3XHDesB sVhynGxeOmiURZ87LT5cvDa14sTIkY55Zy/qAK2aPa4yIntYl7F9MvMhSs+YEgJjaiAimtqB6PjhY H0RSGlwtA//vVX9TYch4MkEnlx7p/5c/VjQ814dCElHO8Js5DFX/lnulI7bZhkg5otrFtiCThDDr9 S88rL8hg==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEHad-00023O-WD; Fri, 04 Sep 2020 19:41:40 +0000 Date: Fri, 4 Sep 2020 20:41:39 +0100 From: Matthew Wilcox To: Jason Gunthorpe Cc: Adalbert =?utf-8?B?TGF6xINy?= , linux-mm@kvack.org, linux-api@vger.kernel.org, Andrew Morton , Alexander Graf , Stefan Hajnoczi , Jerome Glisse , Paolo Bonzini , Mihai =?utf-8?B?RG9uyJt1?= , Mircea Cirjaliu , Andy Lutomirski , Arnd Bergmann , Sargun Dhillon , Aleksa Sarai , Oleg Nesterov , Jann Horn , Kees Cook , Christian Brauner Subject: Re: [RESEND RFC PATCH 0/5] Remote mapping Message-ID: <20200904194139.GA5881@casper.infradead.org> References: <20200904113116.20648-1-alazar@bitdefender.com> <20200904121148.GR24045@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200904121148.GR24045@ziepe.ca> Sender: linux-api-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org On Fri, Sep 04, 2020 at 09:11:48AM -0300, Jason Gunthorpe wrote: > On Fri, Sep 04, 2020 at 02:31:11PM +0300, Adalbert Lazăr wrote: > > VMAs obtained by mmap()ing memory access fds mirror the contents of the remote > > process address space within the specified range. Pages are installed in the > > current process page tables at fault time and removed by the mmu_interval_notifier > > invalidate callbck. No further memory management is involved. > > On attempts to access a hole, or if a mapping was removed by PIDFD_MEM_UNMAP, > > or if the remote process address space was reaped by OOM, the remote mapping > > fault handler returns VM_FAULT_SIGBUS. > > I still think anything along these lines needs to meet the XPMEM use > cases as well, we have to have more general solutions for such MM > stuff: > > https://gitlab.com/hjelmn/xpmem > > However, I think this fundamentally falls into some of the same bad > direction as xpmem. > > I would much rather see this design copy & clone the VMA's than try to > mirror the PTEs inside the VMAs from the remote into a single giant > VMA and somehow split/mirror the VMA ops. I'm on holiday for the next few days, but does the mshare() API work for your use case? Proposal: http://www.wil.cx/~willy/linux/sileby.html Start at implementation: http://git.infradead.org/users/willy/linux.git/shortlog/refs/heads/mshare