Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp10070806pxu; Tue, 29 Dec 2020 12:55:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJzjRHTwlC9IBGWCixlQHQQ6vYXXs04nl4fFqt1RyiuCd97g6qt97KDkwFDw8ANgdojHJ9St X-Received: by 2002:a17:906:5f92:: with SMTP id a18mr48497137eju.126.1609275303105; Tue, 29 Dec 2020 12:55:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609275303; cv=none; d=google.com; s=arc-20160816; b=mE+3069jvZeE6XIvyHS+txypmW+ti8Dck/H8NTLA9bUWUoNfU558AW6FPQCKrGW2AD sA9SWCN8sDUVHHbamjOMtS7xo6p3c1Z6yDJyVZysjjU/v7oRAc2AZP8C+Vu9syMyLenu Qsv4OONUeBjwMNOBNUFUpcvHNXj9fbR3Q+UI7mlyvAvgTJwR0XION8AKTU2zWHlcVQm7 v9lKMwIxCagD9pGtYzLvY2HoRrYMCNflTV4M+oTc5txLCjPZkO9BeRyqlpPasr/iJedt KhFxhj+N0+hOdTRJGujb9OuWcGdgBdS+DV/yGDrmAPYTaePz7W2ji6Ne6gZruj1LQSZv hbhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=dX68ilDXqjy1fUBrgW9VQ3uuQmcUVgu3Z6hs0+zxIIQ=; b=aMyj7IZ3sJlrzh3E4bMlZrXpw+k00HX7Jsqpv9gkM9m1xlyLfEE7ATXK0KKZryd+NX DfPoM4PYYSOWIKcYhmmObfRgG0EDfGgtEeF2gPT+KF2oEzoOrcmHNhoBTJoBRs1QhDGG 1o20IrVDQeXxB5Dw1ZevkGs+hdpcCLOfEj7twSZZseqji3clWfh0iKhcWDKC5Q5z4IPk t+cZ9mb1sX/DXu3NjPoCtjfojDJ6qt17bNFeagp9xnSC6im7T50QfpoHEBl4s3i5MoUS vNV3ALeB0G67q+9IY3yWNuQi1u98Z6tx3Qs24uku54xCF1Zu/tc3sOGMwvXN39ddJFt5 bGiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=a7wrY1O1; 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 k18si21634392ejv.477.2020.12.29.12.54.40; Tue, 29 Dec 2020 12:55:03 -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=@linux-foundation.org header.s=google header.b=a7wrY1O1; 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 S1726189AbgL2UyA (ORCPT + 99 others); Tue, 29 Dec 2020 15:54:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726126AbgL2Ux7 (ORCPT ); Tue, 29 Dec 2020 15:53:59 -0500 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78077C061574 for ; Tue, 29 Dec 2020 12:53:19 -0800 (PST) Received: by mail-lf1-x129.google.com with SMTP id l11so33530459lfg.0 for ; Tue, 29 Dec 2020 12:53:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dX68ilDXqjy1fUBrgW9VQ3uuQmcUVgu3Z6hs0+zxIIQ=; b=a7wrY1O1/RN5nqFj+D0sSZcwTHnPS+6PSYnz1H9gUqvKMTfoLcKsnadMRpS1VAe7Gb 2yuzNGMoVPr0fpElXREonWdunB/Skoh9fNn9Rbft22u05UDRbxuQEdwAZM8o24/8t8RS uV26HhsyamQZTdN492hG4xq57TiZr2bLR9/KU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dX68ilDXqjy1fUBrgW9VQ3uuQmcUVgu3Z6hs0+zxIIQ=; b=oks+s/jOgJsdAGm2l1DIAeep2L9g5GVFveFEDCWvmYGS0/i0Yx8Z5UL3dru8ajuw4w RcMcPDNLBtHRv5MBL0W+LtI8p30Jul0z5WSxX5jPJZ3ErAegXH63VEve4Z3lzuw+bIFD 5nnEAFPVimTJAV+ChIqXSMKKWqxhyZmHRYU55ozpkg8dpdGANde0f3NqOfwgQd+RGYq0 68UOSJA/iBzgTZPxOwTZXmyMz1LIZgklrWh6n8TvVjybxUSLEKZvouEF1crl+acMSSj4 67vqmUWTQswr5IiAPCuEwZMBDiphAkj+mlhkkL+qZQgICXWFnTO2aFvCyM5oVviEpp4/ 37Tw== X-Gm-Message-State: AOAM530FwJ4lwCdXBgP7kRESBuOP2WOIorcUN6HNFyc/frAFS8tpAGQg AIz/rePnm5YXZQsoNdk/6JnzCjWrPx36FQ== X-Received: by 2002:a19:d86:: with SMTP id 128mr23210417lfn.317.1609275197233; Tue, 29 Dec 2020 12:53:17 -0800 (PST) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com. [209.85.167.51]) by smtp.gmail.com with ESMTPSA id x8sm5756440lfn.226.2020.12.29.12.53.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 29 Dec 2020 12:53:15 -0800 (PST) Received: by mail-lf1-f51.google.com with SMTP id h205so33438577lfd.5 for ; Tue, 29 Dec 2020 12:53:15 -0800 (PST) X-Received: by 2002:a2e:8995:: with SMTP id c21mr23846649lji.251.1609275194794; Tue, 29 Dec 2020 12:53:14 -0800 (PST) MIME-Version: 1.0 References: <20201226224016.dxjmordcfj75xgte@box> <20201227234853.5mjyxcybucts3kbq@box> <20201228125352.phnj2x2ci3kwfld5@box> <20201229132819.najtavneutnf7ajp@box> In-Reply-To: <20201229132819.najtavneutnf7ajp@box> From: Linus Torvalds Date: Tue, 29 Dec 2020 12:52:58 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] mm: Allow architectures to request 'old' entries when prefaulting To: "Kirill A. Shutemov" Cc: Hugh Dickins , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 29, 2020 at 5:28 AM Kirill A. Shutemov wrote: > > I reworked do_fault_around() so it doesn't touch vmf->address and pass > original address down to ->map_pages(). No need in the new argument in > ->map_pages. filemap_map_pages() calculates address based on pgoff of the > page handled. So I really like how the end result looks, but it worries me how many problems this patch has had, and I'd love to try to make it more incremental. In particular, I really liked your re-write of the loop in filemap_map_pages(), and how you separated out the pmd case to be a separate early case. I think that was some of the nicest part of the patch. And I really like how you changed the vmf->address meaning in this latest version, and pass the real address down, and pass the range just in the start/end_pgoff. That just looks like the RightThing(tm) to do. But I think these nice cleanups could and should be independent of some of the other changes. The unlocking change, for example, that changed the return type from void to vm_fault_t, also looks like a nice cleanup, but that's also the one that caused the last series of odd problems for Hugh. The fix for that then also caused that ugly "goto out" mess, which undid some of the "this looks really nice" effects. I don't even see the need for that "goto out". Yes, it resets the 'vmf->address' back to what it should be (so that __do_fault() fallback can work right), but the two first "goto out" cases haven't actually changed it (or ther mmap_miss), so why did they need to do that? Anyway, I really like how it all looks (apart from that odd "goto out" detail - nitpicking here) but it does worry me that it changes so much and had so many small problems.. Linus