02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

05 Jun, 2017

18 commits

  • Move to using tools/include/ instead.

    Signed-off-by: Sasha Levin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: acme@redhat.com
    Link: http://lkml.kernel.org/r/20170531003747.10557-2-alexander.levin@verizon.com
    Signed-off-by: Ingo Molnar

    Levin, Alexander (Sasha Levin)
     
  • This would prevent the liblockdep error messages from getting
    mixed in with the test result output.

    Signed-off-by: Sasha Levin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: a.p.zijlstra@chello.nl
    Cc: ben@decadent.org.uk
    Link: http://lkml.kernel.org/r/20170525130005.5947-22-alexander.levin@verizon.com
    Signed-off-by: Ingo Molnar

    Levin, Alexander (Sasha Levin)
     
  • Signed-off-by: Sasha Levin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: a.p.zijlstra@chello.nl
    Cc: ben@decadent.org.uk
    Link: http://lkml.kernel.org/r/20170525130005.5947-21-alexander.levin@verizon.com
    Signed-off-by: Ingo Molnar

    Levin, Alexander (Sasha Levin)
     
  • This would fix the build error caused by:

    383776fa7 ("locking/lockdep: Handle statically initialized
    PER_CPU locks properly")

    Signed-off-by: Sasha Levin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: a.p.zijlstra@chello.nl
    Cc: ben@decadent.org.uk
    Link: http://lkml.kernel.org/r/20170525130005.5947-19-alexander.levin@verizon.com
    Signed-off-by: Ingo Molnar

    Levin, Alexander (Sasha Levin)
     
  • This provides PTR_ERR() now used by lockdep.

    Signed-off-by: Sasha Levin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: a.p.zijlstra@chello.nl
    Cc: ben@decadent.org.uk
    Link: http://lkml.kernel.org/r/20170525130005.5947-18-alexander.levin@verizon.com
    Signed-off-by: Ingo Molnar

    Levin, Alexander (Sasha Levin)
     
  • Signed-off-by: Ben Hutchings
    Signed-off-by: Sasha Levin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: a.p.zijlstra@chello.nl
    Link: http://lkml.kernel.org/r/20170525130005.5947-16-alexander.levin@verizon.com
    Signed-off-by: Ingo Molnar

    Ben Hutchings
     
  • Signed-off-by: Ben Hutchings
    Signed-off-by: Sasha Levin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: a.p.zijlstra@chello.nl
    Link: http://lkml.kernel.org/r/20170525130005.5947-15-alexander.levin@verizon.com
    Signed-off-by: Ingo Molnar

    Ben Hutchings
     
  • Signed-off-by: Ben Hutchings
    Signed-off-by: Sasha Levin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: a.p.zijlstra@chello.nl
    Link: http://lkml.kernel.org/r/20170525130005.5947-14-alexander.levin@verizon.com
    Signed-off-by: Ingo Molnar

    Ben Hutchings
     
  • - More rcu stubs
    - New dummy headers due to sched header split
    - jhash2 included in due to kernel lockdep inclusion and usage

    Signed-off-by: Sasha Levin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: a.p.zijlstra@chello.nl
    Cc: ben@decadent.org.uk
    Link: http://lkml.kernel.org/r/20170525130005.5947-13-alexander.levin@verizon.com
    Signed-off-by: Ingo Molnar

    Levin, Alexander (Sasha Levin)
     
  • Mixing fd-based and stream-base IO results in interleaved output like
    following:

    =====================================
    liblockdep 4.7.6
    -------------------------------------
    conopal/372 is trying to release lock (0x3a45c) at:
    /lib/libpt.so.2.17-alpha2(_ZN11PTimedMutex6SignalEv+0x3c) [0xb613c688]
    but there are no more locks to release!
    other info that might help us debug this:
    no locks held by conopal/372.
    stack backtrace:
    =====================================
    liblockdep 4.7.6
    ---------------------------------/usr/lib/liblockdep.so.4.7.6(+0x1e3c)[0xb67c2e3c]
    /usr/lib/liblockdep.so.4.7.6(+0x5fe0)[0xb67c6fe0]
    /usr/lib/liblockdep.so.4.7.6(+0x6450)[0xb67c7450]
    /usr/lib/liblockdep.so.4.7.6(lock_release+0x5c)[0xb67c7c40]
    /usr/lib/liblockdep.so.4.7.6(pthread_mutex_unlock+0x38)[0xb67c91d4]
    /lib/libpt.so.2.17-alpha2(_ZN11PTimedMutex6SignalEv+0x3c)[0xb613c688]
    /lib/libpt.so.2.17-alpha2(_ZN10PContainer14AssignContentsERKS_+0xe4)[0xb6160730]
    /lib/libopal.so.3.17-alpha2(_ZN15OpalMediaFormat14AssignContentsERK10PContainer+0x90)[0xb6435edc]
    /lib/libopal.so.3.17-alpha2(_ZN15OpalMediaFormataSERK7PString+0x68)[0xb643b610]
    /lib/libopal.so.3.17-alpha2(_ZN15OpalMediaFormatC2EPKc+0x68)[0xb643b6cc]
    /lib/libopal.so.3.17-alpha2(_ZN11OpalWAVFile14AddMediaFormatERK15OpalMediaFormat+0x330)[0xb66b2224]
    /lib/libopal.so.3.17-alpha2(+0x2526f8)[0xb640c6f8]
    /lib/ld-linux-armhf.so.3(+0x102f0)[0xb6f852f0]
    /lib/ld-linux-armhf.so.3(+0x1044c)[0xb6f8544c]
    /lib/ld-linux-armhf.so.3(+0xac4)[0xb6f75ac4]
    /usr/lib/liblockdep.so.4.7.6(+0x1e3c)[0xb67c2e3c]
    /usr/lib/liblockdep.so.4.7.6(+0x5fe0)[0xb67c6fe0]
    /usr/lib/liblockdep.so.4.7.6(+0x6450)[0xb67c7450]
    /usr/lib/liblockdep.so.4.7.6(lock_release+0x5c)[0xb67c7c40]
    /usr/lib/liblockdep.so.4.7.6(pthread_mutex_unlock+0x38)[0xb67c91d4]
    /lib/libpt.so.2.17-alpha2(_ZN11PTimedMutex6SignalEv+0x3c)[0xb613c688]
    /lib/libopal.so.3.17-alpha2(_ZN15OpalMediaFormat14AssignContentsERK10PContainer+0x78)[0xb6435ec4]
    /lib/libopal.so.3.17-alpha2(_ZN15OpalMediaFormataSERK7PString+0x68)[0xb643b610]
    /lib/libopal.so.3.17-alpha2(_ZN15OpalMediaFormatC2EPKc+0x68)[0xb643b6cc]
    /lib/libopal.so.3.17-alpha2(_ZN11OpalWAVFile14AddMediaFormatERK15OpalMediaFormat+0x330)[0xb66b2224]
    /lib/libopal.so.3.17-alpha2(+0x2526f8)[0xb640c6f8]
    /lib/ld-linux-armhf.so.3(+0x102f0)[0xb6f852f0]
    /lib/ld-linux-armhf.so.3(+0x1044c)[0xb6f8544c]
    /lib/ld-linux-armhf.so.3(+0xac4)[0xb6f75ac4]

    Therefore change all bare printf(...) to dprintf(STDOUT_FILENO, ...) to
    sychronize with backtrace_symbols_fd().

    [ BUG: bad unlock balance detected! ]
    Signed-off-by: Alexander Sverdlin
    Signed-off-by: Sasha Levin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Sasha Levin
    Cc: Thomas Gleixner
    Cc: a.p.zijlstra@chello.nl
    Cc: ben@decadent.org.uk
    Link: http://lkml.kernel.org/r/20170525130005.5947-12-alexander.levin@verizon.com
    Signed-off-by: Ingo Molnar

    Alexander Sverdlin
     
  • With -lpthread option, the test for ABBA_2threads was
    failing, and test passed if it was removed.
    Since -pthread compiler option is sufficient for linking
    to pthread libraries, this patch removes -lpthread.

    Signed-off-by: Vishal Thanki
    Signed-off-by: Sasha Levin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: a.p.zijlstra@chello.nl
    Cc: ben@decadent.org.uk
    Link: http://lkml.kernel.org/r/20170525130005.5947-9-alexander.levin@verizon.com
    Signed-off-by: Ingo Molnar

    Vishal Thanki
     
  • We define init_utsname() as static but not inline, resulting
    in a warning for every source file that includes lockdep.h but
    doesn't call it.

    Since it is only used by lockdep.c, define it in there.

    Signed-off-by: Ben Hutchings
    Signed-off-by: Sasha Levin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: a.p.zijlstra@chello.nl
    Link: http://lkml.kernel.org/r/20170525130005.5947-8-alexander.levin@verizon.com
    Signed-off-by: Ingo Molnar

    Ben Hutchings
     
  • liblockdep defines trivial macros for working with interrupt flags, as
    interrupts are never disabled in userland. This results in warnings
    from gcc when -Wunused-but-set-variable is enabled, and it is enabled
    by -Wall. Fix this by evaluating the flags parameter and casting it to
    void.

    Signed-off-by: Ben Hutchings
    Signed-off-by: Sasha Levin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: a.p.zijlstra@chello.nl
    Link: http://lkml.kernel.org/r/20170525130005.5947-7-alexander.levin@verizon.com
    Signed-off-by: Ingo Molnar

    Ben Hutchings
     
  • liblockdep defines various macros that may expand to an expression
    with no effect, while the in-kernel definition does have an effect.
    This results in warnings from gcc when -Wunused-value is enabled, and
    is is enabled by -Wall. Fix this by introducing trivial functions,
    as function return values are generally allowed to be ignored.

    Signed-off-by: Ben Hutchings
    Signed-off-by: Sasha Levin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: a.p.zijlstra@chello.nl
    Link: http://lkml.kernel.org/r/20170525130005.5947-6-alexander.levin@verizon.com
    Signed-off-by: Ingo Molnar

    Ben Hutchings
     
  • Regressions in liblockdep may be missed because it doesn't enable
    warnings.

    Adding -Wall immediately introduces a lot of warnings, but those will
    be fixed by the following commits.

    Signed-off-by: Ben Hutchings
    Signed-off-by: Sasha Levin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: a.p.zijlstra@chello.nl
    Link: http://lkml.kernel.org/r/20170525130005.5947-5-alexander.levin@verizon.com
    Signed-off-by: Ingo Molnar

    Ben Hutchings
     
  • lockdep.c now uses ARRAY_SIZE().

    Signed-off-by: Ben Hutchings
    Signed-off-by: Sasha Levin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: a.p.zijlstra@chello.nl
    Fixes: 75dd602a5198 ("lockdep: Fix lock_chain::base size")
    Link: http://lkml.kernel.org/r/20170525130005.5947-4-alexander.levin@verizon.com
    Signed-off-by: Ingo Molnar

    Ben Hutchings
     
  • liblockdep has been broken since commit 75dd602a5198 ("lockdep: Fix
    lock_chain::base size"), as that adds a check that MAX_LOCK_DEPTH is
    within the range of lock_chain::depth and in liblockdep it is much
    too large.

    That should have resulted in a compiler error, but didn't because:

    - the check uses ARRAY_SIZE(), which isn't yet defined in liblockdep
    so is assumed to be an (undeclared) function
    - putting a function call inside a BUILD_BUG_ON() expression quietly
    turns it into some nonsense involving a variable-length array

    It did produce a compiler warning, but I didn't notice because
    liblockdep already produces too many warnings if -Wall is enabled
    (which I'll fix shortly).

    Even before that commit, which reduced lock_chain::depth from 8 bits
    to 6, MAX_LOCK_DEPTH was too large.

    Signed-off-by: Ben Hutchings
    Signed-off-by: Sasha Levin
    Cc: # for versions before 4.6, use a value of 255
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: a.p.zijlstra@chello.nl
    Link: http://lkml.kernel.org/r/20170525130005.5947-3-alexander.levin@verizon.com
    Signed-off-by: Ingo Molnar

    Ben Hutchings
     
  • __lock_pin_lock() now calls prandom_u32() which is not defined in
    liblockdep. __lock_pin_lock() and its caller lock_pin_lock() are dead
    code in liblockdep, but we still need to provide a definition of
    prandom_u32() in case lazy binding is disabled.

    Signed-off-by: Ben Hutchings
    Signed-off-by: Sasha Levin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: a.p.zijlstra@chello.nl
    Fixes: e7904a28f533 ("locking/lockdep, sched/core: Implement a better ...")
    Link: http://lkml.kernel.org/r/20170525130005.5947-2-alexander.levin@verizon.com
    Signed-off-by: Ingo Molnar

    Ben Hutchings
     

11 Dec, 2016

1 commit


30 Mar, 2016

1 commit

  • Here on Ubuntu/precise I have GNU/coreutils v8.13 installed
    where 'basename -s' is not supported.

    The result is that run_tests.sh is not done properly.

    How to reproduce:

    $ cd $BUILD_DIR
    $ LC_ALL=C make -C tools/ liblockdep
    $ 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

    Due to unsupported basename the tests programs are not generated
    and cannot be removed.

    Fix this by doing a compatible basename invocation and check for
    the existence of generated tests programs.

    For more details see this LKML thread:

    http://marc.info/?t=145906667300001&r=1&w=2

    Signed-off-by: Sedat Dilek
    Cc: Boqun Feng
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Sasha Levin (maintainer:LIBLOCKDEP)
    Cc: Shuah Khan
    Cc: Theodore Ts'o
    Cc: Thomas Gleixner
    Cc: linux-fsdevel
    Link: http://lkml.kernel.org/r/1459326169-7009-1-git-send-email-sedat.dilek@gmail.com
    Signed-off-by: Ingo Molnar

    Sedat Dilek
     

29 Feb, 2016

4 commits

  • This warning triggers if the .so library has already been linked:

    triton:~/tip/tools/lib/lockdep> make
    CC common.o
    CC lockdep.o
    CC rbtree.o
    LD liblockdep-in.o
    LD liblockdep.a
    ln: failed to create symbolic link ‘liblockdep.so’: File exists
    LD liblockdep.so.4.5.0-rc6

    Overwrite the link.

    Cc: Alfredo Alvarez Fernandez
    Cc: Andrew Morton
    Cc: Linus Torvalds
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Sasha Levin
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Add test for AA and 2 threaded ABBA locking.

    Rename AA.c to ABA.c since it was implementing an ABA instead of a pure
    AA. Now both cases are covered.

    The expected output for AA.c is that the process blocks and lockdep
    reports a deadlock.

    ABBA_2threads.c differs from ABBA.c in that lockdep keeps separate chains
    of held locks per task. This can lead to different behaviour regarding
    lock detection. The expected output for this test is that the process
    blocks and lockdep reports a circular locking dependency.

    These tests found a lockdep bug - fixed by the next commit.

    Signed-off-by: Alfredo Alvarez Fernandez
    Cc: Andrew Morton
    Cc: Linus Torvalds
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Sasha Levin
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1455864533-7536-3-git-send-email-alfredoalvarezernandez@gmail.com
    Signed-off-by: Ingo Molnar

    Alfredo Alvarez Fernandez
     
  • This was added to the kernel code in ("list: Use
    READ_ONCE() when testing for empty lists").

    There's nothing special we need to do about it in userspace.

    Signed-off-by: Alfredo Alvarez Fernandez
    Cc: Andrew Morton
    Cc: Linus Torvalds
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Sasha Levin
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1455864533-7536-2-git-send-email-alfredoalvarezernandez@gmail.com
    Signed-off-by: Ingo Molnar

    Alfredo Alvarez Fernandez
     
  • The following upstream commit:

    4a389810bc3c ("kernel/locking/lockdep.c: convert hash tables to hlists")

    broke the tools/lib/lockdep build. Add trivial RCU wrappers to fix it.

    These wrappers should probably be moved into their own header file.

    Cc: Andrew Morton
    Cc: Andrey Ryabinin
    Cc: Linus Torvalds
    Cc: Mike Krinkin
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Sasha Levin
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

09 Feb, 2016

1 commit

  • Lockdep is initialized at compile time now. Get rid of lockdep_init().

    Signed-off-by: Andrey Ryabinin
    Signed-off-by: Andrew Morton
    Cc: Linus Torvalds
    Cc: Mike Krinkin
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    Cc: mm-commits@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Andrey Ryabinin
     

11 Jan, 2016

1 commit

  • Add *.cmd files to be removed within clean target.

    Reported-by: Arnaldo Carvalho de Melo
    Signed-off-by: Jiri Olsa
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/1452509693-13452-4-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

09 Nov, 2015

1 commit


07 Nov, 2015

3 commits


29 Sep, 2015

2 commits

  • Adding the fixdep target into the Makefile.include to ease up building of
    fixdep helper, that needs to be built before we dive in to the build itself.
    The user can invoke the fixdep target to build the helper.

    Signed-off-by: Jiri Olsa
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1443004442-32660-8-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • To ease up build framework code setup for users.

    More shared code will be added in the following patches.

    Signed-off-by: Jiri Olsa
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1443004442-32660-2-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

25 Aug, 2015

2 commits

  • Recent changes to rbtree.h may break compilation. There is no
    reason to use a liblockdep specific header to begin with, so
    we'll use the one shared with all other tools/.

    Signed-off-by: Sasha Levin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1440479985-6696-3-git-send-email-sasha.levin@oracle.com
    Signed-off-by: Ingo Molnar

    Sasha Levin
     
  • As Peter Zijlstra pointed out, the varargs for WARN() are
    optional, so we need to correctly handle the case where they
    don't exist.

    This would cause a compilation error.

    Signed-off-by: Sasha Levin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1440479985-6696-2-git-send-email-sasha.levin@oracle.com
    Signed-off-by: Ingo Molnar

    Sasha Levin
     

13 May, 2015

2 commits


26 Feb, 2015

1 commit


13 Feb, 2015

1 commit

  • Move the lockdep library building under tools build framework.

    Signed-off-by: Jiri Olsa
    Cc: Alexis Berlemont
    Cc: Borislav Petkov
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: S. Lockwood-Childs
    Cc: Sasha Levin
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-i0t25buqyo5jfvzpw2347h1h@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

30 Jan, 2015

1 commit