Received: by 10.213.65.68 with SMTP id h4csp316310imn; Wed, 28 Mar 2018 04:16:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx48RuJyz+nxS2HGSmEHHUWbdYqpb+X7kU2D3KujkXOA+kscsWwc9dfsTezNIzhmOlXNlYobZ X-Received: by 2002:a17:902:aa83:: with SMTP id d3-v6mr3354300plr.36.1522235811304; Wed, 28 Mar 2018 04:16:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522235811; cv=none; d=google.com; s=arc-20160816; b=YCZSgoohfjV+Woo1ukEnnNJAxr75cFwu5JWCmh4HrQQh51M+AS69RFKBJo9RyvSAbu JfHYrMbZMJjmTPGZuxPZU3KFzGVOKP00XvUzKLhU00VFPDfroCM0ZQyBRNON2iHoamAx ulpZmP+lVlSmogXIUG2frRBMbfheXuJidcIG28Otu6mTvTJpA9WXVx11hvD1ZtzPZo9J pU0SGG0IZB3O83bX9ohRbmiCv+sWRBi69zTXJn/y5wsYlaeUJgfKdJKBlG4nm2iz61aZ QD0Ut23ldod0/I/cf4zqAO+zOirc/npokJSr1uZq9uhhYdjoYKA+WgNrBDDHqx+Aizf7 t6sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date:from :references:cc:to:subject:arc-authentication-results; bh=/oEEcZAfd3LXQfh3xtggtxxZK3FFgeWtN2ymhQtflqI=; b=lTPphs8zb6nQqHZOdJD9Y/TQaKe307HElPnlQjpEHav1bKvhKN+xZy4G17/PaBEKF/ c/bwIX/LHKkOlqdaKVRbt1NqEvUnT9W3fljoUyw1vJvrwXn0+azv9VgJ5bN7jVbtRiMk 0XUXOkyAcGX8eC9ydhwTKwtd21ysJa2+OEaoLpcA6SsGTwdVSKYbQn5aeCKlDSwypS/O G3Z/Op7dN5Fsh+2ndVKoACSpP8Tre9GCIBPNT+0HY0necaDHmtVETIhYFccjdDKFqAPl qyY1MVmgg62oYdE1wSbrnw0M8RcuRMGnL90YFyAgtuPEU4MvzZ4sWEJhj5cl7Jlub2ee d/BQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2-v6si3256997pln.115.2018.03.28.04.16.36; Wed, 28 Mar 2018 04:16:51 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752663AbeC1LPm (ORCPT + 99 others); Wed, 28 Mar 2018 07:15:42 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:51572 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750774AbeC1LPk (ORCPT ); Wed, 28 Mar 2018 07:15:40 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2SBF4YJ066163 for ; Wed, 28 Mar 2018 07:15:40 -0400 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0b-001b2d01.pphosted.com with ESMTP id 2h090djpp6-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Wed, 28 Mar 2018 07:15:39 -0400 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 28 Mar 2018 12:15:37 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 28 Mar 2018 12:15:28 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2SBFSh812190034; Wed, 28 Mar 2018 11:15:28 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3C73652041; Wed, 28 Mar 2018 11:06:44 +0100 (BST) Received: from [9.145.178.80] (unknown [9.145.178.80]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 3BBCA52049; Wed, 28 Mar 2018 11:06:42 +0100 (BST) Subject: Re: [PATCH v9 01/24] mm: Introduce CONFIG_SPECULATIVE_PAGE_FAULT To: David Rientjes Cc: Thomas Gleixner , paulmck@linux.vnet.ibm.com, peterz@infradead.org, akpm@linux-foundation.org, kirill@shutemov.name, ak@linux.intel.com, mhocko@kernel.org, dave@stgolabs.net, jack@suse.cz, Matthew Wilcox , benh@kernel.crashing.org, mpe@ellerman.id.au, paulus@samba.org, Ingo Molnar , hpa@zytor.com, Will Deacon , Sergey Senozhatsky , Andrea Arcangeli , Alexei Starovoitov , kemi.wang@intel.com, sergey.senozhatsky.work@gmail.com, Daniel Jordan , linux-kernel@vger.kernel.org, linux-mm@kvack.org, haren@linux.vnet.ibm.com, khandual@linux.vnet.ibm.com, npiggin@gmail.com, bsingharora@gmail.com, Tim Chen , linuxppc-dev@lists.ozlabs.org, x86@kernel.org References: <1520963994-28477-1-git-send-email-ldufour@linux.vnet.ibm.com> <1520963994-28477-2-git-send-email-ldufour@linux.vnet.ibm.com> <32c80b6a-28c6-bf63-ed7b-6a042ae18e8f@linux.vnet.ibm.com> From: Laurent Dufour Date: Wed, 28 Mar 2018 13:15:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 18032811-0012-0000-0000-000005C422CD X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18032811-0013-0000-0000-00001940617D Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-28_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803280123 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/03/2018 12:16, David Rientjes wrote: > On Wed, 28 Mar 2018, 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. >>>> >>>> Suggested-by: Thomas Gleixner >>>> Signed-off-by: Laurent Dufour >>>> --- >>>> mm/Kconfig | 3 +++ >>>> 1 file changed, 3 insertions(+) >>>> >>>> diff --git a/mm/Kconfig b/mm/Kconfig >>>> index abefa573bcd8..07c566c88faf 100644 >>>> --- a/mm/Kconfig >>>> +++ b/mm/Kconfig >>>> @@ -759,3 +759,6 @@ config GUP_BENCHMARK >>>> performance of get_user_pages_fast(). >>>> >>>> See tools/testing/selftests/vm/gup_benchmark.c >>>> + >>>> +config SPECULATIVE_PAGE_FAULT >>>> + bool >>> >>> Should this be configurable even if the arch supports it? >> >> Actually, this is not configurable unless by manually editing the .config file. >> >> I made it this way on the Thomas's request : >> https://lkml.org/lkml/2018/1/15/969 >> >> That sounds to be the smarter way to achieve that, isn't it ? >> > > Putting this in mm/Kconfig is definitely the right way to go about it > instead of any generic option in arch/*. > > My question, though, was making this configurable by the user: > > config SPECULATIVE_PAGE_FAULT > bool "Speculative page faults" > depends on X86_64 || PPC > default y > help > .. > > It's a question about whether we want this always enabled on x86_64 and > power or whether the user should be able to disable it (right now they > can't). With a large feature like this, you may want to offer something > simple (disable CONFIG_SPECULATIVE_PAGE_FAULT) if someone runs into > regressions. I agree, but I think it would be important to get the per architecture enablement to avoid complex check here. For instance in the case of powerPC this is only supported for PPC_BOOK3S_64. To avoid exposing such per architecture define here, what do you think about having supporting architectures setting ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT and the SPECULATIVE_PAGE_FAULT depends on this, like this: In mm/Kconfig: config SPECULATIVE_PAGE_FAULT bool "Speculative page faults" depends on ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT && SMP default y help ... In arch/powerpc/Kconfig: config PPC ... select ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT if PPC_BOOK3S_64 In arch/x86/Kconfig: config X86_64 ... select ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT