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.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 273E0C4361B for ; Thu, 17 Dec 2020 10:54:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6F145233FE for ; Thu, 17 Dec 2020 10:54:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6F145233FE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7F6966B0068; Thu, 17 Dec 2020 05:54:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7A7036B006C; Thu, 17 Dec 2020 05:54:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 694606B006E; Thu, 17 Dec 2020 05:54:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0041.hostedemail.com [216.40.44.41]) by kanga.kvack.org (Postfix) with ESMTP id 529CE6B0068 for ; Thu, 17 Dec 2020 05:54:10 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 0AF528249980 for ; Thu, 17 Dec 2020 10:54:10 +0000 (UTC) X-FDA: 77602464660.20.spark28_2d03a6427434 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id E0292180C07A3 for ; Thu, 17 Dec 2020 10:54:09 +0000 (UTC) X-HE-Tag: spark28_2d03a6427434 X-Filterd-Recvd-Size: 5176 Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Thu, 17 Dec 2020 10:54:09 +0000 (UTC) Received: by mail-lf1-f52.google.com with SMTP id u18so56211990lfd.9 for ; Thu, 17 Dec 2020 02:54:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=U2gdYWgfYq7/caNuHmA4slgJYp3VoGcO5t/XEQGLQQ0=; b=Y0vnIunm2BtL/nDigBSGNBcw/P80MeXJ3EktmUtjqwbdQoeIMih/9ec50Y2mgdyVGb YicrV8G2h8AV7KYlpscj68yN6nUzW0bmrl0gG0ZpUfAycLNiq46+sz0B8r1KAYx1PDq7 dw4YSLjL7JryxLo9VaWuFT+c+e6kqeKEUeiXQ/vTD6qRGPK+35YudpfKB0RIuykYkhIM 1r5hDiInL8OOBEMkGwmVjtF3UzBhSIeglXR/Yq6g8C/3CZj+I0mq939SwuzDEGrjza8W ffCRQAIVjRM5g1L2nolpR+H5YxTTI6hKuFwtw3oUmloGhOGPHj/qJ9CL7h9enpMfNt+q IMqg== 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:in-reply-to; bh=U2gdYWgfYq7/caNuHmA4slgJYp3VoGcO5t/XEQGLQQ0=; b=LaS3WSfDbeH3UVQJhAjiCl08O+j60EjL1HNMwRD0xEGZSPw6iwfKVa4p0GxfHR9uCL reK3q94h68/GyHXWxlgnggko52Ng5nsq9fsFr9LYUs+DCQw8aE6BgvVnzLGPa5+t4dD3 KoLt3E73tVfmYOtBhjqpq4J+VICnAwc1NvZCEfLnXLURkzP7w1zuFMup1bL+kn+DYrzl tWb/w3Fj3gREU1a/ueQFW+8ZDAGIwunRKHSZoXE/18ZyAAv+fy7GyCfzl53nsQDvh02V 5c/5ZEhFAbdttOXfqEhIVZV+TN6TOCJ2QBzX7Wfp9GIY0mQrrqY8r+OBF0fU65IPCKOO AeBA== X-Gm-Message-State: AOAM530tUdPpZ26iOr94wzo7QEXCTziG6e9xbknvsFnlEcsapfAKqENF Wg1t19QHMDTyiAsJEio3n/Wcgw== X-Google-Smtp-Source: ABdhPJw5YnXWpK4XOuli92QD7Gp3bI1r5jX1GrLIR/ZzJhjBrvbLIp9dNy4FbuDSBpMT+m8YLfK+2Q== X-Received: by 2002:a2e:918f:: with SMTP id f15mr8283125ljg.82.1608202447739; Thu, 17 Dec 2020 02:54:07 -0800 (PST) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id j1sm545204lfg.225.2020.12.17.02.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 02:54:07 -0800 (PST) Received: by box.localdomain (Postfix, from userid 1000) id 011E31033F4; Thu, 17 Dec 2020 13:54:09 +0300 (+03) Date: Thu, 17 Dec 2020 13:54:09 +0300 From: "Kirill A. Shutemov" To: Linus Torvalds Cc: Matthew Wilcox , "Kirill A. Shutemov" , Will Deacon , Linux Kernel Mailing List , Linux-MM , Linux ARM , Catalin Marinas , Jan Kara , Minchan Kim , Andrew Morton , Vinayak Menon , Android Kernel Team Subject: Re: [PATCH 1/2] mm: Allow architectures to request 'old' entries when prefaulting Message-ID: <20201217105409.2gacwgg7rco2ft3m@box> References: <20201209163950.8494-2-will@kernel.org> <20201209184049.GA8778@willie-the-truck> <20201210150828.4b7pg5lx666r7l2u@black.fi.intel.com> <20201214160724.ewhjqoi32chheone@box> <20201216170703.o5lpsnjfmoj7f3ml@box> 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 Wed, Dec 16, 2020 at 10:41:36AM -0800, Linus Torvalds wrote: > On Wed, Dec 16, 2020 at 9:07 AM Kirill A. Shutemov wrote: > > > > If this looks fine, I'll submit a proper patch. > > That patch looks good to me. > > It would be good if somebody else looked it through - maybe I like it > just because I got to pee in the snow and make my mark. But i think > that filemap_map_pages() now looks a lot more understandable, and > having that pte_offset_map_lock() outside the loop should be good. It worth noting that after the change in the worth case scenario we will have additional ref/unref and lock/unlock of the page if we get deep enough into filemap_map_pmd(), but fail to map the page. Also if the range doesn't have a mappable page we would setup a page table into the PMD entry. It means we cannot have huge page mapped there later. It may be a bummer: getting the page table out of page table tree requires mmap_write_lock(). We also take ptl for cold page cache. It may increase ptl contention, but it should be negligible with split-ptl. -- Kirill A. Shutemov