Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752105AbdHHML7 (ORCPT ); Tue, 8 Aug 2017 08:11:59 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:52538 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752264AbdHHMLy (ORCPT ); Tue, 8 Aug 2017 08:11:54 -0400 Subject: Re: [RFC v5 01/11] mm: Dont assume page-table invariance during faults To: Anshuman Khandual , 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 Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, haren@linux.vnet.ibm.com, npiggin@gmail.com, bsingharora@gmail.com, Tim Chen References: <1497635555-25679-1-git-send-email-ldufour@linux.vnet.ibm.com> <1497635555-25679-2-git-send-email-ldufour@linux.vnet.ibm.com> <57cbb4ca-7f04-ac50-3321-2c34ac08307b@linux.vnet.ibm.com> From: Laurent Dufour Date: Tue, 8 Aug 2017 14:11:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <57cbb4ca-7f04-ac50-3321-2c34ac08307b@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17080812-0008-0000-0000-0000048B4201 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17080812-0009-0000-0000-00001E1A61A1 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-08-08_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1708080194 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 760 Lines: 18 On 08/08/2017 11:45, Anshuman Khandual wrote: > On 06/16/2017 11:22 PM, Laurent Dufour wrote: >> From: Peter Zijlstra >> >> One of the side effects of speculating on faults (without holding >> mmap_sem) is that we can race with free_pgtables() and therefore we >> cannot assume the page-tables will stick around. >> >> Remove the relyance on the pte pointer. > > Looking into other parts of the series, it seemed like now we have > sequence lock both at MM and VMA level but then after that we still > need to take page table lock before handling page faults (in turn > manipulating PTE which includes swap in paths as well). Is not that > true ? Page table locking is still required as several VMAs can reference the same page table.