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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 B16ACC433E0 for ; Sat, 9 Jan 2021 19:33:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DA0E623A5B for ; Sat, 9 Jan 2021 19:33:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA0E623A5B 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 CE6378D000C; Sat, 9 Jan 2021 14:33:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C6F448D0002; Sat, 9 Jan 2021 14:33:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B10D08D000C; Sat, 9 Jan 2021 14:33:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0069.hostedemail.com [216.40.44.69]) by kanga.kvack.org (Postfix) with ESMTP id 9C2A88D0002 for ; Sat, 9 Jan 2021 14:33:45 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 5368D365E for ; Sat, 9 Jan 2021 19:33:45 +0000 (UTC) X-FDA: 77687236410.13.knot80_1e1407b274fe Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 27AAB18140B69 for ; Sat, 9 Jan 2021 19:33:45 +0000 (UTC) X-HE-Tag: knot80_1e1407b274fe X-Filterd-Recvd-Size: 3476 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Sat, 9 Jan 2021 19:33:42 +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=YK9bkc+ab6pT/dipKIxzM3oihklVajwXC+Iom3U0oGs=; b=uyerOwE4pe4/DqfSn97jIDMNkL fZIJky2MAsJVSJPzryAX9aGy5NNgNIihELIDVZ9L58TEekvFu2lUtTE2DO+9jRqbdcFVf1U5YlFf8 p0tRUMxkrjuVXsUMw/WE1W6XRHJ0oOrSlrUdrgTjewQTqvRsh0I0vAjG23bAQW8bUG/UyNunYnSAd AMoKhEmulCwKEaa3YmoLlxPKqoHRouUtrwmnTRnwgYOgYjqo0KQyr1BsS0drCTw1WiM2J7RXurioP X3Lmrh82C4NPGUrcX04fi90CPdd73I0MU29zzMNr0bh6xaXtIaJ069gvLfdwmNZB9RNbkSF21rITd mvtSiP4w==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1kyJyK-000qhE-Pd; Sat, 09 Jan 2021 19:32:42 +0000 Date: Sat, 9 Jan 2021 19:32:24 +0000 From: Matthew Wilcox To: Linus Torvalds Cc: Jason Gunthorpe , Andrea Arcangeli , Linux-MM , Linux Kernel Mailing List , Yu Zhao , Andy Lutomirski , Peter Xu , Pavel Emelyanov , Mike Kravetz , Mike Rapoport , Minchan Kim , Will Deacon , Peter Zijlstra , Hugh Dickins , "Kirill A. Shutemov" , Oleg Nesterov , Jann Horn , Kees Cook , John Hubbard , Leon Romanovsky , Jan Kara , Kirill Tkhai Subject: Re: [PATCH 0/2] page_count can't be used to decide when wp_page_copy Message-ID: <20210109193224.GB35215@casper.infradead.org> References: <20210107200402.31095-1-aarcange@redhat.com> <20210107202525.GD504133@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Thu, Jan 07, 2021 at 01:05:19PM -0800, Linus Torvalds wrote: > Side note, and not really related to UFFD, but the mmap_sem in > general: I was at one point actually hoping that we could make the > mmap_sem a spinlock, or at least make the rule be that we never do any > IO under it. At which point a write lock hopefully really shouldn't be > such a huge deal. There's a (small) group of us working towards that. It has some prerequisites, but where we're hoping to go currently: - Replace the vma rbtree with a b-tree protected with a spinlock - Page faults walk the b-tree under RCU, like peterz/laurent's SPF patchset - If we need to do I/O, take a refcount on the VMA After that, we can gradually move things out from mmap_sem protection to just the vma tree spinlock, or whatever makes sense for them. In a very real way the mmap_sem is the MM layer's BKL.