Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp722529pxf; Wed, 7 Apr 2021 09:57:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtUPbSd6wQkQrZkl7PmvBK6LyX1i6NGCaOp7BkSxYs3BvPqFM19tco2FspeoON5KoyjIoU X-Received: by 2002:aa7:c641:: with SMTP id z1mr5492078edr.144.1617814659885; Wed, 07 Apr 2021 09:57:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617814659; cv=none; d=google.com; s=arc-20160816; b=Wtb9vNaUKMoHTjG9rrU1kmXykXOz1hdFlRz/D8/f8fwmkNH4bmzedX19n0uQckRv2/ hE7DJPQimJIl6Nkq9r8NBAJKhjmBZn+67jekoiAgtZGxVZWuhmbV4r4/+cNv1B76RhqT mG98fR6wSuHMo288rWvP49pZBI6uGxq1j0rnwak6WvRdhmCy3Xq0rB8OGhF0RdINqhxC RqI5J8gvcLzbWQ90mauHO56KMn3pKo0I2YWI5NZOTH49cxMpgz0OVE6rSBgTxKX0cFsV kra5v3T5u/9e16S26gVKVqUYrPFEBR33Nlj8XwW78mTCdjwxbHkB9T+8HIF4HnrLA40R 7rrw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=52xfj//MRWSrbPuyYyafld4PYpnTwPxqkOlVrkxjHfQ=; b=TFyy9VlWIpaXiSLHbt1xUg4cyfiUgkk3wfbaI3Re7k6ZtbZ2HMf2ZYe/LtqUdnJy6n bjT45LWyqaNEMQ8A5gIK8uQGHxTDZkHLEX1U2ormDZ/wmyUGntHCJEEq2gok76wZfTAi 5hbRc287Dyb3k8FzuIhRCqGHGd3mcMdulOWinSXZAS0LPk9kAPjIa0kCd/Et8Cb+nm40 JQ33+UzjzpeGA/E1Y3p1GCSSYKuonhzxjFy5fgP9HH5MrrIunde9Hj0ZTCBRetmjxgHk qvUGVhcJ1CuaH7/HT4nvnxyPH3CSUf8sXMMZonntlOfssREyicLTZUXb28z7R+XalhjV ocKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (no key) header.i=@lespinasse.org; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-11-rsa header.b="OPSlT2/J"; 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=lespinasse.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si6558453ejz.726.2021.04.07.09.57.16; Wed, 07 Apr 2021 09:57:39 -0700 (PDT) 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=neutral (no key) header.i=@lespinasse.org; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-11-rsa header.b="OPSlT2/J"; 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=lespinasse.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347947AbhDGBwZ (ORCPT + 99 others); Tue, 6 Apr 2021 21:52:25 -0400 Received: from server.lespinasse.org ([63.205.204.226]:36151 "EHLO server.lespinasse.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347824AbhDGBvu (ORCPT ); Tue, 6 Apr 2021 21:51:50 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-11-ed; t=1617759902; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=52xfj//MRWSrbPuyYyafld4PYpnTwPxqkOlVrkxjHfQ=; b=GvnGI3H89uTnazRHTDjnxLW+ccgB0I6UmagHwVWO7+HvJmu/Xz4zrBwhYVsgpQqJep04E /mSNP7hSXpYMwncBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-11-rsa; t=1617759902; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=52xfj//MRWSrbPuyYyafld4PYpnTwPxqkOlVrkxjHfQ=; b=OPSlT2/JohSmnlkUlugEyrQWJGbWdvh3hCrR2zpCuBAkb0PqOs9L/8a1xMIkjUTPb6y/Y cqCd+Rc9KW52GcFFxiN8SD6vfmn3I1JFhCo5KiccQgfvcM6CJc3W8zaXuT5ThUVmeQhKxwF Vv3Tln3K/YyIUTnOCtq8l27Jcl2tKkKlNdHXJkUu60voSM8GWMYr/XoFYw5Fn5K+GWMGnRZ bjeI1gOPLQVsR1Dt87WfKPyDXGDlQTD2GsUHD0sXH2S2FGmhMwJAXew2nTK7G34kOVswtcU MBvREvEpTSbD6cIqxKwy6GYP58Sd0uTstf6uUtlS27n+sX9m3uunc/9bmcmA== Received: from zeus.lespinasse.org (zeus.lespinasse.org [IPv6:fd00::150:0]) by server.lespinasse.org (Postfix) with ESMTPS id 93B5816024D; Tue, 6 Apr 2021 18:45:02 -0700 (PDT) Received: by zeus.lespinasse.org (Postfix, from userid 1000) id 8550819F31E; Tue, 6 Apr 2021 18:45:02 -0700 (PDT) From: Michel Lespinasse To: Linux-MM Cc: Laurent Dufour , Peter Zijlstra , Michal Hocko , Matthew Wilcox , Rik van Riel , Paul McKenney , Andrew Morton , Suren Baghdasaryan , Joel Fernandes , Rom Lemarchand , Linux-Kernel , Michel Lespinasse Subject: [RFC PATCH 07/37] mm: add FAULT_FLAG_SPECULATIVE flag Date: Tue, 6 Apr 2021 18:44:32 -0700 Message-Id: <20210407014502.24091-8-michel@lespinasse.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210407014502.24091-1-michel@lespinasse.org> References: <20210407014502.24091-1-michel@lespinasse.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Define the new FAULT_FLAG_SPECULATIVE flag, which indicates when we are attempting speculative fault handling (without holding the mmap lock). Signed-off-by: Michel Lespinasse --- include/linux/mm.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 8ba434287387..021fdab5b721 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -434,6 +434,7 @@ extern pgprot_t protection_map[16]; * @FAULT_FLAG_REMOTE: The fault is not for current task/mm. * @FAULT_FLAG_INSTRUCTION: The fault was during an instruction fetch. * @FAULT_FLAG_INTERRUPTIBLE: The fault can be interrupted by non-fatal signals. + * @FAULT_FLAG_SPECULATIVE: The fault is handled without holding the mmap_sem. * * About @FAULT_FLAG_ALLOW_RETRY and @FAULT_FLAG_TRIED: we can specify * whether we would allow page faults to retry by specifying these two @@ -464,6 +465,7 @@ extern pgprot_t protection_map[16]; #define FAULT_FLAG_REMOTE 0x80 #define FAULT_FLAG_INSTRUCTION 0x100 #define FAULT_FLAG_INTERRUPTIBLE 0x200 +#define FAULT_FLAG_SPECULATIVE 0x400 /* * The default fault flags that should be used by most of the @@ -501,7 +503,8 @@ static inline bool fault_flag_allow_retry_first(unsigned int flags) { FAULT_FLAG_USER, "USER" }, \ { FAULT_FLAG_REMOTE, "REMOTE" }, \ { FAULT_FLAG_INSTRUCTION, "INSTRUCTION" }, \ - { FAULT_FLAG_INTERRUPTIBLE, "INTERRUPTIBLE" } + { FAULT_FLAG_INTERRUPTIBLE, "INTERRUPTIBLE" }, \ + { FAULT_FLAG_SPECULATIVE, "SPECULATIVE" } /* * vm_fault is filled by the pagefault handler and passed to the vma's -- 2.20.1