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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05FDBC3526D for ; Wed, 26 Jan 2022 14:13:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 904076B0074; Wed, 26 Jan 2022 09:13:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B24C6B0075; Wed, 26 Jan 2022 09:13:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7A12F6B0078; Wed, 26 Jan 2022 09:13:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0096.hostedemail.com [216.40.44.96]) by kanga.kvack.org (Postfix) with ESMTP id 6BA696B0074 for ; Wed, 26 Jan 2022 09:13:13 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 26869181CA772 for ; Wed, 26 Jan 2022 14:13:13 +0000 (UTC) X-FDA: 79072630266.30.B085A0E Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf31.hostedemail.com (Postfix) with ESMTP id 41A2120040 for ; Wed, 26 Jan 2022 14:13:12 +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-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=vqA7CRwSHoOR/tJOQAe06dY8ic7ejbAv2r4e+k8PLFc=; b=tZQcPh5gvqStAJ6jA0YK2t01Sw GehlWy5GlMlaFzXz0gV3+mTxYwQyZX1lWoTkRSjXVXi8IJkQS56IY0nKcTEi1Lha3CW6ziroThbE5 fz8ZwPPj3d8iTtCawn1tdgkrtZubbb6QICbvfBoxwVjag1JYveRZ8Hk3HRbbfG1gWsM/IHvD6mtKf R/r44YROsqckqzmHGMQ/cybYNNdboamluoJtS7g84BqZ/IkQM3S81AHaS8QRSKKaC5erwk7J1dKYt FvB9p2rvqG/+Y/fkR8DjGN+3zRqo9I2kFhds9syMmemMoy6cWlpv0XI22QJ5Kegg/zjpnaRzWfL5s wx1AlItw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCj2Z-0046kL-Ax; Wed, 26 Jan 2022 14:12:51 +0000 Date: Wed, 26 Jan 2022 14:12:51 +0000 From: Matthew Wilcox To: David Hildenbrand Cc: "Kirill A. Shutemov" , Khalid Aziz , akpm@linux-foundation.org, longpeng2@huawei.com, arnd@arndb.de, dave.hansen@linux.intel.com, rppt@kernel.org, surenb@google.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Peter Xu Subject: Re: [RFC PATCH 0/6] Add support for shared PTEs across processes Message-ID: References: <20220125114212.ks2qtncaahi6foan@box.shutemov.name> <20220125135917.ezi6itozrchsdcxg@box.shutemov.name> <20220125185705.wf7p2l77vggipfry@box.shutemov.name> <2190b8e2-74f2-0e31-0a40-0401fbd9966e@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2190b8e2-74f2-0e31-0a40-0401fbd9966e@redhat.com> X-Stat-Signature: 31w4danubdsw4b4roj6j38g35oj7pxth X-Rspam-User: nil Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=tZQcPh5g; spf=none (imf31.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 41A2120040 X-HE-Tag: 1643206392-225710 X-Bogosity: Ham, tests=bogofilter, spamicity=0.013079, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Jan 26, 2022 at 02:55:10PM +0100, David Hildenbrand wrote: > On 26.01.22 14:38, Matthew Wilcox wrote: > > On Wed, Jan 26, 2022 at 11:16:42AM +0100, David Hildenbrand wrote: > >> A while ago I talked with Peter about an extended uffd (here: WP) > >> mechanism that would work on fds instead of the process address space. > > > > As far as I can tell, uffd is a grotesque hack that exists to work around > > the poor choice to use anonymous memory instead of file-backed memory > > in kvm. Every time I see somebody mention it, I feel pain. > > > > I might be missing something important, because KVM can deal with > file-back memory just fine and uffd is used heavily outside of hypervisors. > > I'd love to learn how to handle what ordinary uffd (handle > missing/unpopulated pages) and uffd-wp (handle write access to pages) > can do with files instead. Because if something like that already > exists, it would be precisely what I am talking about. Every notification that uffd wants already exists as a notification to the underlying filesystem. Something like a uffdfs [1] would be able to do everything that uffd does without adding extra crap all over the MM. [1] acronyms are bad, mmmkay?