Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8803491ybi; Tue, 9 Jul 2019 23:30:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqycYlrWeXe6VfXEXCgyysftYplIg9AbpT9wapb434v2B4PqQPF19ekospB/fxCq56FCoEPu X-Received: by 2002:a17:902:704c:: with SMTP id h12mr35458599plt.318.1562740254492; Tue, 09 Jul 2019 23:30:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562740254; cv=none; d=google.com; s=arc-20160816; b=idl6beQNqrDohllpWOoGrCEscdxH7kE/0bWP1Jsd3kM98BeXKB5cRDpHk49iaNAmzv 1v+V3ClKxdJvNdtNiXFYjaF7qAJlqCBa+cBDs5Y1VaQf712iwu0IM09wE/umigbRXi7W diyFoUAx5C0TIf9iU/YzYsjtYesY0a/geuFEfnmTyus7UK1wZY6mwRoVz2oax49MDPPn 7veAXEig/JDnOF0L3hH7xKLpe8X7qo5fPx4ZnTT3xFzJqR5IaH656vD7lPqMtf/nHrb1 dYZ3I4EvafkoVPuxcx2s8I2cCSYpF361HRlWfTPy94e1RhM2QiVamW1GB8g7/jvBkZcC gzjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=vm/zZ1E3DFUQH7z4QiyYfliAbDwL89C3i7b0XZMu7Ik=; b=rQ5hFfDfFu160Zam3dI4I2FOpY05YHBCP3qh7kNedNgVJRyuH/z3q9dIXhRb/t4xOD O1TIChdyRDMnx61g3vfdUudvwoEQGGobK3ukH50FsmXlUhIurVKrLpEduwsqQcyEgVEh POht7ZMYkRsP1rV0wU9T0+lnSvh6NA0zBANBvQlQNcKepIvwdr7fZbaIHG7d6sKIwtLN 3yfwK4vqizqw6GDALHqqdtcys+WYV5c67HsebyrXy51hQpobwisirUpHx2uKmrJI8GPO +N/BPXcTPsZqPVgP3O1j2RPq6VSUNJ4Obh/ddA7/SNVLAO1jo85hSm+p48/kEXMZqFC5 UnJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="IvMuuqG/"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n22si1334107pgj.474.2019.07.09.23.30.37; Tue, 09 Jul 2019 23:30:54 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="IvMuuqG/"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726298AbfGJGaT (ORCPT + 99 others); Wed, 10 Jul 2019 02:30:19 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:37241 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725844AbfGJGaT (ORCPT ); Wed, 10 Jul 2019 02:30:19 -0400 Received: by mail-qk1-f196.google.com with SMTP id d15so1051567qkl.4 for ; Tue, 09 Jul 2019 23:30:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vm/zZ1E3DFUQH7z4QiyYfliAbDwL89C3i7b0XZMu7Ik=; b=IvMuuqG/ZItyBWO+3M/JGvIcWC+HB6PHTUOGX4IIOEDAcJx3ATD9nPyqZZTiN1M+VU BccY8KQeWsH0HDHrosVt4H7LRrMHqfmnTrmFp+8Tlz2/2vp1Wv32k/JGzeX5g8pFFc/H MyEGAtY9HnZ65x9e8YFB1oiD1QPv6DVPjtQMfPUyVqc8k+JwM7imjFuCN6015JQui1QB WbO9wSz01qsFA1L8VkOK8ZJdJWLWAqfyQZXAgLBzpbGciX7+niZ0zlNeWueq4RkEYUHC XBknzAUaV1C7JQDAYR7hlRfetW0hqObiZMCE0O69g6RzRQUpZusqM/TpBWTjyhPUYsH7 cJVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vm/zZ1E3DFUQH7z4QiyYfliAbDwL89C3i7b0XZMu7Ik=; b=SZUA+rNj+ZxtWvWn79r6WGtAuC/kW4CFv7fkYL9mkAFpgaTDIV8o5xTkEUnSi8jvOU OyfWNSM+lt8Cw4IzyRVZv8SQMj9ZhKbxyRTte0GegmqfJnviIGXrthW1mQfm72fM5SJx TgYTwTXyRFMp9oEz9wikzh2Kvcd63nu9HDJndW4kOi0seTSELOYsfTXXpfso9L70t6N/ flweTVaYtJPM3VDAuorbu/Mp73swTcWgOHecTu6bZGLnYfqe5lNk5kSYEQK07QbydFSR rdE9H/RNlUe6vZlWJ09n6bIXNWa5BAenu/3elUpE2SR40mkMYnW4Fp/EWPPJzP9vaUTL 5y/Q== X-Gm-Message-State: APjAAAWr63peoR6+C3awloUIB50ShxoHadchFDIh65GBv+IKs3jTVZ+Q 6QsCQrVp7j/EiRkJowgxqNxL/u8yLqtFjDE44T0= X-Received: by 2002:a37:9944:: with SMTP id b65mr22716631qke.105.1562740218660; Tue, 09 Jul 2019 23:30:18 -0700 (PDT) MIME-Version: 1.0 References: <20190628091528.17059-1-duyuyang@gmail.com> <20190628091528.17059-31-duyuyang@gmail.com> <20190710053002.GC14490@tardis> In-Reply-To: <20190710053002.GC14490@tardis> From: Yuyang Du Date: Wed, 10 Jul 2019 14:30:07 +0800 Message-ID: Subject: Re: [PATCH v3 30/30] locking/lockdep: Remove irq-safe to irq-unsafe read check To: Boqun Feng Cc: Peter Zijlstra , Will Deacon , Ingo Molnar , Bart Van Assche , ming.lei@redhat.com, Frederic Weisbecker , Thomas Gleixner , LKML , Waiman Long , paulmck@linux.vnet.ibm.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for review. On Wed, 10 Jul 2019 at 13:30, Boqun Feng wrote: > > On Fri, Jun 28, 2019 at 05:15:28PM +0800, Yuyang Du wrote: > > We have a lockdep warning: > > > > ======================================================== > > WARNING: possible irq lock inversion dependency detected > > 5.1.0-rc7+ #141 Not tainted > > -------------------------------------------------------- > > kworker/8:2/328 just changed the state of lock: > > 0000000007f1a95b (&(&host->lock)->rlock){-...}, at: ata_bmdma_interrupt+0x27/0x1c0 [libata] > > but this lock took another, HARDIRQ-READ-unsafe lock in the past: > > (&trig->leddev_list_lock){.+.?} > > > > and interrupts could create inverse lock ordering between them. > > > > other info that might help us debug this: > > Possible interrupt unsafe locking scenario: > > > > CPU0 CPU1 > > ---- ---- > > lock(&trig->leddev_list_lock); > > local_irq_disable(); > > lock(&(&host->lock)->rlock); > > lock(&trig->leddev_list_lock); > > > > lock(&(&host->lock)->rlock); > > > > *** DEADLOCK *** > > > > This splat is a false positive, which is enabled by the addition of > > If so, I think the better way is to reorder this patch before recursive > read lock suppport, for better bisect-ability. Good suggestion. Thanks, Yuyang