Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1072503ybi; Fri, 14 Jun 2019 08:10:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqyuP5EkNjK6vsQrn+/FevonE3ctMwN/+fFjtoSVDnNKxRtHgtyuu4AS7jPzs5/bxzpeTVtx X-Received: by 2002:a17:90a:b903:: with SMTP id p3mr11441947pjr.79.1560525034944; Fri, 14 Jun 2019 08:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560525034; cv=none; d=google.com; s=arc-20160816; b=CCCJbW/iuHaEI59zhtqmWaBP3PbqcqxYNPSBclynQ+/jMg+aSDba1MD1lfrRwr7FYh 9cBHDH+BB6g4JH/PY/FyBxOAmu9GGmEj3U4lw0i6lWD7T3HbLicua3zAho7Rglfj+1FB LaRJaN6J9NiLY1Lc0XHKblmeXat1L2xBlZPfrsjffuVZ6Xi1iQVbrFCeZ86qU4NnlKYU ZSO2YHdSbzHKHkX9Eymv//RKpA3PwRHtKJu02ZyrsM5M0RRdtK3hXXvnIeddb/EBwCT9 Vv3pIfhrwO521lnZaK3MWWEtH0y3xQU9ZaB8oZ0+BIaKfd1+ufRbqduFKlVy31jkw1Gi NR6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version; bh=qBZbZUqRZtYP+myZVX9jGu9mRZJTB98ZkbNfcB+/6Zg=; b=F2j6ggD97D74w+7ScuW2Ie2mEnChhw5gJIyLFA1JpfFUIlRwxK8KXIaYVDT6zquvda QDDClHPHeI/tpmwLNVAwNHygB54fKCLZtXSxDzEp0xLFaivMgGgiz4gdaz3B/icId/iD A9+yYCACqIMGZBF3RMZ7vANi88L+yov4OkRp5VTj2vP2T4LfOpW3M1jduST7vDqZlkBI qp4KuzydjzpXxcZY4OyYeuWMmSHn4GdJ1I4SfFch0JZW69imQrJ05FNys8aopbHEt2I3 9uPTlmvs3peE9a7aSH2tilFQ7d4Qfyd8jThJfHALuMrM6c19VgcKGcGSZaVGe3AKrpgq YNaQ== 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 f62si2513033plf.88.2019.06.14.08.10.19; Fri, 14 Jun 2019 08:10:34 -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 S1725985AbfFNPIt convert rfc822-to-8bit (ORCPT + 99 others); Fri, 14 Jun 2019 11:08:49 -0400 Received: from mail.fireflyinternet.com ([109.228.58.192]:58369 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725789AbfFNPIt (ORCPT ); Fri, 14 Jun 2019 11:08:49 -0400 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from localhost (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP (TLS) id 16904012-1500050 for multiple; Fri, 14 Jun 2019 16:08:35 +0100 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT To: Greg Kroah-Hartman , Peter Zijlstra , Steven Rostedt , Tejun Heo From: Chris Wilson In-Reply-To: <20190614093914.58f41d8f@gandalf.local.home> Cc: LKML , Tvrtko Ursulin , David Airlie , Daniel Vetter , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org References: <20190614093914.58f41d8f@gandalf.local.home> Message-ID: <156052491337.7796.17642747687124632554@skylake-alporthouse-com> User-Agent: alot/0.6 Subject: Re: [BUG] lockdep splat with kernfs lockdep annotations and slab mutex from drm patch?? Date: Fri, 14 Jun 2019 16:08:33 +0100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Steven Rostedt (2019-06-14 14:39:14) > I'm trying to debug some code where I need KASAN and lockdep enabled > but I can't get past this splat unrelated to my code. I bisected it > down to this commit: > > 32eb6bcfdda9da ("drm/i915: Make request allocation caches global") > > To make sure it wasn't a bad bisect, I removed the patch and the splat > goes away. I add the patch back, and the splat returns. I did this > several times, so I have a large confidence that this is the cause of > the splat, or at least it is the commit that triggers whatever is going > on. > > Perhaps all the cache updates caused the slab_mutex to be called > inverse of the kernfs locking? > > Attached is my config. > > Also might be helpful, the splat happens: > > kernfs_fop_write() > ops->write == sysfs_kf_write > sysfs_kf_write() > ops->store = slab_attr_store More interestingly, static ssize_t slab_attr_store(struct kobject *kobj, struct attribute *attr, const char *buf, size_t len) { struct slab_attribute *attribute; struct kmem_cache *s; int err; attribute = to_slab_attr(attr); s = to_slab(kobj); if (!attribute->store) return -EIO; err = attribute->store(s, buf, len); #ifdef CONFIG_MEMCG if (slab_state >= FULL && err >= 0 && is_root_cache(s)) { struct kmem_cache *c; mutex_lock(&slab_mutex); so it happens to hit the error + FULL case with the additional slabcaches? Anyway, according to lockdep, it is dangerous to use the slab_mutex inside slab_attr_store(). -Chris