Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751231AbdFCUuf (ORCPT ); Sat, 3 Jun 2017 16:50:35 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:45000 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750991AbdFCUud (ORCPT ); Sat, 3 Jun 2017 16:50:33 -0400 Subject: Re: [linux-next / tty] possible circular locking dependency detected To: Greg Kroah-Hartman Cc: Sergey Senozhatsky , Jiri Slaby , linux-kernel@vger.kernel.org, Sergey Senozhatsky References: <20170522073943.GA469@jagdpanzerIV.localdomain> <20170522102454.GA30331@kroah.com> <50cc6717-c709-873c-b434-07da13365977@oracle.com> <72780780-6259-045f-abb5-3b6e97ec4ffd@oracle.com> <20170603093420.GB9120@kroah.com> From: Vegard Nossum Message-ID: <13d0422b-29b1-4d2f-5b56-1d30cd70f07d@oracle.com> Date: Sat, 3 Jun 2017 22:50:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170603093420.GB9120@kroah.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1712 Lines: 45 On 06/03/17 11:34, Greg Kroah-Hartman wrote: > On Mon, May 29, 2017 at 12:43:39PM +0200, Vegard Nossum wrote: >> On 05/22/17 12:27, Vegard Nossum wrote: >>> On 05/22/17 12:24, Greg Kroah-Hartman wrote: >>>> On Mon, May 22, 2017 at 04:39:43PM +0900, Sergey Senozhatsky wrote: >>>>> Hello, >>>>> >>>>> [ 1274.378287] ====================================================== >>>>> [ 1274.378289] WARNING: possible circular locking dependency detected >>>>> [ 1274.378290] >>>>> 4.12.0-rc1-next-20170522-dbg-00007-gc09b2ab28b74-dirty #1317 Not >>>>> tainted >>>>> [ 1274.378291] ------------------------------------------------------ >>>>> [ 1274.378293] kworker/u8:5/111 is trying to acquire lock: >>>>> [ 1274.378294] (&buf->lock){+.+...}, at: [] >>>>> tty_buffer_flush+0x34/0x88 >>>>> [ 1274.378300] >>>>> but task is already holding lock: >>>>> [ 1274.378301] (&o_tty->termios_rwsem/1){++++..}, at: >>>>> [] isig+0x47/0xd2 >>>>> [ 1274.378307] >>>>> which lock already depends on the new lock. >>>>> >>> >>>> Any hint as to what you were doing when this happened? >>>> >>>> Does this also show up in 4.11? >>> >>> It's my patch "tty: fix port buffer locking" :-/ >>> >>> At a glance, looks related to pty taking the lock on the other side in a >>> different order. I'll have a closer look. >> >> I can reproduce the lockdep report locally on v4.12-rc3. Looking at it now. > > Any ideas? Or should I just revert the original patch? I think we must revert it for now, as I can easily reproduce not just the lockdep warning but actual hangs. It seems I missed some code paths when I worked the original patch. I'm working on a fix. Vegard