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 8A90EC433E2 for ; Fri, 4 Sep 2020 12:11:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3E70F20791 for ; Fri, 4 Sep 2020 12:11:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="i2mJ0buD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E70F20791 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D09DF900008; Fri, 4 Sep 2020 08:11:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CBA21900003; Fri, 4 Sep 2020 08:11:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD031900008; Fri, 4 Sep 2020 08:11:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0203.hostedemail.com [216.40.44.203]) by kanga.kvack.org (Postfix) with ESMTP id A8A3C900003 for ; Fri, 4 Sep 2020 08:11:51 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 67F4D824556B for ; Fri, 4 Sep 2020 12:11:51 +0000 (UTC) X-FDA: 77225265222.13.pen74_6304fbe270b2 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 3F75018140B60 for ; Fri, 4 Sep 2020 12:11:51 +0000 (UTC) X-HE-Tag: pen74_6304fbe270b2 X-Filterd-Recvd-Size: 5061 Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Fri, 4 Sep 2020 12:11:50 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id z2so4340150qtv.12 for ; Fri, 04 Sep 2020 05:11:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=o1zM0HomSRa3Af0Z+HovFGcU3tJp/Xd+knAzR2m42KM=; b=i2mJ0buDsLn1kST0TMjkPu8wwBpnMWvfg9036VDlPu7J8p5rNRlDbBdFW3A8kEL/1A DQXjOTieNpm/iAfeoSNJVIywwIREPpaMqReBt9RdpJvO5JjdaNth9LKV1OhWxYtzO5pc nHCjbyAhk8AweDfxVb6MWItE2HG+dbVkkLP/MWSogXAGqfUw+MJH+NkVZqMKLlwq9JG5 VjkKj5zgPAq+kvZqALpxHz9QwxOt8GDK2fJbezDz/uKUHeVXQUxFf86uMDRC4v3HuZLV WWgxX1r+dxppAqC+EY90rRnSSUsbfhKdsUczvTo04b/TVBm2wMwSJPA2vX4x7fXi7p0S 51Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=o1zM0HomSRa3Af0Z+HovFGcU3tJp/Xd+knAzR2m42KM=; b=o93kAEGpH9Sf2t6j2CtIbPOWUuZst7z2N+01KsrTow5ohavX3WQVFdbiDc/oO4Z3PX 5vwDgq+tT5R0lhOuU3Bj1GgDL65KQozhzFFnNKiFxnA4F+i/WeNLWa6Rr2D/JNaXyLm1 MCQeKe6px41YjMJKRC5Cl90g3pdghZKmODadCOjrqBVwU5NoZXPlZHyjrc+50YvWYp4n e5c0+O/dXArxhAOPqebWPB+eG3jj7kzYmAsskDywnfjHkOt1jMaG+36WchSc8OrTN1gV BbYerEFoZVLl2mXz4sftZkZYo2i80NUMRBpIVMOBwn7KrjfHSuXnW0ZVb3vOCnwJksWY 0iAw== X-Gm-Message-State: AOAM533/FQLaXbgdG8idqZwjLUZwyODZ63snWNQKxmVOPCmV7H+jYp86 OpSe1oqIKghP7Ka6kAoxLVGoXg== X-Google-Smtp-Source: ABdhPJxpoOENgxYhhXZk9mQZVPa0xVYtQJ/sp+/RXtdpjkWoZCUtCcG0Pmz6D078Mk6ACNpkrDsCoQ== X-Received: by 2002:ac8:1667:: with SMTP id x36mr8270759qtk.51.1599221510189; Fri, 04 Sep 2020 05:11:50 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id l95sm4292631qte.36.2020.09.04.05.11.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Sep 2020 05:11:49 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kEAZI-007IGM-Rb; Fri, 04 Sep 2020 09:11:48 -0300 Date: Fri, 4 Sep 2020 09:11:48 -0300 From: Jason Gunthorpe To: Adalbert =?utf-8?B?TGF6xINy?= Cc: 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 , Matthew Wilcox , Christian Brauner Subject: Re: [RESEND RFC PATCH 0/5] Remote mapping Message-ID: <20200904121148.GR24045@ziepe.ca> References: <20200904113116.20648-1-alazar@bitdefender.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200904113116.20648-1-alazar@bitdefender.com> X-Rspamd-Queue-Id: 3F75018140B60 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 02:31:11PM +0300, Adalbert Laz=C4=83r 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 i= n the > current process page tables at fault time and removed by the mmu_interv= al_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 ma= pping > 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. This is just too weird and fragile to be maintaible over a long term. For instance, one of the major bugs in things like xpmem was that they are incompatible with get_user_pages(), largely because of this issue. I feel like I said this already.. Jason