Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp8583467pxu; Sun, 27 Dec 2020 11:42:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8ZDHB7n5gVFv1LKXUedOKS3YQh6XjqTP1XuZVl8IQ4bohYj+LfiDbAmInvaGs+7vRDbNz X-Received: by 2002:a50:d50a:: with SMTP id u10mr39109004edi.58.1609098177061; Sun, 27 Dec 2020 11:42:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609098177; cv=none; d=google.com; s=arc-20160816; b=UCRHMG3OjRHkS6A3DdXTYO+4z4IazXpgcfXhZukj7rGCme7buJTBJ72wo2nw3P+Jbr bwbTAoWLwfmE4GR4nN7ISHw1ZMU7gjVdoUpMYgE4SADhrzNkm7LbV8KUFPpHEecIXYBl FMeUqOqG04oD469AgSBp6sKv4lHlDOKv3ILmQo5yAoWVq1yUez4kYWoU75uaUM4qzNgC Fd/fJn9zZPW62/fMfl+5ROJ0dHR2XxK+ce3OZ52nvXBx1IpLcZ0/5ao+UcgJfF30EbAz UVpDZG0IixtNFW4jLmRa7SCfTzKkDNZqAVj7+noP4HCjHY9UaYadderOkNeOPantFwoK KlsA== 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=8UXuJR/HUEQthawDwZNtLR+vABJfvjT8gL0JZHF5I1A=; b=ecpTjWpzgJaA+fqD8wPe0AXdzjuB16GyI/z5KQ+tB7sjqqeRY30RmsyZhitNO4u1Bl P0gtgWxDCbAObXyIZIXe+NvvulM83B4CFvX4y9PU5+kDGv2UZ8J3+9q/nSSbpBnmVT56 b/uexMisTlXkAec2zG5W+So8YML0xnx2inzELassViGNCp31Nk490E15zjeDDQXHnJHf Cx5sCLR5iRwD67ciDQZhtCL8UR2AgL5cuH4DnGpAMmyMWoAx1bPssKdx8Z4doWBfs1A9 22ZSZ/njppa0zpQXKkAnI19rAlK1hyqhwE3HyF26aZCwl232feiCDVmoCOBn+YsjOYG5 H17Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=M51p1D7L; 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 e8si19324161edq.377.2020.12.27.11.42.24; Sun, 27 Dec 2020 11:42:57 -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=M51p1D7L; 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 S1726204AbgL0TjY (ORCPT + 99 others); Sun, 27 Dec 2020 14:39:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbgL0TjX (ORCPT ); Sun, 27 Dec 2020 14:39:23 -0500 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82CE6C061794 for ; Sun, 27 Dec 2020 11:38:42 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id x20so19685323lfe.12 for ; Sun, 27 Dec 2020 11:38:42 -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=8UXuJR/HUEQthawDwZNtLR+vABJfvjT8gL0JZHF5I1A=; b=M51p1D7LW3agw/gYK90tk+YiEWR8dlAhEVVOFB4lMWz4lEsCR2pNMUz9beU9OISr5z blaWlT8JdC8eRqD+4HmlESQmbca43QMxdnFREv6zVs2ge1XZoShoPaolaOX1BQaG3cS+ N6KTabmKUySgHTHZADS+xG0mF437keGjJA/bY= 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=8UXuJR/HUEQthawDwZNtLR+vABJfvjT8gL0JZHF5I1A=; b=G3FNKtWcLcId3xVLpYVBVRxSvf1QD+E/ar3EZ2YHEZUCoYNX65sPFm9eHCoQPGtiGa F+tSgRrGL7EEQpV/HNbbhoIqbOb35SDGgGTxypPB81WFaqIINWGYLwwrUcp5kwHteQWR Lelh2hRfs6MgAnx3wbRVewICcU87+RJpjIfHrW8Cv3uRYqj4L0C7EoZzGzBs+xKDUruR REyZFfnK0IPZbbQvPsXVld+/B31E0YKn8mx5sYqip627j3CSTLd4NumqRZEfUmOfgJpm aUSCdWYIL4y/PYNPwgV40xkiT1hOB9hE6V1bAeXv4Z08xpjW0SWV4Bcq490OK+C4IQgO 5NaQ== X-Gm-Message-State: AOAM5337b9paJZeepZMGx3yTNTJRcgdREji0X4DOiKay3yy3Of9Ljp77 f1Ub+kIS/9XY3C91zV+mZzSpzw5JEYzdEQ== X-Received: by 2002:a2e:a407:: with SMTP id p7mr19736521ljn.78.1609097920731; Sun, 27 Dec 2020 11:38:40 -0800 (PST) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com. [209.85.167.54]) by smtp.gmail.com with ESMTPSA id l11sm5111761lfg.288.2020.12.27.11.38.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Dec 2020 11:38:38 -0800 (PST) Received: by mail-lf1-f54.google.com with SMTP id h22so19820341lfu.2 for ; Sun, 27 Dec 2020 11:38:38 -0800 (PST) X-Received: by 2002:a19:7d85:: with SMTP id y127mr18570775lfc.253.1609097918334; Sun, 27 Dec 2020 11:38:38 -0800 (PST) MIME-Version: 1.0 References: <20201219124103.w6isern3ywc7xbur@box> <20201222100047.p5zdb4ghagncq2oe@box> <20201225113157.e7hmluffh56fszfc@box> <20201226204335.dikqkrkezqet6oqf@box> <20201226224016.dxjmordcfj75xgte@box> In-Reply-To: From: Linus Torvalds Date: Sun, 27 Dec 2020 11:38:22 -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: multipart/mixed; boundary="000000000000d4f49305b7774d4a" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --000000000000d4f49305b7774d4a Content-Type: text/plain; charset="UTF-8" On Sat, Dec 26, 2020 at 6:38 PM Hugh Dickins wrote: > > This patch (like its antecedents) moves the pte_unmap_unlock() from > after do_fault_around()'s "check if the page fault is solved" into > filemap_map_pages() itself (which apparently does not NULLify vmf->pte > after unmapping it, which is poor, but good for revealing this issue). > That looks cleaner, but of course there was a very good reason for its > original positioning. Good catch. > Maybe you want to change the ->map_pages prototype, to pass down the > requested address too, so that it can report whether the requested > address was resolved or not. Or it could be left to __do_fault(), > or even to a repeated fault; but those would be less efficient. Let's keep the old really odd "let's unlock in the caller" for now, and minimize the changes. Adding a big big comment at the end of filemap_map_pages() to note the odd delayed page table unlocking. Here's an updated patch that combines Kirill's original patch, his additional incremental patch, and the fix for the pte lock oddity into one thing. Does this finally pass your testing? Linus --000000000000d4f49305b7774d4a Content-Type: text/x-patch; charset="US-ASCII"; name="0001-mm-Cleanup-faultaround-and-finish_fault-codepaths.patch" Content-Disposition: attachment; filename="0001-mm-Cleanup-faultaround-and-finish_fault-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