Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp8031882pxu; Sat, 26 Dec 2020 13:19:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxM3HA24BqLW+D0d/S8OAwti2Wg99GDx7HAN2oXSocsGq6+26cHFXyQMRRHtg9LB22/ChTl X-Received: by 2002:aa7:c98d:: with SMTP id c13mr37878095edt.188.1609017556017; Sat, 26 Dec 2020 13:19:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609017556; cv=none; d=google.com; s=arc-20160816; b=oVUwV9r80qfaFKhKAE1PkN58dx6VnAU7H5EOpIM8BekQFO4aSFxOfJnzwQtJBURABf IBIIEWhNsYe+UGguy3d543g9dVzZrRxUGU8bQLTdeD4eXQScbn7+h4tyoTjq82OcvR3Z MPcD9IZT8Q8pHgC7+nmSNwCQVJqdsCjjmkYmBEAoNk1xILT64wsHN4HtpCivG2fMrcHO JundzL/iDKtYpSziOksPQfdSHkHh9yjXgEydd4N2zaR8dwP2dw6SV1FiY7f4Xt1K3yUA 76NfmXvyCsWew7CagOC4jkaWb8S0L9nuV0yuYChWvMSllXbsda2VJo4uSrh4n3xtno7l cCEA== 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=GQiB/N6vURjg6dOpOwGpn1IZbShpuFXt1LxjdVRRQl0=; b=U0/Sy55OHOhyrzIUj5wDxe+mcCufRd2zazHJV0JuXMmNrV2vOHMLyy9uZ5l5xkW4oP yitiMcO1YFAzBgwarZ/RhpcG5ClHhuHbYv2vSh9TOW+RAOlGBij/zn6UlXMp/JGk2xXV YAuKRavmDN22uc3WQ6klUYGRki0uohrrQF2rMWd7gKB2oIXA3IfJCtX2cSYlv9IpYRAO 1hJqun68QvmEsWKgUVUqsVKD4JAT3lIU2TYTYFZYcVKfJ4E/z3wW+FNXaKUpzpuUlABf K6ha2rHx7KjrQb74pfbX3icJwQqI4+AaSizwrFouwgc8TP6oh8ZrLtt4BBqACAtDOfBf egGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=QrKZyWIl; 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 e5si18711518edr.30.2020.12.26.13.18.52; Sat, 26 Dec 2020 13:19:16 -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=QrKZyWIl; 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 S1726019AbgLZVRK (ORCPT + 99 others); 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-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