Received: by 10.213.65.68 with SMTP id h4csp923725imn; Wed, 4 Apr 2018 09:29:04 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+PxoLQoFIvVdiJlMN06vELP6KnXcRuKHdBihCsKZyJd1xJqBCZy6XFrdLr4KH7EQDCLkEY X-Received: by 2002:a17:902:24a5:: with SMTP id w34-v6mr19189215pla.328.1522859344062; Wed, 04 Apr 2018 09:29:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522859344; cv=none; d=google.com; s=arc-20160816; b=yupLnwzBDmmOmCZlzZwWMlog2GurP+vhzKJfwJUtT5AyBSCRH3MKO17H4kqgrwirjs J99NN8o4yu50/GLDUKmFH9vvB3V2r28+lXN/EuWVjaW2vyjJb7OLBgT56tx6+r4OI+bW mFieOOfz5aDRUbKnrLw9e65MToQMmzgL84xQzE9B8qTFLbtn9B6qFpbuh04RtifiZNwV LBasgVIOrCpUuwEwDGCOTm/0LcObDss0orQHmCYALOlnbVU1sSKbYvvriQvFccaOc4E6 RpOcZ0a/yeTJ4MtrldLWRYD0Bt5zbkSGC+18DMNEXdanOut0rH60D5iYY0CqBmHxAp3I OHaQ== 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=NO26Hsaar0X8MG2886sc9ik6BDeMHhzHPA5igF+kn1M=; b=v+BqgEY+ssVtiw1+zBr2HnecfLeQhKpEaq0xlSVGRPWXKzCikF4yRkBHNeBRvxIEL2 npcFu+yAESuaH0Wb/o4PTZGkDUy6NPEVoQNzNtIDUZ9H280F2y2MZa1C+Ffrd6tSJw7B YZLTb5PRRrJynlVNJrhNOdFNBbuqBqfC0iRvt/VdmHWvmIkNGpXtJCMW6siVn9HQB8ja JzjJVDfUpjQkL1P/9aTGyfFqn0Rn9yPVmwOMbIDoQpNcO6RVirHtY8hPkyHIXyWWu0A0 Wyxg4V3paRq6MDGwNSyQ/UzawzwOLvJm76svJpcWEN1Q4N4y70h3lV1x2uK11xxiQeWC C8PQ== 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 v2si3916319pgo.639.2018.04.04.09.28.49; Wed, 04 Apr 2018 09:29:03 -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 S1752425AbeDDQ1D (ORCPT + 99 others); Wed, 4 Apr 2018 12:27:03 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41694 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751606AbeDDQ07 (ORCPT ); Wed, 4 Apr 2018 12:26:59 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w34GQ0nb099203 for ; Wed, 4 Apr 2018 12:26:58 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0b-001b2d01.pphosted.com with ESMTP id 2h508xpbkk-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Wed, 04 Apr 2018 12:26:57 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 4 Apr 2018 17:26:54 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 4 Apr 2018 17:26:47 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w34GQlnI55836878; Wed, 4 Apr 2018 16:26:47 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 97E8F42047; Wed, 4 Apr 2018 17:18:37 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 956A042041; Wed, 4 Apr 2018 17:18:35 +0100 (BST) Received: from [9.145.59.61] (unknown [9.145.59.61]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 4 Apr 2018 17:18:35 +0100 (BST) Subject: Re: [PATCH v9 15/24] mm: Introduce __vm_normal_page() To: Jerome Glisse Cc: 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, Thomas Gleixner , 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-16-git-send-email-ldufour@linux.vnet.ibm.com> <20180403193927.GD5935@redhat.com> From: Laurent Dufour Date: Wed, 4 Apr 2018 18:26:44 +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: <20180403193927.GD5935@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 18040416-0040-0000-0000-00000449B9A7 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18040416-0041-0000-0000-000020EDCA52 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-04-04_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-1804040165 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/04/2018 21:39, Jerome Glisse wrote: > On Tue, Mar 13, 2018 at 06:59:45PM +0100, Laurent Dufour wrote: >> When dealing with the speculative fault path we should use the VMA's field >> cached value stored in the vm_fault structure. >> >> Currently vm_normal_page() is using the pointer to the VMA to fetch the >> vm_flags value. This patch provides a new __vm_normal_page() which is >> receiving the vm_flags flags value as parameter. >> >> Note: The speculative path is turned on for architecture providing support >> for special PTE flag. So only the first block of vm_normal_page is used >> during the speculative path. > > Might be a good idea to explicitly have SPECULATIVE Kconfig option depends > on ARCH_PTE_SPECIAL and a comment for !HAVE_PTE_SPECIAL in the function > explaining that speculative page fault should never reach that point. Unfortunately there is no ARCH_PTE_SPECIAL in the config file, it is defined in the per architecture header files. So I can't do anything in the Kconfig file However, I can check that at build time, and doing such a check in __vm_normal_page sounds to be a good place, like that: @@ -869,6 +870,14 @@ struct page *__vm_normal_page(struct vm_area_struct *vma, unsigned long addr, /* !HAVE_PTE_SPECIAL case follows: */ +#ifdef CONFIG_SPECULATIVE_PAGE_FAULT + /* This part should never get called when the speculative page fault + * handler is turned on. This is mainly because we can't rely on + * vm_start. + */ +#error CONFIG_SPECULATIVE_PAGE_FAULT requires HAVE_PTE_SPECIAL +#endif + if (unlikely(vma_flags & (VM_PFNMAP|VM_MIXEDMAP))) { if (vma_flags & VM_MIXEDMAP) { if (!pfn_valid(pfn)) Thanks, Laurent.