Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4142970imu; Mon, 12 Nov 2018 06:31:20 -0800 (PST) X-Google-Smtp-Source: AJdET5duLOmTEJPxP+7psgD4GJSh2Hw4STZyTshekLXS/pLvej2aqKqEWOQL9ptsC1Ihi9yWDO6s X-Received: by 2002:a63:ee0e:: with SMTP id e14mr1017724pgi.8.1542033080598; Mon, 12 Nov 2018 06:31:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542033080; cv=none; d=google.com; s=arc-20160816; b=w/7tgFzH6lpLhyqKzciyBG0fWs3ORRxftttJfrksU2SPdJpfKpcT3sRXiLV3hMfGsl 1wj9HGMXnoxq80y2zmrhZ9oXzn5hCMdVarXtq56Kc79RXLQMiM4xJAOaxPvqYWhoXKJw kXIBgySmWAKQhStEqPoUcK7j0Ew3pLLV3VLf6ap7ItvsQ29ojHwTZV+gJEtd5V4RFLN/ qyuyLnUpGvh2U2QPEBQ/hN1BujpgFNf+6t8WRvrKcnJgGpFv+AMwk4jLapwEsDxXc5To NRX3aUTwkr9d2WEMfP+aP8lLMPQMk5F9FbgaNu5WT/DqmMCuK7+LW2nzB7TvWq7VSm0d VLkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=E27fuKyNElueLifwQWzx8ZCmNM49Dctn/MRU5dzQL0U=; b=GdvnrUvWXsZTcbzWRis+VNfeQkiYMChUCygQt1bs/wLzICchiJdBgdE4FyBQdRe/G7 Hd2A3N+MiaFw3SxujrbEiqsYkKGEXpMzL2W2wBug1ZZuXitjxu8o0WILPemVgbIfLJ87 eMaChO/oHO1t5h/cYJIJ4F/cSCmqhSH/dX/iSO9oc1ewjSueB0Hc7s9Iw2XfzFf4zUI8 dAa86KWXdaBw6oWf1BbsPvVO8zgkonEJkeCcHwiJUtXq8XHsHnd9elu173q3OjHrwyNV MCSEa1eFPMZBnsgrowY7sN1nBuI4z+RKP4v4pi+Ff9L+2NhaIfImi7Mt6roQBhgL/W9E FYLw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z5si6965340pgj.177.2018.11.12.06.31.04; Mon, 12 Nov 2018 06:31:20 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728250AbeKMAWy (ORCPT + 99 others); Mon, 12 Nov 2018 19:22:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59568 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726385AbeKMAWy (ORCPT ); Mon, 12 Nov 2018 19:22:54 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D863689AC4; Mon, 12 Nov 2018 14:29:23 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2C3A15C207; Mon, 12 Nov 2018 14:29:23 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id wACETMWd006467; Mon, 12 Nov 2018 09:29:22 -0500 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id wACETKMH006462; Mon, 12 Nov 2018 09:29:20 -0500 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Mon, 12 Nov 2018 09:29:20 -0500 (EST) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Andrew Morton cc: kernel test robot , Linux Memory Management List , linux-kernel@vger.kernel.org, LKP , Tejun Heo , David Rientjes , Christoph Lameter , Joonsoo Kim , Pekka Enberg Subject: Re: [LKP] d50d82faa0 [ 33.671845] WARNING: possible circular locking dependency detected In-Reply-To: <20181107190558.812375161de4b5df413ea31b@linux-foundation.org> Message-ID: References: <20181023003004.GH24195@shao2-debian> <20181107154336.21e1f815226facdffd4a6c54@linux-foundation.org> <20181107190558.812375161de4b5df413ea31b@linux-foundation.org> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 12 Nov 2018 14:29:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 7 Nov 2018, Andrew Morton wrote: > On Wed, 7 Nov 2018 15:43:36 -0800 Andrew Morton wrote: > > > On Tue, 23 Oct 2018 08:30:04 +0800 kernel test robot wrote: > > > > > Greetings, > > > > > > 0day kernel testing robot got the below dmesg and the first bad commit is > > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > > > > > > commit d50d82faa0c964e31f7a946ba8aba7c715ca7ab0 > > > Author: Mikulas Patocka > > > AuthorDate: Wed Jun 27 23:26:09 2018 -0700 > > > Commit: Linus Torvalds > > > CommitDate: Thu Jun 28 11:16:44 2018 -0700 > > > > > > slub: fix failure when we delete and create a slab cache > > > > This is ugly. Is there an alternative way of fixing the race which > > Mikulas attempted to address? Possibly cancel the work and reuse the > > existing sysfs file, or is that too stupid to live? > > > > 3b7b314053d021 ("slub: make sysfs file removal asynchronous") was > > pretty lame, really. As mentioned, > > > > : It'd be the cleanest to deal with the issue by removing sysfs files > > : without holding slab_mutex before the rest of shutdown; however, given > > : the current code structure, it is pretty difficult to do so. > > > > Would be a preferable approach. > > > > > > > > This uncovered a bug in the slub subsystem - if we delete a cache and > > > immediatelly create another cache with the same attributes, it fails > > > because of duplicate filename in /sys/kernel/slab/. The slub subsystem > > > offloads freeing the cache to a workqueue - and if we create the new > > > cache before the workqueue runs, it complains because of duplicate > > > filename in sysfs. > > Alternatively, could we flush the workqueue before attempting to > (re)create the sysfs file? What if someone creates the slab cache from the workqueue? > Extra points for only doing this if the > first (re)creation attempt returned -EEXIST? If it returns -EEXIST, it has already written the warning to the log. Mikulas