Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751595AbeAPNYx (ORCPT + 1 other); Tue, 16 Jan 2018 08:24:53 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:60934 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751126AbeAPNYw (ORCPT ); Tue, 16 Jan 2018 08:24:52 -0500 Subject: Re: [PATCH v6 18/24] mm: Try spin lock in speculative path To: Matthew Wilcox 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, 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, 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: <1515777968-867-1-git-send-email-ldufour@linux.vnet.ibm.com> <1515777968-867-19-git-send-email-ldufour@linux.vnet.ibm.com> <20180112181840.GA7590@bombadil.infradead.org> From: Laurent Dufour Date: Tue, 16 Jan 2018 14:24:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180112181840.GA7590@bombadil.infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 18011613-0040-0000-0000-000004255DE9 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18011613-0041-0000-0000-000020C8CA34 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-16_05:,, 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-1801160187 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 12/01/2018 19:18, Matthew Wilcox wrote: > On Fri, Jan 12, 2018 at 06:26:02PM +0100, Laurent Dufour wrote: >> There is a deadlock when a CPU is doing a speculative page fault and >> another one is calling do_unmap(). >> >> The deadlock occurred because the speculative path try to spinlock the >> pte while the interrupt are disabled. When the other CPU in the >> unmap's path has locked the pte then is waiting for all the CPU to >> invalidate the TLB. As the CPU doing the speculative fault have the >> interrupt disable it can't invalidate the TLB, and can't get the lock. >> >> Since we are in a speculative path, we can race with other mm action. >> So let assume that the lock may not get acquired and fail the >> speculative page fault. > > It seems like you introduced this bug in the previous patch, and now > you're fixing it in this patch? Why not merge the two? You're right this is a fix from the previous patch. Initially my idea was to keep the original Peter's patch as is, but sounds that this is not a good idea. I'll merge it in the previous one. Thanks, Laurent.