Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2727486pxb; Mon, 31 Jan 2022 03:02:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQn4uORcrCiAVdnuoF4ntklDMsQZd8AjB5Yo+bfioFb8s1/alfN6KUsRD1G1HXBTMxXL3z X-Received: by 2002:aa7:d7d1:: with SMTP id e17mr19946190eds.315.1643626977465; Mon, 31 Jan 2022 03:02:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643626977; cv=none; d=google.com; s=arc-20160816; b=q0079oTMYI16u/MDUioxiknz7HIucmmDsa7XnSnc8alv66PAZqOt7BD16WraybqyaF YdqCOHQqtSX12AdU3fdlnazj3RwKwVvgoo2EhgrqbT8Qzk6RduGPYKHnNnELcnbBTvHZ CMiiaLxeUOWMVYaElEZu9+43mipeuaMrFp9MMNyFL4zfCFujw6YBnUhDmQOdNH7lXH/P 6L13Sh3uWLihEpkj/Xjl1vHqEHNRl2sjmozgc18kVCAMvpEk/ZU8tfL9HhZguLCOAElE xMIs64VtyJf8ABJJw36TklVYWUt4T4HW+ePdVQ2fF2tna4qLuW7Xbc2kTM7FtoqXPaDv RZqQ== 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=PMJHeJsdyCtcxmhvT1hkJdcSx4UXS3jkGHIYYcslNmc=; b=U2ADWj3rHxN0vqZuLP4jUgFARm1mzXbWFDqXPfAqdIUheFseg1qTeh1BANNXrlxFVs 2F8ZU4hbRFIEDDWfnVbwU/Depjmtoe6btnev5lij5aOegi/Alte+VtwGoU/UaH8bLjUa FP6YsAcr8Gia0fVFxkGOsde8tGYgy2EkmlbDARQaXPrLDQRbTMUtZk5oY1J8bQAlmeYP gjDhA8j8z4nXP0GOK0QclhIhON2pivSAtz4Hj87V0Fbf6a3xlucInynPLBAejGiGMLw2 aY3dtVwdXjhe/p95dAoyr9spY/u1x2lDLrE2CLGLlLstvUzVENIHvn03+ocMzU67zDGm 795g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (no key) header.i=@lespinasse.org header.b=DE7JPUDN; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-52-rsa header.b=M5ntAzna; 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 m7si7613029edq.460.2022.01.31.03.02.25; Mon, 31 Jan 2022 03:02:57 -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=neutral (no key) header.i=@lespinasse.org header.b=DE7JPUDN; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-52-rsa header.b=M5ntAzna; 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 S1348897AbiA1NTa (ORCPT + 99 others); Fri, 28 Jan 2022 08:19:30 -0500 Received: from server.lespinasse.org ([63.205.204.226]:37829 "EHLO server.lespinasse.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348517AbiA1NTJ (ORCPT ); Fri, 28 Jan 2022 08:19:09 -0500 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 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 | 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 */ -- 2.20.1