Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp735073pxf; Wed, 7 Apr 2021 10:13:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcbHAYq1gnoKwsXJmCLyvqJP4xXgPEJJj8NFVTBgKkHi8yVj9k6DwW0vGvoGKNPWTu5dQz X-Received: by 2002:a02:4b03:: with SMTP id q3mr2196453jaa.22.1617815607046; Wed, 07 Apr 2021 10:13:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617815607; cv=none; d=google.com; s=arc-20160816; b=j1X2PbxA/D/wlojHvR0C46LBda+fypKPoXhj5lJGfEasev/5bTRk7ZdVLq9Z6Vb4u7 iG4Fz4M4gKjeZrAIrM/GxTY4OWFXbHToaCnn+0bwo50TVj8++BSC3ygAG/mj8HeLzZlT vfznPH67NIhY40Di5vcnwaaOMgCoARA728eXCrWR+wa64V5Bf+w+tn2zxU4PVMwp7HLo /Tx9wbw6xzFzsvWTlvxtFVNaURoeYpz5+swFIdBWdvdKkjCcrtSFRooBoaWptigJsQUw AIifBkZoOGmog+R6ip+AyRfeu5IjVDzKtMg7Jla6/2RgF6fmkIjY9hNk1XIGRFl2oeQM tqUA== 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=45X0hICb7YyLurpFubxOZ+gBL34g/MPyB7oW/aDWSiM=; b=pt0R4AL+hZUvlYtpF+O8hl2Mo6AJsk1FsdW/7oe8U7GBc6W3b4Khz2L3lbiM80Pq/c l9ONBjjIb6KSjzG4K2ICEf3Cj2XDiufmaa0D5Wuc2dupnRY1PGdzoi1IZWcu2OXkeB2M LbUDzzbJtgvVMpBNG24HXlG1E77SEmVDsiGnGFcmyMjM/iWAp3l6xjKQuraxaOD4NI28 QPYAbUi5KdlsRsDXrjH5RL0Ib5+DkXAgxlPb+4xEqtWuHgxtNQiw21oHt9lR/ux2FVtk yA7y/+syUNST2wYRTtjRAEcyXDo+ktGpdU6qZ/12vlWMiROdI875CGE+d5AWP0boOPqz m8SA== 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=OIBfjJ1b; 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 n6si21198121jaj.81.2021.04.07.10.13.14; Wed, 07 Apr 2021 10:13:27 -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=OIBfjJ1b; 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 S1347905AbhDGBwG (ORCPT + 99 others); Tue, 6 Apr 2021 21:52:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347820AbhDGBvu (ORCPT ); Tue, 6 Apr 2021 21:51:50 -0400 Received: from server.lespinasse.org (unknown [IPv6:2602:303:fcdc:ce10::100:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FD68C061761 for ; Tue, 6 Apr 2021 18:51:40 -0700 (PDT) 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=45X0hICb7YyLurpFubxOZ+gBL34g/MPyB7oW/aDWSiM=; b=Ezxxe9KDQsCFhUHAu9I8tXq3tzT+ETWkukiiTwYTUJy0+mEiULNUYHD1E3OGsCJ2WVgK+ 6sVgt4/DR/scN5rDA== 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=45X0hICb7YyLurpFubxOZ+gBL34g/MPyB7oW/aDWSiM=; b=OIBfjJ1bYm37SwxCxTZxWBm6/JHot+77xHwF5V/8sYbQYkkLwxhE3KbqcmCsOgfilCuOe kPpyZrn7Wf5hzU3ilIC1gXGABhNrY4ctFg9vLpbXQhB1MQ3fIfDvSVlFjbQDpnshhEhCE2W jSgP0RqvYexT8jbDex/isE6RL/ElD3hYo1qqrkUe4YxlrI17K1OC3DDgjSOe4QxyDePMiNS ByZf0vq9GK578fKtRJ3Q9uSgRs1RMCV7tyWz+2ukebX+vT6OkKeM3iUxIQtur5QmxepoA+U J97XdXAFSjABk9diVgwmNmv0b2H4KQq+SRvewPy4ziSva9rDbfiYKXbB6KLw== Received: from zeus.lespinasse.org (zeus.lespinasse.org [IPv6:fd00::150:0]) by server.lespinasse.org (Postfix) with ESMTPS id 850A616023A; Tue, 6 Apr 2021 18:45:02 -0700 (PDT) Received: by zeus.lespinasse.org (Postfix, from userid 1000) id 773DB19F31D; 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 05/37] mm: introduce CONFIG_SPECULATIVE_PAGE_FAULT Date: Tue, 6 Apr 2021 18:44:30 -0700 Message-Id: <20210407014502.24091-6-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 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 24c045b24b95..322bda319dea 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -872,4 +872,26 @@ config MAPPING_DIRTY_HELPERS config KMAP_LOCAL bool +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