Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5254297imm; Tue, 18 Sep 2018 06:47:19 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaI/FIrVY6nmV7H9vQPE8j4K570adKhMfpGJxDSX7426mqCf68CT9cXPev0koVA/x1itFEq X-Received: by 2002:a63:6849:: with SMTP id d70-v6mr27734656pgc.7.1537278438909; Tue, 18 Sep 2018 06:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537278438; cv=none; d=google.com; s=arc-20160816; b=u7Oqdst85REEfNlbyvfOOKf9qKbeij4QsMK9PrEPdZhxWD/pHccTltRzrv0DDYiHOI KKNYP7qx7C6pRXgwLgiWYpjdcV74tcJl+7qouTdp/dp4mnDm9JbJrYMT5IMNYcGjzN8P 6OlKPghDZt0qAHt0+lqwtUSJPoD3rfhWWQKBmvep+8VXBj2s7fwjbl0bpuIzuWJ2sbPK Gch6D5hVW1DhH7oT6/V42r9C/49qGu9ihXsUD51MfS3iaeY458ivIcjJ/2r4Z2izqF2P N+tEPtk4m4focNx+vkCW6VfiR59D2GfRDdjprIMF+xTxnE5RyKdqHV5KTwv3tqsRPM45 9j0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=l8Hdbi2bJCFT0tSOrNHqNOeEHRKY/APYRDn031W09l4=; b=p2dCzyAZIpxLOQ0W+3iS/cRGzRRnK5cDtKv/Je7ksFNVExniZ57Ok6LIh7NPYDwEad JNaX6h543bWeRwexdzXGWw7sD338RrtsN0kn16v7Vu8erPnbq2Ulx/g4QJoSlqaTsQcR aDG6wMegJNhBKS5CHLdp79EajS5zJ0bAH1NuIaBhdfHGOlum3rglmeUkYQSycMB5kNvk F50c+0EgL5dqSG9WKmeAmtcCnxE7x/NsePUpgLfWyTwdndhzyc3yvn7SBpNxQ4Oiy8Ks RZYw83Cq0JpgtiGdOp3odz6YiIWXFpQXg+XApmJrfGAdeEKHPyXDAZGx8aWj18WYj3ov nFlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i8-v6si17847967pfo.128.2018.09.18.06.47.01; Tue, 18 Sep 2018 06:47:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729773AbeIRTRu (ORCPT + 99 others); Tue, 18 Sep 2018 15:17:50 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41772 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727207AbeIRTRu (ORCPT ); Tue, 18 Sep 2018 15:17:50 -0400 Received: from localhost (unknown [147.67.4.98]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D244FD2A; Tue, 18 Sep 2018 13:43:49 +0000 (UTC) Date: Tue, 18 Sep 2018 15:43:47 +0200 From: Greg Kroah-Hartman To: Dmitry Safonov Cc: linux-kernel@vger.kernel.org, Dmitry Safonov <0x7f454c46@gmail.com>, Daniel Axtens , Dmitry Vyukov , Mark Rutland , Michael Neuling , Mikulas Patocka , Nathan March , Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= , Peter Hurley , Peter Zijlstra , "Rong, Chen" , Sergey Senozhatsky , Tan Xiaojun , Tetsuo Handa , Jiri Slaby Subject: Re: [PATCHv5 2/7] tty/ldsem: Wake up readers after timed out down_write() Message-ID: <20180918134347.GD23431@kroah.com> References: <20180917235258.5719-1-dima@arista.com> <20180917235258.5719-3-dima@arista.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180917235258.5719-3-dima@arista.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 18, 2018 at 12:52:53AM +0100, Dmitry Safonov wrote: > ldsem_down_read() will sleep if there is pending writer in the queue. > If the writer times out, readers in the queue should be woken up, > otherwise they may miss a chance to acquire the semaphore until the last > active reader will do ldsem_up_read(). > > There was a couple of reports where there was one active reader and > other readers soft locked up: > Showing all locks held in the system: > 2 locks held by khungtaskd/17: > #0: (rcu_read_lock){......}, at: watchdog+0x124/0x6d1 > #1: (tasklist_lock){.+.+..}, at: debug_show_all_locks+0x72/0x2d3 > 2 locks held by askfirst/123: > #0: (&tty->ldisc_sem){.+.+.+}, at: ldsem_down_read+0x46/0x58 > #1: (&ldata->atomic_read_lock){+.+...}, at: n_tty_read+0x115/0xbe4 > > Prevent readers wait for active readers to release ldisc semaphore. > > Link: lkml.kernel.org/r/<20171121132855.ajdv4k6swzhvktl6@wfg-t540p.sh.intel.com> > Link: lkml.kernel.org/r/<20180907045041.GF1110@shao2-debian> > Cc: Greg Kroah-Hartman > Cc: Jiri Slaby > Cc: Peter Zijlstra > Reported-by: kernel test robot > Signed-off-by: Dmitry Safonov > --- Why isn't this ok for the stable trees? thanks, greg k-h