From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754508AbcE3JLY (ORCPT ); Mon, 30 May 2016 05:11:24 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:60793 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754249AbcE3JLX (ORCPT ); Mon, 30 May 2016 05:11:23 -0400 Date: Mon, 30 May 2016 11:11:16 +0200 From: Peter Zijlstra To: Maarten Lankhorst Cc: Chris Wilson , Ingo Molnar , intel-gfx@lists.freedesktop.org, Christian =?iso-8859-1?Q?K=F6nig?= , linux-kernel@vger.kernel.org Subject: Re: [PATCH] mutex: Report recursive ww_mutex locking early Message-ID: <20160530091116.GP3192@twins.programming.kicks-ass.net> References: <1464251487-23778-1-git-send-email-chris@chris-wilson.co.uk> <1464293297-19777-1-git-send-email-chris@chris-wilson.co.uk> <4271f89a-ab98-2d97-fccb-3527931597ec@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4271f89a-ab98-2d97-fccb-3527931597ec@linux.intel.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 30, 2016 at 09:43:53AM +0200, Maarten Lankhorst wrote: > Op 26-05-16 om 22:08 schreef Chris Wilson: > > Recursive locking for ww_mutexes was originally conceived as an > > exception. However, it is heavily used by the DRM atomic modesetting > > code. Currently, the recursive deadlock is checked after we have queued > > up for a busy-spin and as we never release the lock, we spin until > > kicked, whereupon the deadlock is discovered and reported. > > > > A simple solution for the now common problem is to move the recursive > > deadlock discovery to the first action when taking the ww_mutex. > > > > Testcase: igt/kms_cursor_legacy I've no idea what this tag is or where to find the actual testcase, so I've killed it. > > Suggested-by: Maarten Lankhorst > > Signed-off-by: Chris Wilson > > Cc: Peter Zijlstra > > Cc: Ingo Molnar > > Cc: Christian König > > Cc: Maarten Lankhorst > > Cc: linux-kernel@vger.kernel.org > > --- > > > > Maarten suggested this as a simpler fix to the immediate problem. Imo, > > we still want to perform deadlock detection within the spin in order to > > catch more complicated deadlocks without osq_lock() forcing fairness! > Reviewed-by: Maarten Lankhorst > > Should this be Cc: stable@vger.kernel.org ? Can do; how far back?