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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 DA438C433E0 for ; Sat, 26 Dec 2020 21:18:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A632D216FD for ; Sat, 26 Dec 2020 21:18:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726035AbgLZVRK (ORCPT ); Sat, 26 Dec 2020 16:17:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725849AbgLZVRK (ORCPT ); Sat, 26 Dec 2020 16:17:10 -0500 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8082DC061757 for ; Sat, 26 Dec 2020 13:16:29 -0800 (PST) Received: by mail-lf1-x136.google.com with SMTP id o17so15977866lfg.4 for ; Sat, 26 Dec 2020 13:16:29 -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=GQiB/N6vURjg6dOpOwGpn1IZbShpuFXt1LxjdVRRQl0=; b=QrKZyWIlQNpwpRfYAap3JBcf1Rgjp9mla47l8nPjUk+LtWkutlhkno0HRaeI8l01ze 7YIPTHmo7LEq6IcMWLNMdhZlYCfg4QQhLa63QwOUx0LM6Bq2XGpMey/60px88MgTnk+d uD/J9oj4ov7JCZjqnNkqKHZ6HLd20toudEO48= 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=GQiB/N6vURjg6dOpOwGpn1IZbShpuFXt1LxjdVRRQl0=; b=Cg2Fr3oDw8TCRVmhdv/TCIWnPzdX/R3KP4t/pZmz6mK05pPscW97ZZjwNpj5Kwv3ui OHxQLYP3m+1TQQwlppbez0riso9zNohKd0hoHVPFolSysML8idO5vc3wUluTnRqeKyMg JHZjXXbovxryhzeHB15EWm18TnKYCoUaeEoWpZh6LTQVhjXo2pj6B+60sYHdfo+uTDxf DnoMDn0LWMqCEB8T36/vcv4ZDPHFKPBynA7aKBkRLKS9NVErb27jQijn/MKppvDqvh9A r9s0Dy8JF5ZSb45yISSPTW5v3GHFNo8927GKv7Ktnj57xvs/YS9eB8MyXg9MtsvnUCRl BLiA== X-Gm-Message-State: AOAM532ud1zm7dxceY1aS12cxB4D0pmxlHTd1b0ala4o9ELKyms2rTR2 WTt9haxRP0ZEdYgkiMEc0FW2R4X6QQ9+Ag== X-Google-Smtp-Source: ABdhPJwPAHf4E/6Fo5DIZxkRRumu+Vds0wl60NgNq/gzP4h/RhUR4pis4UYYos42jtARTnIrsba6Gg== X-Received: by 2002:a05:651c:118b:: with SMTP id w11mr11397127ljo.402.1609017387348; Sat, 26 Dec 2020 13:16:27 -0800 (PST) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com. [209.85.167.44]) by smtp.gmail.com with ESMTPSA id j21sm4694319lfe.83.2020.12.26.13.16.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Dec 2020 13:16:26 -0800 (PST) Received: by mail-lf1-f44.google.com with SMTP id s26so15936163lfc.8 for ; Sat, 26 Dec 2020 13:16:25 -0800 (PST) X-Received: by 2002:a2e:9b13:: with SMTP id u19mr17749625lji.48.1609017385687; Sat, 26 Dec 2020 13:16:25 -0800 (PST) MIME-Version: 1.0 References: <20201217105409.2gacwgg7rco2ft3m@box> <20201218110400.yve45r3zsv7qgfa3@box> <20201219124103.w6isern3ywc7xbur@box> <20201222100047.p5zdb4ghagncq2oe@box> <20201225113157.e7hmluffh56fszfc@box> <20201226204335.dikqkrkezqet6oqf@box> In-Reply-To: From: Linus Torvalds Date: Sat, 26 Dec 2020 13:16:09 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] mm: Allow architectures to request 'old' entries when prefaulting To: Hugh Dickins Cc: "Kirill A. Shutemov" , 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 Sat, Dec 26, 2020 at 1:04 PM Hugh Dickins wrote: > > > Hold on. I guess this one will suffer from the same bug as the previous. > I was about to report back, after satisfactory overnight testing of that > version - provided that one big little bug is fixed: > > --- a/mm/filemap.c > +++ b/mm/filemap.c > @@ -2919,7 +2919,7 @@ static bool filemap_map_pmd(struct vm_fa > > if (pmd_none(*vmf->pmd) && > PageTransHuge(page) && > - do_set_pmd(vmf, page)) { > + do_set_pmd(vmf, page) == 0) { > unlock_page(page); > return true; > } I missed that entirely, because when just reading the patch it looks fine and I didn't look at what do_set_pmd() function returns outside the patch. And maybe it would be better to write it as if (pmd_none(*vmf->pmd) && PageTransHuge(page)) { vm_fault_t ret = do_set_pmd(vmf, page); if (!ret) { ... instead to make it a bit more explicit about how that return value is a vm_fault_t there... And see my other email about how I suspect there is still a leak in that patch for the previous test-case. Linus