Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp8663659pxu; Sun, 27 Dec 2020 15:16:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJwz1npHumvlKMxz/o3PuvTq5WX3UhU5uGoR+fRW18VWNjWtrBm409G9fJ3ax+ifYKMdpjQk X-Received: by 2002:aa7:c353:: with SMTP id j19mr40140034edr.204.1609111008846; Sun, 27 Dec 2020 15:16:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609111008; cv=none; d=google.com; s=arc-20160816; b=oiu3Q/3IqdAAU7jNXtUrFfdiNtd8qeDqaGxqR7OPIuapqUwbu/qsdjL3gAmo8mkili N9DW3vWMRWlAlR783lTUEbL4Gw8/b8WknpYi5Wd9RAgL+KRQkcCZZWIOc7r7uCIKQBMV hCr1qLFaRrZRnT/NjIc+8JJYycv8ED9eMufEqk6XFct2ySShmBunPOw/ieVs/W7G0vkU Qa7I4uLBOfviFTA9T0sjDIhw93jjxMclPLbnBQ1AHKo7LrFtnHlEEn3bs08NKPy9j9FH JFfN9S+xHG1yr8LM+p4aEbT9PeGFU9vPuoDlNtUcubGlcJpqyuC7WQF5SlNeFb7fJYFG V3yA== 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=RSmKP+4DHR+1awHDeHgV5IDiZ8/52adpWBT7V8j8+/c=; b=j1PYzLRttKDkWdLgbW5qec6Zbp7+CQnc9S3lESrAZoSyC6EVQgicUxEx+RfAu5RDoA 8MpdjexR9KNAvOKDnW0V6gCv/JyobGWP3IWzLSDKVxeKPj4QpC60BqfWRvV35c6NOnUC 3E8XPF/e1URCWKc/ONmkr620KVxDI+VhpZ4zOk+IzkZAfZ5RH9qTP3m7fNRxrR9TdJ32 zgbca3RtnhsWhdjVhwymhxU1/WtfHgtXq+MRDfsT9jCtc8vRvnOs8j2Tk0TamSJwJvJg rgSYl8JBI5Bb40UKRq2JBd8o+jHmipEV9mQdXIkUCz2VQccN0K+nW0rIemehSGuYU6wa sQxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=hCALE3m1; 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 q26si20939070edi.38.2020.12.27.15.16.03; Sun, 27 Dec 2020 15:16:48 -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=hCALE3m1; 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 S1726300AbgL0XNk (ORCPT + 99 others); Sun, 27 Dec 2020 18:13:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726280AbgL0XNj (ORCPT ); Sun, 27 Dec 2020 18:13:39 -0500 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D615C061794 for ; Sun, 27 Dec 2020 15:12:59 -0800 (PST) Received: by mail-lf1-x131.google.com with SMTP id h205so20369700lfd.5 for ; Sun, 27 Dec 2020 15:12:59 -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=RSmKP+4DHR+1awHDeHgV5IDiZ8/52adpWBT7V8j8+/c=; b=hCALE3m1epiX9YZGdf3SFNc65rh6giJub1KEifcHrz7dfsV+iLZZ1yQbztPQwzCilR yexTl418aHE8W2C+lF/5C8B1Okv0d2RSuOQLdI/dxlf4aXUtnLQTxrhDym9sU5WBUKlt wrvLIqSAeVQHdE9dqCuMS/TXQT0p6bIRzVtoA= 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=RSmKP+4DHR+1awHDeHgV5IDiZ8/52adpWBT7V8j8+/c=; b=ONkRElCcJpeI+CvPKFwMZ+StnbogF7irFlffHDaqBwqAHIdBm5E/ly8eNXeMs1sYlJ p3zQlkvPZrBIaPjFsdGlXGQlzHd0oPis+bEw1UQkOB7MjUWtCasu1RSMPjQ1E9zPqv68 E8jtvYwWp/LtX77BP48N1qYDEgsWJw2QfpCqLA4dq4FfSCbgCjKt+RmGw5dOjIcaojuO 3q/yHwZdoT0S8WGo4JYhQOkGFEYZhSe8yvfnJzlM2jKi2v723AJWq5Wz1hLPKk3odNxi i5OCNXjI/aANRo/if/et9CDii5/TVNg2HNJ0Y0oJM/c1cVrYTOzlQ0oy8PPflYTiX0le 7ezw== X-Gm-Message-State: AOAM531MgnqyNzjY4efREVMlaUEnopQ60aSPEO4iGHkGoUgAL/thyQ88 2pkI/scoxUI4NcpupX0hHV/ZDDTWJPk8VQ== X-Received: by 2002:ac2:43a4:: with SMTP id t4mr19143891lfl.197.1609110777200; Sun, 27 Dec 2020 15:12:57 -0800 (PST) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com. [209.85.167.46]) by smtp.gmail.com with ESMTPSA id u25sm6223120lji.99.2020.12.27.15.12.55 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Dec 2020 15:12:55 -0800 (PST) Received: by mail-lf1-f46.google.com with SMTP id h205so20369576lfd.5 for ; Sun, 27 Dec 2020 15:12:55 -0800 (PST) X-Received: by 2002:a05:6512:3048:: with SMTP id b8mr18744696lfb.421.1609110774796; Sun, 27 Dec 2020 15:12:54 -0800 (PST) MIME-Version: 1.0 References: <20201225113157.e7hmluffh56fszfc@box> <20201226204335.dikqkrkezqet6oqf@box> <20201226224016.dxjmordcfj75xgte@box> In-Reply-To: From: Linus Torvalds Date: Sun, 27 Dec 2020 15:12:38 -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 , Andrew Morton Cc: Damian Tometzki , "Kirill A. Shutemov" , Matthew Wilcox , "Kirill A. Shutemov" , Will Deacon , Linux Kernel Mailing List , Linux-MM , Linux ARM , Catalin Marinas , Jan Kara , Minchan Kim , Vinayak Menon , Android Kernel Team Content-Type: multipart/mixed; boundary="00000000000023095205b77a4c68" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --00000000000023095205b77a4c68 Content-Type: text/plain; charset="UTF-8" On Sun, Dec 27, 2020 at 2:35 PM Hugh Dickins wrote: > > Yes, this one passes my testing on x86_64 and on i386. Ok, good. > But... > > ... Damian very helpfully reports that it does not build when > CONFIG_TRANSPARENT_HUGEPAGE is not set, since the "static " has > not been removed from the alternative definition of do_set_pmd(). Ok, your fix for that folded in, and here's yet another version. Damian, hopefully your configuration builds and works too now. But obviously it's too late for this merge window that I'm just about to close, so I hope Andrew can pick this up - I hope it's now in good enough shape to go into -mm and then we can do it next merge window or something. Andrew? Linus --00000000000023095205b77a4c68 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-codepaths.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_kj7qzt7d0 RnJvbSBmYTEzMWIwMmFkYTMwYjIwMTk0ZWM1ZTc2Yzk3Y2JlZDM4NDY1MzU2IE1vbiBTZXAgMTcg MDA6MD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