Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3496570imm; Thu, 17 May 2018 09:38:29 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo/mXSRBF/7/0z5L93ZDRGiGCLkiLC0qKraqPx3lGBj+LCeuSm1pRmHP9h5S3Doq4LxqgG4 X-Received: by 2002:a65:45c1:: with SMTP id m1-v6mr4622461pgr.229.1526575109408; Thu, 17 May 2018 09:38:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526575109; cv=none; d=google.com; s=arc-20160816; b=v985uTWvXw9RVIVWA0DCAu6TEA+UjMK7DjWH0aR7T+vwGuMOITGv67AG5LPLnnnBws L+w2w/zDp927/GUBw8lbEDbWwx1s4ngtUHcVNV55sR/13etMJbSevVPsam3gWG98bgQI nzSK+AcE9rmNMcBMpxCQQChrCOQE7R2jErpf43Gctoallz0NPCxxVBOkn7CDiydKH8Z0 wHsbw26uPrmfEZ/+3i3T3wJgPXsTiLcukgzRMB+tu26c4PpEdEYgI4Wmc0EiOluLPZVU 5MbZW23Ch5VW6ij7qArE77bJ6GVolYiyGjpSDDQOcmlOA+KBPa1AWBNd2/PNFdBF8RMb oYNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=H79NKqJkH96oXsdJluXoweEb3XavGAn3zHB3EMfyAyU=; b=gl+z4qlpB9oZfJFTDAml1EY5t873CCAmqty3NC32tHDXQulFsV70Bo7sRd9R2anu+c toD2zJdn3RYrOnEH5Re0Fdo0jXed0JPztPoyOoWRZY+opahtWaYUUZ4+VNXmiMhx0VDa BrQsuR8MyPE2MjV7NJ9omOc7l8JsWafEmZi+U64DNY4Ek6sGHQRpdVxbiCIpSAg0ISfo Ol+9CFjSblqpa9s7nd/QXO75IEXSVzP79oMzn/ad/+/ahu8fv3HOxgiVlaRXwAVq5CnH vHwLab2xrtYT7N8MN0aCteLLDQRmF9Ocv56c6khPjeiGdDyKmYQFceflfcUnuoSvywsM yXzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=O+8j6L6l; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g130-v6si5334082pfc.366.2018.05.17.09.38.10; Thu, 17 May 2018 09:38:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=O+8j6L6l; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752552AbeEQQgU (ORCPT + 99 others); Thu, 17 May 2018 12:36:20 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:36128 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752470AbeEQQgR (ORCPT ); Thu, 17 May 2018 12:36:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=H79NKqJkH96oXsdJluXoweEb3XavGAn3zHB3EMfyAyU=; b=O+8j6L6lLu9m0m3W6dvEBf9pA h+RNPcs3RrepHIg1Ad7PJluKt0rdMWfGB1vtdRxkH71nLT56HD3DsIiINAepdsrp3gyHx+aWhtlL9 /EaXlIRe9lo5WzWS4sKqug06mAQn/siqs/GzziSbDvkZseS9xHM2REggY/O2HULIkKXbzkFjY09T9 BEFXfdAMDxu6ZhQ1lbbfya4YXW8hrNZb/YASt++aRgXX9ZitWwp0spmfKQcmiJ8fLKe4PWtvHCgqb caDtv8sBxm+GsuIF8rFYE/payu/ws419Kz5VU8X0kVo59KxlY41IXnhv2JHwgJyzPsebgBfF01Hzl /3G9DmW/g==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJLsq-0005Ho-Kx; Thu, 17 May 2018 16:36:04 +0000 Subject: Re: [PATCH v11 01/26] mm: introduce CONFIG_SPECULATIVE_PAGE_FAULT To: Laurent Dufour , akpm@linux-foundation.org, mhocko@kernel.org, peterz@infradead.org, kirill@shutemov.name, ak@linux.intel.com, dave@stgolabs.net, jack@suse.cz, Matthew Wilcox , khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, benh@kernel.crashing.org, mpe@ellerman.id.au, paulus@samba.org, Thomas Gleixner , Ingo Molnar , hpa@zytor.com, Will Deacon , Sergey Senozhatsky , sergey.senozhatsky.work@gmail.com, Andrea Arcangeli , Alexei Starovoitov , kemi.wang@intel.com, Daniel Jordan , David Rientjes , Jerome Glisse , Ganesh Mahendran , Minchan Kim , Punit Agrawal , vinayak menon , Yang Shi Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, haren@linux.vnet.ibm.com, npiggin@gmail.com, bsingharora@gmail.com, paulmck@linux.vnet.ibm.com, Tim Chen , linuxppc-dev@lists.ozlabs.org, x86@kernel.org References: <1526555193-7242-1-git-send-email-ldufour@linux.vnet.ibm.com> <1526555193-7242-2-git-send-email-ldufour@linux.vnet.ibm.com> From: Randy Dunlap Message-ID: <2cb8256d-5822-d94d-b0e6-c46f21d84852@infradead.org> Date: Thu, 17 May 2018 09:36:00 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1526555193-7242-2-git-send-email-ldufour@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 05/17/2018 04:06 AM, Laurent Dufour wrote: > This configuration variable will be used to build the code needed to > handle speculative page fault. > > By default it is turned off, and activated depending on architecture > support, ARCH_HAS_PTE_SPECIAL, SMP and MMU. > > 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 handle the speculative handler. > > The dependency on ARCH_HAS_PTE_SPECIAL is required because vm_normal_page() > does processing that is not compatible with the speculative handling in the > case ARCH_HAS_PTE_SPECIAL is not set. > > Suggested-by: Thomas Gleixner > Suggested-by: David Rientjes > Signed-off-by: Laurent Dufour > --- > mm/Kconfig | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/mm/Kconfig b/mm/Kconfig > index 1d0888c5b97a..a38796276113 100644 > --- a/mm/Kconfig > +++ b/mm/Kconfig > @@ -761,3 +761,25 @@ config GUP_BENCHMARK > > config ARCH_HAS_PTE_SPECIAL > 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 > + depends on ARCH_HAS_PTE_SPECIAL && MMU && SMP > + help > + Try to handle user space page faults without holding the mmap_sem. > + > + This should allow better concurrency for massively threaded process processes > + since the page fault handler will not wait for other threads memory thread's > + layout change to be done, assuming that this change is done in another > + part of the process's memory space. This type of page fault is named > + speculative page fault. > + > + If the speculative page fault fails because of a concurrency is because a concurrency is > + detected or because underlying PMD or PTE tables are not yet > + allocating, it is failing its processing and a classic page fault allocated, the speculative page fault fails and a classic page fault > + is then tried. Also, all of the help text (below the "help" line) should be indented by 1 tab + 2 spaces (in coding-style.rst). -- ~Randy