linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sedat Dilek <sedat.dilek@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Ingo Molnar <mingo@kernel.org>, "Theodore Ts'o" <tytso@mit.edu>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [Linux-v4.6-rc1] ext4: WARNING: CPU: 2 PID: 2692 at kernel/locking/lockdep.c:2017 __lock_acquire+0x180e/0x2260
Date: Sun, 27 Mar 2016 23:48:39 +0200	[thread overview]
Message-ID: <CA+icZUV8caSkEJc6smDtKRacX2iMQnt-7EDgp-qSHo-Yqt6Fvw@mail.gmail.com> (raw)
In-Reply-To: <CA+icZUX_pH-L=7ng5n=1UjD1KW7pjutJYqVY4hm28sYfZ8YXgQ@mail.gmail.com>

On Sun, Mar 27, 2016 at 10:59 PM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> On Sun, Mar 27, 2016 at 10:48 PM, Peter Zijlstra <peterz@infradead.org> 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 <http://gnu.org/licenses/gpl.html>.
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) ]

--- 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

...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 -

  reply	other threads:[~2016-03-27 21:48 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-27  8:15 [Linux-v4.6-rc1] ext4: WARNING: CPU: 2 PID: 2692 at kernel/locking/lockdep.c:2017 __lock_acquire+0x180e/0x2260 Sedat Dilek
2016-03-27  8:57 ` Sedat Dilek
2016-03-27 12:03   ` Linus Torvalds
2016-03-27 13:32     ` Boqun Feng
2016-03-27 18:23     ` Theodore Ts'o
2016-03-27 19:40       ` Sedat Dilek
     [not found]         ` <CA+55aFwoKRpgq8OCTxUaP+8gOg-mnN3nbruYgiK32a=C5U4TkQ@mail.gmail.com>
2016-03-27 20:24           ` Sedat Dilek
2016-03-27 20:48     ` Peter Zijlstra
2016-03-27 20:59       ` Sedat Dilek
2016-03-27 21:48         ` Sedat Dilek [this message]
2016-03-28  1:05         ` Boqun Feng
2016-03-28  6:33           ` Peter Zijlstra
2016-03-29  8:47       ` Ingo Molnar
2016-03-30  9:20         ` Sedat Dilek
2016-03-30  9:36           ` Sedat Dilek
2016-03-30  9:36         ` Peter Zijlstra
2016-03-30  9:49           ` Sedat Dilek
2016-03-30 10:33             ` Sedat Dilek
2016-03-30 12:43             ` Peter Zijlstra
2016-03-30 12:46               ` Sedat Dilek
2016-03-30 13:15                 ` Peter Zijlstra
2016-03-30  9:50           ` Peter Zijlstra
2016-03-30  9:59           ` Boqun Feng
2016-03-30 10:36             ` Peter Zijlstra
2016-03-30 11:07               ` Sedat Dilek
2016-03-31 15:42             ` Peter Zijlstra
2016-03-31 15:52               ` Boqun Feng
2016-04-02  6:26               ` Sedat Dilek
2016-03-30 14:06           ` Peter Zijlstra
2016-03-30 15:21             ` Sedat Dilek
2016-03-30 17:03               ` [PATCH] lockdep: print chain_key collision information Alfredo Alvarez Fernandez
2016-03-30 17:19                 ` Peter Zijlstra
2016-04-01  6:36                 ` [tip:core/urgent] locking/lockdep: Print " tip-bot for Alfredo Alvarez Fernandez
2016-05-10  9:09                   ` Peter Zijlstra
2016-04-04 15:31             ` [Linux-v4.6-rc1] ext4: WARNING: CPU: 2 PID: 2692 at kernel/locking/lockdep.c:2017 __lock_acquire+0x180e/0x2260 Sedat Dilek
2016-04-04 16:02               ` Peter Zijlstra
2016-05-09 11:37                 ` Sedat Dilek
2016-06-03 15:15             ` Sedat Dilek
2016-04-23 12:54           ` [tip:locking/urgent] lockdep: Fix lock_chain::base size tip-bot for Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+icZUV8caSkEJc6smDtKRacX2iMQnt-7EDgp-qSHo-Yqt6Fvw@mail.gmail.com \
    --to=sedat.dilek@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).