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 0D14AC433E2 for ; Fri, 4 Sep 2020 19:41:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2625B208CA for ; Fri, 4 Sep 2020 19:41:49 +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" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2625B208CA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 712AF6B0037; Fri, 4 Sep 2020 15:41:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6C3D46B005A; Fri, 4 Sep 2020 15:41:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 58AC46B005C; Fri, 4 Sep 2020 15:41:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0177.hostedemail.com [216.40.44.177]) by kanga.kvack.org (Postfix) with ESMTP id 43CD16B0037 for ; Fri, 4 Sep 2020 15:41:49 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 0775F247F for ; Fri, 4 Sep 2020 19:41:49 +0000 (UTC) X-FDA: 77226399138.04.salt28_0f0756b270b4 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id BF13F800C88C for ; Fri, 4 Sep 2020 19:41:48 +0000 (UTC) X-HE-Tag: salt28_0f0756b270b4 X-Filterd-Recvd-Size: 3619 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Fri, 4 Sep 2020 19:41:48 +0000 (UTC) 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 In-Reply-To: <20200904121148.GR24045@ziepe.ca> X-Rspamd-Queue-Id: BF13F800C88C X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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=C4=83r wrote: > > VMAs obtained by mmap()ing memory access fds mirror the contents of t= he 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_inte= rval_notifier > > invalidate callbck. No further memory management is involved. > > On attempts to access a hole, or if a mapping was removed by PIDFD_ME= M_UNMAP, > > or if the remote process address space was reaped by OOM, the remote = mapping > > fault handler returns VM_FAULT_SIGBUS. >=20 > 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: >=20 > https://gitlab.com/hjelmn/xpmem >=20 > However, I think this fundamentally falls into some of the same bad > direction as xpmem. >=20 > 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