Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965161AbeALSTH (ORCPT + 1 other); Fri, 12 Jan 2018 13:19:07 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:39406 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964867AbeALSTG (ORCPT ); Fri, 12 Jan 2018 13:19:06 -0500 Date: Fri, 12 Jan 2018 10:18:40 -0800 From: Matthew Wilcox To: Laurent Dufour 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 Subject: Re: [PATCH v6 18/24] mm: Try spin lock in speculative path Message-ID: <20180112181840.GA7590@bombadil.infradead.org> References: <1515777968-867-1-git-send-email-ldufour@linux.vnet.ibm.com> <1515777968-867-19-git-send-email-ldufour@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1515777968-867-19-git-send-email-ldufour@linux.vnet.ibm.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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?