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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 0622CC433DB for ; Tue, 29 Dec 2020 20:53:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6D5B320771 for ; Tue, 29 Dec 2020 20:53:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D5B320771 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9740C8D0038; Tue, 29 Dec 2020 15:53:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 94D4A8D002C; Tue, 29 Dec 2020 15:53:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 889318D0038; Tue, 29 Dec 2020 15:53:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0055.hostedemail.com [216.40.44.55]) by kanga.kvack.org (Postfix) with ESMTP id 72C718D002C for ; Tue, 29 Dec 2020 15:53:20 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 38186181AEF10 for ; Tue, 29 Dec 2020 20:53:20 +0000 (UTC) X-FDA: 77647520160.25.cars94_5308d2e2749f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id ECBC71804E3A0 for ; Tue, 29 Dec 2020 20:53:19 +0000 (UTC) X-HE-Tag: cars94_5308d2e2749f X-Filterd-Recvd-Size: 5941 Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Tue, 29 Dec 2020 20:53:19 +0000 (UTC) Received: by mail-lf1-f53.google.com with SMTP id l11so33530470lfg.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=AKPuCiNXfpaa4HAJm/xsBHDmX9qWlxSMC2xAfaLDm+WgRigsRwweAXR0BKzXtcPV8p PoDxtkEmwzmWJnhBNQeSBvrwV6/D+teF2dUcFoe8isiGvzWcPmffI8QTodQqQEVRWw9G 1lwLuE2HyNPf+gh7zFT1+IuwtGGWOP1AW/kLCX1UrjMTsIKR7AiSEGiNmEiWKSbldU8S XJbsvBAx68FXISwsyhSbma6vkeIMG1yyTrt3H2gJzMBEe88Ms0zAm8fdPSOB/LL+RxVo F0S7c3qLdFlrkI3i2lfs4g95JXgYew0HlWFf6FYT0SDlxrsgdxaioGMEhuR1xsH1BOTQ mh0Q== X-Gm-Message-State: AOAM531/A17wXyTnuaRfqJ1Mv3NTulw9BG94WzNKt+zNqQRczdOsq7ij BohnV/KW2o1RIzvnXSfvraa/XdZDB2OS9g== X-Google-Smtp-Source: ABdhPJxQta7tw03ZIW6GMNjLXSB8+vxMPXeTNuayRbU81WqUEk06rZZ5bCAaXtgwLIgMQBg/FpQJtQ== X-Received: by 2002:a2e:7803:: with SMTP id t3mr26305629ljc.213.1609275197276; Tue, 29 Dec 2020 12:53:17 -0800 (PST) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com. [209.85.167.52]) by smtp.gmail.com with ESMTPSA id j20sm6988496ljc.47.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-f52.google.com with SMTP id m25so33414021lfc.11 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" 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 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