From patchwork Fri Jan 28 13:09:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michel Lespinasse X-Patchwork-Id: 12728510 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19E4FC433F5 for ; Fri, 28 Jan 2022 13:10:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 382D06B0085; Fri, 28 Jan 2022 08:10:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EFA076B0082; Fri, 28 Jan 2022 08:10:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CD1AE6B0081; Fri, 28 Jan 2022 08:10:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0004.hostedemail.com [216.40.44.4]) by kanga.kvack.org (Postfix) with ESMTP id 72A446B007E for ; Fri, 28 Jan 2022 08:10:11 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 3A8588909D for ; Fri, 28 Jan 2022 13:10:11 +0000 (UTC) X-FDA: 79079729022.26.3EB12F8 Received: from server.lespinasse.org (server.lespinasse.org [63.205.204.226]) by imf04.hostedemail.com (Postfix) with ESMTP id ADFEA40015 for ; Fri, 28 Jan 2022 13:10:10 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-52-ed; t=1643375407; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=PMJHeJsdyCtcxmhvT1hkJdcSx4UXS3jkGHIYYcslNmc=; b=DE7JPUDN+5KEWQTiOjalJIcy92ZNfeEc8SEWgHr0RVYH5eatrZM7nrSmUqyMCL/n2mmYI SK140SxEgrzfZLtAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-52-rsa; t=1643375406; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=PMJHeJsdyCtcxmhvT1hkJdcSx4UXS3jkGHIYYcslNmc=; b=M5ntAzna6rTFurGazsaqcxoyi+L0bXjLH2rIvjqudwJrJwL9WMXjOY0I7laiC7fX5MTFl 4/JUz0rzpcvK2f1Qk9XffCcqKNRdjGE1yIZK80CA/13QQHFQst3yIdWO5xixiFhEuHaqC9C fNRUPAANLj5n6Jge03J2/6fCAr99RzpHiq/AgiQIpwTkLg3RXi8xes0CczjsIfwuGA0GC6f 8bQBaTbAZEhkvAUANfnaSMig99mgjzQCRYKJB9KxgAWRDKHbH7J7OtIugqfa2NaoNaCONmC HJwVnzfD9CFvkxrtcthuve1OoGhywt0zPAzhIIUs5sF4WNhbkHFuaxFr7gPw== Received: from zeus.lespinasse.org (zeus.lespinasse.org [10.0.0.150]) by server.lespinasse.org (Postfix) with ESMTPS id EC614160964; Fri, 28 Jan 2022 05:10:06 -0800 (PST) Received: by zeus.lespinasse.org (Postfix, from userid 1000) id D6C6320472; Fri, 28 Jan 2022 05:10:06 -0800 (PST) From: Michel Lespinasse To: Linux-MM , linux-kernel@vger.kernel.org, Andrew Morton Cc: kernel-team@fb.com, Laurent Dufour , Jerome Glisse , Peter Zijlstra , Michal Hocko , Vlastimil Babka , Davidlohr Bueso , Matthew Wilcox , Liam Howlett , Rik van Riel , Paul McKenney , Song Liu , Suren Baghdasaryan , Minchan Kim , Joel Fernandes , David Rientjes , Axel Rasmussen , Andy Lutomirski , Michel Lespinasse Subject: [PATCH v2 08/35] mm: add FAULT_FLAG_SPECULATIVE flag Date: Fri, 28 Jan 2022 05:09:39 -0800 Message-Id: <20220128131006.67712-9-michel@lespinasse.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220128131006.67712-1-michel@lespinasse.org> References: <20220128131006.67712-1-michel@lespinasse.org> MIME-Version: 1.0 X-Rspam-User: nil X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: ADFEA40015 X-Stat-Signature: cn34skojkyxpyh9uf4jzht7oex347yxe Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=lespinasse.org header.s=srv-52-ed header.b=DE7JPUDN; dkim=pass header.d=lespinasse.org header.s=srv-52-rsa header.b=M5ntAzna; spf=pass (imf04.hostedemail.com: domain of walken@lespinasse.org designates 63.205.204.226 as permitted sender) smtp.mailfrom=walken@lespinasse.org; dmarc=pass (policy=none) header.from=lespinasse.org X-HE-Tag: 1643375410-205220 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: 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 | 3 ++- include/linux/mm_types.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index e1a84b1e6787..7f7aa3f0a396 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -461,7 +461,8 @@ static inline bool fault_flag_allow_retry_first(enum fault_flag 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 diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 9db36dc5d4cf..0ae3bf854aad 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -790,6 +790,7 @@ typedef struct { * @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 lock. * * About @FAULT_FLAG_ALLOW_RETRY and @FAULT_FLAG_TRIED: we can specify * whether we would allow page faults to retry by specifying these two @@ -821,6 +822,7 @@ enum fault_flag { FAULT_FLAG_REMOTE = 1 << 7, FAULT_FLAG_INSTRUCTION = 1 << 8, FAULT_FLAG_INTERRUPTIBLE = 1 << 9, + FAULT_FLAG_SPECULATIVE = 1 << 10, }; #endif /* _LINUX_MM_TYPES_H */