Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2728700pxb; Mon, 31 Jan 2022 03:04:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwt4XuY7/5BFGQm3519uI3KNyYMP1yC1JBdSPa0JMDEhSmHlK87SisU5WdThH57AgeQYcy X-Received: by 2002:a17:90b:390a:: with SMTP id ob10mr24036565pjb.110.1643627057499; Mon, 31 Jan 2022 03:04:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643627057; cv=none; d=google.com; s=arc-20160816; b=QYFV8MSPJX2Gp0Utkad4Z0lr4TJkDQyC/r+Ya3B91GCgA9MUWcr/Zlz8grwANdEsGm rr4VZpVppHFVAJkH6OMQjiymTwkcRDR+EK9DD/cYsoyRjzIpIe0crhOnzZGsDfWGepWe g2C+TM8N9eNQS4dGfR7qtinMIZfoTw/ZaZF1sfAl6QBPBG8UrO35yaaelWrrqDNxhAWS Vta3S2ZhzpC3Ij1CfOfenKsBwknJCcShBzjAGixJFJFbLUn6Ln3J2D0FNx4aFbbOAUoU dD2OIimKPb0wXPlyuscARf8i+yOyAFphJdWVHztbP3kI5HbC8kYO98odHWC19+RqtxDE /hJA== 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=DmGgYXIxuiNl6v6cMRPQigMIgjtXtbGpaAKFRJYhv/I=; b=leicd2aHxl8MnfjZ1nGJ/ajL28Vxg3i5T6NCKLxgUhOpRqpn2Bwtz/uk4Qhf1CqwsB E5QT7VuzgNqlO9UOlABk/HbiC+fodzqO90w9k7C29CVYlwawbxJy1d/CHqzE8TokAysG iDLezP8eifHUkYUhY2bSOu+XMyNvEQ3uJcAh85ROkTRk6KX1z5+FzLrZHRv3ocLFC5W5 HSXi0ERqr8BPaKore0Qptl2KYbYLwYsaFpeTqSvnsO2XQrqjdyQeoyjFyjuM7iDEchBR znq0eEDjseseA56HkLZTryjhOW2sbETY8Yi0Ve7x+YMT1bjJ1ZrxTW/PLvq7Nk3i9Xqj ER1g== 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-52-rsa header.b=L6qKz8mp; 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 m12si11613043pfh.279.2022.01.31.03.04.06; Mon, 31 Jan 2022 03:04:17 -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; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-52-rsa header.b=L6qKz8mp; 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 S1348842AbiA1NTc (ORCPT + 99 others); Fri, 28 Jan 2022 08:19:32 -0500 Received: from server.lespinasse.org ([63.205.204.226]:48735 "EHLO server.lespinasse.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348597AbiA1NTJ (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=DmGgYXIxuiNl6v6cMRPQigMIgjtXtbGpaAKFRJYhv/I=; b=GDRiMZ9S0azV2Kn+iE+ZKlmXOxOZS3W4CUWO2Lkt9Jj7y0ZoRy+qf3ZSGPIvMindJ9Gyz LoMV0lL00tULmr4DQ== 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=DmGgYXIxuiNl6v6cMRPQigMIgjtXtbGpaAKFRJYhv/I=; b=L6qKz8mphs/6Uaryogzhb4PKZ5qz9HjmJQd+AZeOj1NOq9q5tybwmX0BNHaFxsV5/DXz6 0MGNbCfUxasUG+9tMD+dPkuI8Jk+6YyvkqYg+bnKJ5g7ynn0d4IQz6bRWASZuLEvx5kNene fF6zuzmUfbqPSDrnVqLWp8KF6vK0r9yHlgH2Po92eGQPFK/ewtkz/3kXsu5goMvFClEV7Qy mDtoB3MYnR+xH7P1zYg8BQWDJ1flAwNafjNvoUx+q7k6oBniGmVuEcm2f98ca9PERRtme62 HgZYhvNQ9vue4+4h5skh1rMhkUq7ET6b0rZzg/Uur0ZxGrp9Rlz+1KSmgjdQ== Received: from zeus.lespinasse.org (zeus.lespinasse.org [IPv6:fd00::150:0]) by server.lespinasse.org (Postfix) with ESMTPS id E651116095D; Fri, 28 Jan 2022 05:10:06 -0800 (PST) Received: by zeus.lespinasse.org (Postfix, from userid 1000) id D12602044E; 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 06/35] mm: introduce CONFIG_SPECULATIVE_PAGE_FAULT Date: Fri, 28 Jan 2022 05:09:37 -0800 Message-Id: <20220128131006.67712-7-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 This configuration variable will be used to build the code needed to handle speculative page fault. This is enabled by default on supported architectures with SMP and MMU set. The architecture support is needed since the speculative page fault handler is called from the architecture's page faulting code, and some code has to be added there to try speculative fault handling first. Signed-off-by: Michel Lespinasse --- mm/Kconfig | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/mm/Kconfig b/mm/Kconfig index 3326ee3903f3..d304fca0f293 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -894,4 +894,26 @@ config ANON_VMA_NAME source "mm/damon/Kconfig" +config ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT + def_bool n + +config SPECULATIVE_PAGE_FAULT + bool "Speculative page faults" + default y + depends on ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT && MMU && SMP + help + Try to handle user space page faults without holding the mmap lock. + + Instead of blocking writers through the use of mmap lock, + the page fault handler merely verifies, at the end of the page + fault, that no writers have been running concurrently with it. + + In high concurrency situations, the speculative fault handler + gains a throughput advantage by avoiding having to update the + mmap lock reader count. + + If the check fails due to a concurrent writer, or due to hitting + an unsupported case, the fault handler falls back to classical + processing using the mmap read lock. + endmenu -- 2.20.1