Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp453678pxb; Wed, 20 Jan 2021 11:02:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJzXmAY+vJtsEGcNbm5AbD0dw2fIqtci0OuodHkTWz0FuiZPD/kuzGsP5E5WNWJG5QewTSYh X-Received: by 2002:a17:906:578e:: with SMTP id k14mr2921637ejq.243.1611169333130; Wed, 20 Jan 2021 11:02:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611169333; cv=none; d=google.com; s=arc-20160816; b=cANNZFOaN8kig9cbWMxxPr4iOVDpFOOE/edEut/RFKMxZsKjJJZpQE2EFgrtPMJXby rXgHIWUS0Oxe/bGZdLmUFbEGohWihbfkmFBmq5Whas/CcOP6skCfMaMJ3rm8BlZkBGEx HtDM023X3Z7RHLTHGGG+2H3GZRRzwCN5bVTbysn0wVrYDPGeuC4Yt3bLZu/s6Z/qL5Ag FNNUekCcZqIORnX1cOHHBzT3od4bbdaQxXNfRyNcC7taxLlKvJ/nHhkPGXkQ/Z7+5H93 A88eEnZwOcs+O7U3vZXDNbxHei3rQrOFbqDZ1t1YljUJHkdl2frx3qdKxYGsxif7QrXi kDVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=CXnXNZsNahUccT31jVrciKJD2zFsBdsfQ8xevL7FroU=; b=UyzHfj0/d5CfCP4RggVt993D4AaBUssT2j4YuSNex9UI0YZYGT373LSm5aA7ge5X8B F1zq5aR5Crh1lncCk0HO+/vcA2CGs8S7BqcJU0sAj07h6NLfeo3oQ8iKX5QMTA+PlWwK WDLrLy/AtQCNDxEtfXrDapiTFw27d5BVeQJDiuMN9l6NVtSj/SKXS2sVj/xw/mmTLqRN gYNdCC5rkC7G8A1TqiWUKplurkPLeDeg/CDHKH5KsqCYAvG8mP3awtBJ+A3zg/+Y2IVw 3heC8Ju027ytE5d9WQOKOOxyx1GjTZhZR/MX4ELi4iJHUGPXyTEddtk13V0mbOch3hMY /bQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DVUl+Max; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n12si1140684edo.512.2021.01.20.11.01.46; Wed, 20 Jan 2021 11:02:13 -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=@kernel.org header.s=k20201202 header.b=DVUl+Max; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392428AbhATTBD (ORCPT + 99 others); Wed, 20 Jan 2021 14:01:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:37670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729736AbhATRhE (ORCPT ); Wed, 20 Jan 2021 12:37:04 -0500 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.30.0.284.gd98b1dd5eaa7-goog