From patchwork Sun Mar 27 21:48:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sedat Dilek X-Patchwork-Id: 8676501 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EAC399F36E for ; Sun, 27 Mar 2016 21:49:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B0C5E20251 for ; Sun, 27 Mar 2016 21:48:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F55B20204 for ; Sun, 27 Mar 2016 21:48:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752289AbcC0Vsm (ORCPT ); Sun, 27 Mar 2016 17:48:42 -0400 Received: from mail-vk0-f49.google.com ([209.85.213.49]:33175 "EHLO mail-vk0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752119AbcC0Vsl (ORCPT ); Sun, 27 Mar 2016 17:48:41 -0400 Received: by mail-vk0-f49.google.com with SMTP id k1so137435170vkb.0; Sun, 27 Mar 2016 14:48:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc; bh=m1N2wEASKWquMBUYqEL815r0rT+NM37qc9HjisJdrdg=; b=r09tTyFSWqqO5hC6wCzll2w0lPd/9uO4PEVZLIVq7fGVi7pLxxVXf8v1Jyw30BRE0b ysWL8zjTC3VjyGMYEsg488WoFNCmrd051JZy+qkkzoKideEcY7sMMtZ1Pm/aOJHMuyPk aAcmhAR4dV7Kz2mE6IfpWf0tFa+m6xwnRC4aZ3YMjXy/18a/WkOkUdvFyjGQABHeDdnm OqaodzEt0sCTU8VXj0HiUGh9xvdNbGt8eYsMxDVZCyjXPDzn/JmA5lW7itF6Ds3Asqpy 0RTnsnu9/ki27/O40BFmr/HRqGvwtxeqlK2gWl3Ot588ZV6B3gg1RwqDW+fPI6xkqHtH 5QKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=m1N2wEASKWquMBUYqEL815r0rT+NM37qc9HjisJdrdg=; b=DFzRz3DgbSF6jFAn2zQSgg6+GF1z0FjiYBsMyQ6XrJ9opeEWws9LfN4TWmE4eozaBN Ecr6tpCSLm5+LLTrLTHaSwlGwP9Zm1WkKi1T5eHG5ttefvh6zhGj608aS28yfRY+iqHV Bnh5xj+vY1C88a9rk+89pYaART9538mmq56+JwaRElw+m2YvVfx7ReU1OylRSRBzjeYf Y5C/pM1LHlkYY7i0eO5hm1qqhN7wpxoj+veA1dSqr4GGH3/QdbAgiJlZwOw2yP8lYepu i0obOHwQV7sl5/SQbXYH3RTU0hvp726569pni1yJKERXRCCnGfCKoyqgjFKbk2K9HEIx /dgw== X-Gm-Message-State: AD7BkJL/Kp1+b2Lb4ByEYHity7+n3s8HTnxs230luZPuoIB88++8CiY3DQDQnU0G45F6gSG+qdOaZF7CVkCB0w== MIME-Version: 1.0 X-Received: by 10.159.36.236 with SMTP id 99mr12513256uar.42.1459115319723; Sun, 27 Mar 2016 14:48:39 -0700 (PDT) Received: by 10.103.112.68 with HTTP; Sun, 27 Mar 2016 14:48:39 -0700 (PDT) Reply-To: sedat.dilek@gmail.com In-Reply-To: References: <20160327204810.GW6356@twins.programming.kicks-ass.net> Date: Sun, 27 Mar 2016 23:48:39 +0200 Message-ID: Subject: Re: [Linux-v4.6-rc1] ext4: WARNING: CPU: 2 PID: 2692 at kernel/locking/lockdep.c:2017 __lock_acquire+0x180e/0x2260 From: Sedat Dilek To: Peter Zijlstra Cc: Linus Torvalds , Ingo Molnar , "Theodore Ts'o" , linux-fsdevel , LKML Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sun, Mar 27, 2016 at 10:59 PM, Sedat Dilek wrote: > On Sun, Mar 27, 2016 at 10:48 PM, Peter Zijlstra wrote: >> On Sun, Mar 27, 2016 at 05:03:44AM -0700, Linus Torvalds wrote: >>> Anyway, I don't think that DEBUG_LOCKS_WARN_ON() in >>> >>> kernel/locking/lockdep.c:2017 __lock_acquire >>> >>> would be an ext4 issue, it looks more like an internal lockdep issue. >>> >>> Adding in the lockdep people, who will set me right. >> >> You are right; this is lockdep running into a hash collision; which is a >> new DEBUG_LOCKDEP test. See 9e4e7554e755 ("locking/lockdep: Detect >> chain_key collisions"). > > [1] says... > > "Also tested with lockdep's test suite after applying the patch: > > [ 0.000000] Good, all 253 testcases passed! |" > > Where can I find this "lockdep's test suite"? > > When is that checking below done or what causes this? > > $ grep -i lock dmesg_4.6.0-rc1-1-iniza-small.txt | grep -i dep > [ 0.000000] RCU lockdep checking is enabled. > [ 0.000000] Lock dependency validator: Copyright (c) 2006 Red Hat, > Inc., Ingo Molnar > [ 0.000000] ... MAX_LOCKDEP_SUBCLASSES: 8 > [ 0.000000] ... MAX_LOCK_DEPTH: 48 > [ 0.000000] ... MAX_LOCKDEP_KEYS: 8191 > [ 0.000000] ... MAX_LOCKDEP_ENTRIES: 32768 > [ 0.000000] ... MAX_LOCKDEP_CHAINS: 65536 > [ 0.000000] memory used by lock dependency info: 8159 kB > [ 77.403391] WARNING: CPU: 2 PID: 2692 at > kernel/locking/lockdep.c:2017 __lock_acquire+0x180e/0x2260 > [ 77.403394] DEBUG_LOCKS_WARN_ON(chain->depth != curr->lockdep_depth > - (i - 1)) > > - Sedat - > > [1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=9e4e7554e755 Hmm. I had several problems... [ Building liblockdep ] $ cd $BUILD_DIR $ LC_ALL=C make -C tools/ liblockdep make: Entering directory `/home/wearefam/src/linux-kernel/linux/tools' DESCEND lib/lockdep make[1]: Entering directory `/home/wearefam/src/linux-kernel/linux/tools/lib/lockdep' CC common.o CC lockdep.o CC preload.o CC rbtree.o LD liblockdep-in.o LD liblockdep.a LD liblockdep.so.4.6.0-rc1 make[1]: Leaving directory `/home/wearefam/src/linux-kernel/linux/tools/lib/lockdep' make: Leaving directory `/home/wearefam/src/linux-kernel/linux/tools' [ run_tests.sh fails due to unsupported 'basename -s' ] $ LC_ALL=C basename --version basename (GNU coreutils) 8.13 Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by David MacKenzie. $ cd tools/lib/lockdep/ $ LC_ALL=C ./run_tests.sh basename: invalid option -- 's' Try `basename --help' for more information. ... timeout: failed to run command `./tests/': Permission denied FAILED! rm: cannot remove `tests/': Is a directory basename: invalid option -- 's' Try `basename --help' for more information. ... timeout: failed to run command `./tests/': Permission denied FAILED! rm: cannot remove `tests/': Is a directory basename: invalid option -- 's' Try `basename --help' for more information. ... timeout: failed to run command `./tests/': Permission denied FAILED! rm: cannot remove `tests/': Is a directory basename: invalid option -- 's' Try `basename --help' for more information. ... timeout: failed to run command `./tests/': Permission denied FAILED! rm: cannot remove `tests/': Is a directory basename: invalid option -- 's' Try `basename --help' for more information. ... timeout: failed to run command `./tests/': Permission denied FAILED! rm: cannot remove `tests/': Is a directory basename: invalid option -- 's' Try `basename --help' for more information. ... timeout: failed to run command `./tests/': Permission denied FAILED! rm: cannot remove `tests/': Is a directory basename: invalid option -- 's' Try `basename --help' for more information. ... timeout: failed to run command `./tests/': Permission denied FAILED! rm: cannot remove `tests/': Is a directory basename: invalid option -- 's' Try `basename --help' for more information. ... timeout: failed to run command `./tests/': Permission denied FAILED! rm: cannot remove `tests/': Is a directory basename: invalid option -- 's' Try `basename --help' for more information. ... timeout: failed to run command `./tests/': Permission denied FAILED! rm: cannot remove `tests/': Is a directory basename: invalid option -- 's' Try `basename --help' for more information. ... timeout: failed to run command `./tests/': Permission denied FAILED! rm: cannot remove `tests/': Is a directory basename: invalid option -- 's' Try `basename --help' for more information. ... timeout: failed to run command `./tests/': Permission denied FAILED! rm: cannot remove `tests/': Is a directory basename: invalid option -- 's' Try `basename --help' for more information. (PRELOAD) ... ./lockdep: line 3: ./tests/: Is a directory FAILED! rm: cannot remove `tests/': Is a directory basename: invalid option -- 's' Try `basename --help' for more information. (PRELOAD) ... ./lockdep: line 3: ./tests/: Is a directory FAILED! rm: cannot remove `tests/': Is a directory basename: invalid option -- 's' Try `basename --help' for more information. (PRELOAD) ... ./lockdep: line 3: ./tests/: Is a directory FAILED! rm: cannot remove `tests/': Is a directory basename: invalid option -- 's' Try `basename --help' for more information. (PRELOAD) ... ./lockdep: line 3: ./tests/: Is a directory FAILED! rm: cannot remove `tests/': Is a directory basename: invalid option -- 's' Try `basename --help' for more information. (PRELOAD) ... ./lockdep: line 3: ./tests/: Is a directory FAILED! rm: cannot remove `tests/': Is a directory basename: invalid option -- 's' Try `basename --help' for more information. (PRELOAD) ... ./lockdep: line 3: ./tests/: Is a directory FAILED! rm: cannot remove `tests/': Is a directory basename: invalid option -- 's' Try `basename --help' for more information. (PRELOAD) ... ./lockdep: line 3: ./tests/: Is a directory FAILED! rm: cannot remove `tests/': Is a directory basename: invalid option -- 's' Try `basename --help' for more information. (PRELOAD) ... ./lockdep: line 3: ./tests/: Is a directory FAILED! rm: cannot remove `tests/': Is a directory basename: invalid option -- 's' Try `basename --help' for more information. (PRELOAD) ... ./lockdep: line 3: ./tests/: Is a directory FAILED! rm: cannot remove `tests/': Is a directory basename: invalid option -- 's' Try `basename --help' for more information. (PRELOAD) ... ./lockdep: line 3: ./tests/: Is a directory FAILED! rm: cannot remove `tests/': Is a directory basename: invalid option -- 's' Try `basename --help' for more information. (PRELOAD) ... ./lockdep: line 3: ./tests/: Is a directory FAILED! rm: cannot remove `tests/': Is a directory [ Patching run_tests.sh (liblockdep) ] ...then I get... $ LC_ALL=C ./run_tests.sh AA... PASSED! removed `tests/AA' ABA... PASSED! removed `tests/ABA' ABBA... PASSED! removed `tests/ABBA' ABBA_2threads... PASSED! removed `tests/ABBA_2threads' ABBCCA... PASSED! removed `tests/ABBCCA' ABBCCDDA... PASSED! removed `tests/ABBCCDDA' ABCABC... PASSED! removed `tests/ABCABC' ABCDBCDA... PASSED! removed `tests/ABCDBCDA' ABCDBDDA... PASSED! removed `tests/ABCDBDDA' WW... PASSED! removed `tests/WW' unlock_balance... PASSED! removed `tests/unlock_balance' (PRELOAD) AA... PASSED! removed `tests/AA' (PRELOAD) ABA... PASSED! removed `tests/ABA' (PRELOAD) ABBA... PASSED! removed `tests/ABBA' (PRELOAD) ABBA_2threads... PASSED! removed `tests/ABBA_2threads' (PRELOAD) ABBCCA... PASSED! removed `tests/ABBCCA' (PRELOAD) ABBCCDDA... PASSED! removed `tests/ABBCCDDA' (PRELOAD) ABCABC... PASSED! removed `tests/ABCABC' (PRELOAD) ABCDBCDA... PASSED! removed `tests/ABCDBCDA' (PRELOAD) ABCDBDDA... PASSED! removed `tests/ABCDBDDA' (PRELOAD) WW... PASSED! removed `tests/WW' (PRELOAD) unlock_balance... PASSED! removed `tests/unlock_balance' BTW, how did you test to get "[ 0.000000] Good, all 253 testcases passed!" from? In my dmesg I see... [ 3249.552034] show_signal_msg: 189 callbacks suppressed [ 3249.552042] liblockdep.so[15757]: segfault at 1 ip 0000000000000001 sp 00007ffe82f88078 error 14 in liblockdep.so.4.6.0-rc1[5578fbdbd000+c000] Hmm, Hmm, Hmm. Empty head, - Sedat - --- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/tools/lib/lockdep/run_tests.sh +++ b/tools/lib/lockdep/run_tests.sh @@ -3,7 +3,7 @@ make &> /dev/null for i in `ls tests/*.c`; do - testname=$(basename -s .c "$i") + testname=$(basename "$i" .c) gcc -o tests/$testname -pthread -lpthread $i liblockdep.a -Iinclude -D__USE_LIBLOCKDEP &> /dev/null echo -ne "$testname... " if [ $(timeout 1 ./tests/$testname | wc -l) -gt 0 ]; then @@ -11,11 +11,13 @@ for i in `ls tests/*.c`; do else echo "FAILED!" fi - rm tests/$testname + if [ -f "tests/$testname" ]; then + rm -v -f tests/$testname + fi done for i in `ls tests/*.c`; do - testname=$(basename -s .c "$i") + testname=$(basename "$i" .c) gcc -o tests/$testname -pthread -lpthread -Iinclude $i &> /dev/null echo -ne "(PRELOAD) $testname... " if [ $(timeout 1 ./lockdep ./tests/$testname | wc -l) -gt 0 ]; then @@ -23,5 +25,7 @@ for i in `ls tests/*.c`; do else echo "FAILED!" fi - rm tests/$testname + if [ -f "tests/$testname" ]; then + rm -v -f tests/$testname + fi done