From patchwork Wed Jan 20 17:36:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 12033029 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=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 ED2E4C433DB for ; Wed, 20 Jan 2021 17:36:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 77029207C4 for ; Wed, 20 Jan 2021 17:36:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 77029207C4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AA0626B0005; Wed, 20 Jan 2021 12:36:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A51176B0006; Wed, 20 Jan 2021 12:36:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9678E6B0007; Wed, 20 Jan 2021 12:36:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0245.hostedemail.com [216.40.44.245]) by kanga.kvack.org (Postfix) with ESMTP id 7FB756B0005 for ; Wed, 20 Jan 2021 12:36:24 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 3DCFE8249980 for ; Wed, 20 Jan 2021 17:36:24 +0000 (UTC) X-FDA: 77726857488.27.crown16_3f13c1d2755c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 1BEB53D663 for ; Wed, 20 Jan 2021 17:36:24 +0000 (UTC) X-HE-Tag: crown16_3f13c1d2755c X-Filterd-Recvd-Size: 4587 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Wed, 20 Jan 2021 17:36:23 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id E2365233ED; Wed, 20 Jan 2021 17:36:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611164182; bh=fsx985f1cF1hEHYZaVWNKqVRb18Pc9UFt6saI96uias=; h=From:To:Cc:Subject:Date:From; b=DVUl+Max0jMmGMvXzEUIQcLVFWxcdykdPnqhw3tSjJWuPNP6+yLq5ZNhba6P0Bz7J M1j/Ht6EVoWncHRlcuTGxP6rdSsOBDFAbLfXbRSfXbb1naFji20egWauJE1r/YliEq dRzkLRkK0hGfHpS9gf0DJzaaale4w5jcprkHkKTMRR+QD/jY0VVfWq995pzMCCTGUP qZckjFa4k4jgFWF3tPFPiMjLb9Q2bqTTqSOiEZF81t83y6rQ/rsB72EBm/UVWOmihJ 6aXG5TTaV+mPmVuneIwZcWANOl08n+uZ82diqbwOPp4ZC55Cyk3Qmu4w2TbByj0BAj 8twZRX2B5Ynhw== From: Will Deacon To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, Will Deacon , Catalin Marinas , Jan Kara , Minchan Kim , Andrew Morton , "Kirill A . Shutemov" , Linus Torvalds , Vinayak Menon , Hugh Dickins , Nick Desaulniers , kernel-team@android.com Subject: [PATCH v4 0/8] Create 'old' ptes for faultaround mappings on arm64 with hardware access flag Date: Wed, 20 Jan 2021 17:36:04 +0000 Message-Id: <20210120173612.20913-1-will@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 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: Hi all, This is version four of the patches I previously posted here: v1: https://lore.kernel.org/r/20201209163950.8494-1-will@kernel.org v2: https://lore.kernel.org/r/20210108171517.5290-1-will@kernel.org v3: https://lore.kernel.org/r/20210114175934.13070-1-will@kernel.org The patches allow architectures to opt-in at runtime for faultaround mappings to be created as 'old' instead of 'young'. Although there have been previous attempts at this, they failed either because the decision was deferred to userspace [1] or because it was done unconditionally and shown to regress benchmarks for particular architectures [2]. The big change since v3 is that the immutable fields of 'struct vm_fault' now live in a 'const' anonymous struct. Although Clang will silently accept modifications to these fields [3], GCC emits an error. The resulting diffstat is _considerably_ more manageable with this approach. As before, I've also updated this branch: https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git/log/?h=faultaround Cheers, Will [1] https://www.spinics.net/lists/linux-mm/msg143831.html [2] 315d09bf30c2 ("Revert "mm: make faultaround produce old ptes"") [3] https://bugs.llvm.org/show_bug.cgi?id=48755 Cc: Catalin Marinas Cc: Jan Kara Cc: Minchan Kim Cc: Andrew Morton Cc: Kirill A. Shutemov Cc: Linus Torvalds Cc: Vinayak Menon Cc: Andrew Morton Cc: Hugh Dickins Cc: Nick Desaulniers Cc: --->8 Kirill A. Shutemov (1): mm: Cleanup faultaround and finish_fault() codepaths Will Deacon (7): mm: Allow architectures to request 'old' entries when prefaulting arm64: mm: Implement arch_wants_old_prefaulted_pte() mm: Move immutable fields of 'struct vm_fault' into anonymous struct mm: Pass 'address' to map to do_set_pte() and drop FAULT_FLAG_PREFAULT mm: Avoid modifying vmf.address in __collapse_huge_page_swapin() mm: Use static initialisers for immutable fields of 'struct vm_fault' mm: Mark anonymous struct field of 'struct vm_fault' as 'const' arch/arm64/include/asm/pgtable.h | 12 +- fs/xfs/xfs_file.c | 6 +- include/linux/mm.h | 25 ++-- include/linux/pgtable.h | 11 ++ mm/filemap.c | 178 ++++++++++++++++++------ mm/khugepaged.c | 37 +++-- mm/memory.c | 223 +++++++++++-------------------- mm/shmem.c | 6 +- mm/swapfile.c | 11 +- 9 files changed, 280 insertions(+), 229 deletions(-)