Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4375458pxu; Wed, 9 Dec 2020 15:52:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzoHIJcKMxjizcWH6yZW3E8rDx88vekv+8VsGqVE8IlFbbcmp3Td8LAUVRhRMEJSMN/3ui X-Received: by 2002:a17:906:941a:: with SMTP id q26mr4112425ejx.227.1607557935345; Wed, 09 Dec 2020 15:52:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607557935; cv=none; d=google.com; s=arc-20160816; b=ZNYn/QR/b6aTxWyVAthUgjZQo+JySpQWC0RxSj1gn/OD4+YlH4kvKu6yBQBfXVp7Eh CkmUQbm7Yo4Cci8tz/c8cvjny5sVtLWCVzw+8BaThjYgh2H5dNGdvqvTCfQ8ikFdP7nA p/Rw2fpHmFPx+p0QDQHKD7CouoEh2lF4GAL8uv66Dxs7NQeuchJTO0hg32pSJubr3brt tN8NXIX3xnVgZSD3EMylWIRPZsaIq6RUK2YobxdOSKju24qcCJ5WvcOWVngnde6PqLYd gkTbHGfLddKC55hvR4bx/MbRwSIcRFw7SKjHtUTLVGphwp3wh0iMHS4OaRj3wam/z4hR Vmng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bGzrld7wr84RrSgEszhR+wmk08YFGa6cLi6pnZc4i/0=; b=oxpm3R8vQhC//iqdtHyhU8NY1dsQvHkeM2eMpSd0fiWiD8VFgqHJSLozTDvYBZ/Uwm O/8TkTqu6zRaokEoF2j6y+01TYnNaiNvMuREEpgYFcm3cJ7NqgvkKkgNl8JM5Qy8w+UX K0LBuhynMCoEAQb01aIXCNU8vEm3cmEdKL8saO6saqQLTsKw3QnzMw7i9VhXclaesPtN hcfkUbMQ7ktxceQXRYlFTxXcOmaKmEa8GaUtM0fmgQqLaXYDEVBQnEurdyHlmhR9MkwS CrM6kYz8sMfgvhLHXIEeYv68GPRosbYCctoMTzznEJrWF28GNjO59LuxzUP4hPNlURu9 YVRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=QaMIoLxv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rh9si1703710ejb.507.2020.12.09.15.51.52; Wed, 09 Dec 2020 15:52:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=QaMIoLxv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387643AbgLIUct (ORCPT + 99 others); Wed, 9 Dec 2020 15:32:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728070AbgLIUcs (ORCPT ); Wed, 9 Dec 2020 15:32:48 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0E17C0613D6 for ; Wed, 9 Dec 2020 12:32:08 -0800 (PST) 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=bGzrld7wr84RrSgEszhR+wmk08YFGa6cLi6pnZc4i/0=; b=QaMIoLxvrAk+bVYa5OQVotE5Fc Z1ucapu5XB9I19/2+q9oJ/oXw2s4AAf+/aFypyM5ukgfHHzhsxu6bhWSLEJMll9S65wTjSLPtvU4Q e3xF3Y+A/Oef0602EVYxB4cYNjv1IUBbj8FSla0mNhJ217jHOFm/NgN3bjRhaqxtxxC45shK4lpYo rDnhULs6H5LISfoOOlofa/K5CiZBMyRux/qMHXB5I/9VkXhZKIpLHBs1Lp07P/Do1fCzf/jq9hRUY vQL3G487WOceGg6FvaaVdigeo4TmuwPaKnajJY6ROPQz3AzNouMSTE2HOQYguKRofkVBoJvrWdRCq vjhcjcxg==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kn683-0007vi-5V; Wed, 09 Dec 2020 20:32:03 +0000 Date: Wed, 9 Dec 2020 20:32:03 +0000 From: Matthew Wilcox To: Linus Torvalds Cc: Will Deacon , Linux Kernel Mailing List , Linux-MM , Linux ARM , Catalin Marinas , Jan Kara , Minchan Kim , Andrew Morton , "Kirill A . Shutemov" , Vinayak Menon , Android Kernel Team Subject: Re: [PATCH 1/2] mm: Allow architectures to request 'old' entries when prefaulting Message-ID: <20201209203203.GU7338@casper.infradead.org> References: <20201209163950.8494-1-will@kernel.org> <20201209163950.8494-2-will@kernel.org> <20201209184049.GA8778@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 09, 2020 at 11:04:13AM -0800, Linus Torvalds wrote: > In particular, it made it a nightmare to read what do_fault_around() > does: it does that odd > > if (pmd_none(*vmf->pmd)) { > vmf->prealloc_pte = pte_alloc_one(vmf->vma->vm_mm); > > and then it calls ->map_pages() (which is always filemap_map_pages(), > except for xfs, where it is also always filemap_map_pages but it takes > a lock first). ... which is wrong. Dave's paranoia around other people introducing bugs into XFS made him do this, but we should revert cd647d5651c0b0deaa26c1acb9e1789437ba9bc7. Those operations he's worried about are protected by the page lock. If a filesystem has put an Uptodate page into the page cache, the rest of the kernel can read it without telling the filesystem.