06 Nov, 2013

1 commit

  • Currently seqlocks and seqcounts don't support lockdep.

    After running across a seqcount related deadlock in the timekeeping
    code, I used a less-refined and more focused variant of this patch
    to narrow down the cause of the issue.

    This is a first-pass attempt to properly enable lockdep functionality
    on seqlocks and seqcounts.

    Since seqcounts are used in the vdso gettimeofday code, I've provided
    non-lockdep accessors for those needs.

    I've also handled one case where there were nested seqlock writers
    and there may be more edge cases.

    Comments and feedback would be appreciated!

    Signed-off-by: John Stultz
    Signed-off-by: Peter Zijlstra
    Cc: Eric Dumazet
    Cc: Li Zefan
    Cc: Mathieu Desnoyers
    Cc: Steven Rostedt
    Cc: "David S. Miller"
    Cc: netdev@vger.kernel.org
    Link: http://lkml.kernel.org/r/1381186321-4906-3-git-send-email-john.stultz@linaro.org
    Signed-off-by: Ingo Molnar

    John Stultz
     

12 Jul, 2013

1 commit

  • In lockdep.h, the spinlock/mutex/rwsem/rwlock/lock_map acquire macros have
    different definitions based on the value of CONFIG_PROVE_LOCKING. We have
    separate ifdefs for each of these definitions, which seems redundant.

    Introduce lock_acquire_{exclusive,shared,shared_recursive} helpers which
    will have different definitions based on CONFIG_PROVE_LOCKING. Then all
    other helper macros can be defined based on the above ones, which reduces
    the amount of ifdefined code.

    Signed-off-by: Michel Lespinasse
    Signed-off-by: Andrew Morton
    Signed-off-by: Peter Zijlstra
    Cc: Oleg Nesterov
    Cc: Lai Jiangshan
    Cc: "Srivatsa S. Bhat"
    Cc: Rusty Russell
    Cc: Andi Kleen
    Cc: "Paul E. McKenney"
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/20130708212350.6DD1931C15E@corp2gmr1-1.hot.corp.google.com
    Signed-off-by: Ingo Molnar

    Michel Lespinasse
     

23 Feb, 2013

1 commit

  • Pull core locking changes from Ingo Molnar:
    "The biggest change is the rwsem lock-steal improvements, both to the
    assembly optimized and the spinlock based variants.

    The other notable change is the clean up of the seqlock implementation
    to be based on the seqcount infrastructure.

    The rest is assorted smaller debuggability, cleanup and continued -rt
    locking changes."

    * 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    rwsem-spinlock: Implement writer lock-stealing for better scalability
    futex: Revert "futex: Mark get_robust_list as deprecated"
    generic: Use raw local irq variant for generic cmpxchg
    lockdep: Selftest: convert spinlock to raw spinlock
    seqlock: Use seqcount infrastructure
    seqlock: Remove unused functions
    ntp: Make ntp_lock raw
    intel_idle: Convert i7300_idle_lock to raw_spinlock
    locking: Various static lock initializer fixes
    lockdep: Print more info when MAX_LOCK_DEPTH is exceeded
    rwsem: Implement writer lock-stealing for better scalability
    lockdep: Silence warning if CONFIG_LOCKDEP isn't set
    watchdog: Use local_clock for get_timestamp()
    lockdep: Rename print_unlock_inbalance_bug() to print_unlock_imbalance_bug()
    locking/stat: Fix a typo

    Linus Torvalds
     

22 Feb, 2013

1 commit

  • I recently made the mistake of writing:

    foo = lockdep_dereference_protected(..., lockdep_assert_held(...));

    which is clearly bogus. If lockdep is disabled in the config this would
    cause a compile failure, if it is enabled then it compiles and causes a
    puzzling warning about dereferencing without the correct protection.

    Wrap the macro in "do { ... } while (0)" to also fail compile for this
    when lockdep is enabled.

    Signed-off-by: Johannes Berg
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Berg
     

19 Feb, 2013

1 commit

  • Since commit c9a4962881929df7f1ef6e63e1b9da304faca4dd ("nfsd:
    make client_lock per net") compiling nfs4state.o without
    CONFIG_LOCKDEP set, triggers this GCC warning:

    fs/nfsd/nfs4state.c: In function ‘free_client’:
    fs/nfsd/nfs4state.c:1051:19: warning: unused variable ‘nn’ [-Wunused-variable]

    The cause of that warning is that lockdep_assert_held() compiles
    away if CONFIG_LOCKDEP is not set. Silence this warning by using
    the argument to lockdep_assert_held() as a nop if CONFIG_LOCKDEP
    is not set.

    Signed-off-by: Paul Bolle
    Cc: Peter Zijlstra
    Cc: Stanislav Kinsbursky
    Cc: J. Bruce Fields
    Link: http://lkml.kernel.org/r/1359060797.1325.33.camel@x61.thuisdomein
    Signed-off-by: Ingo Molnar
    --
    include/linux/lockdep.h | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    Paul Bolle
     

12 Jan, 2013

1 commit

  • down_write_nest_lock() provides a means to annotate locking scenario
    where an outer lock is guaranteed to serialize the order nested locks
    are being acquired.

    This is analogoue to already existing mutex_lock_nest_lock() and
    spin_lock_nest_lock().

    Signed-off-by: Jiri Kosina
    Cc: Rik van Riel
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Mel Gorman
    Tested-by: Sedat Dilek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Kosina
     

15 May, 2012

1 commit

  • Under memory load, on x86_64, with lockdep enabled, the workqueue's
    process_one_work() has been seen to oops in __lock_acquire(), barfing
    on a 0xffffffff00000000 pointer in the lockdep_map's class_cache[].

    Because it's permissible to free a work_struct from its callout function,
    the map used is an onstack copy of the map given in the work_struct: and
    that copy is made without any locking.

    Surprisingly, gcc (4.5.1 in Hugh's case) uses "rep movsl" rather than
    "rep movsq" for that structure copy: which might race with a workqueue
    user's wait_on_work() doing lock_map_acquire() on the source of the
    copy, putting a pointer into the class_cache[], but only in time for
    the top half of that pointer to be copied to the destination map.

    Boom when process_one_work() subsequently does lock_map_acquire()
    on its onstack copy of the lockdep_map.

    Fix this, and a similar instance in call_timer_fn(), with a
    lockdep_copy_map() function which additionally NULLs the class_cache[].

    Note: this oops was actually seen on 3.4-next, where flush_work() newly
    does the racing lock_map_acquire(); but Tejun points out that 3.4 and
    earlier are already vulnerable to the same through wait_on_work().

    * Patch orginally from Peter. Hugh modified it a bit and wrote the
    description.

    Signed-off-by: Peter Zijlstra
    Reported-by: Hugh Dickins
    LKML-Reference:
    Signed-off-by: Tejun Heo

    Peter Zijlstra
     

14 Nov, 2011

1 commit

  • zap_locks() is used by printk() in a last ditch effort to get data
    out, clearly we cannot trust lock state after this so make it disable
    lock debugging.

    Also don't treat printk recursion through lockdep as a normal
    recursion bug but try hard to get the lockdep splat out.

    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/n/tip-kqxwmo4xz37e1s8w0xopvr0q@git.kernel.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

29 Sep, 2011

1 commit

  • Long ago, using TREE_RCU with PREEMPT would result in "scheduling
    while atomic" diagnostics if you blocked in an RCU read-side critical
    section. However, PREEMPT now implies TREE_PREEMPT_RCU, which defeats
    this diagnostic. This commit therefore adds a replacement diagnostic
    based on PROVE_RCU.

    Because rcu_lockdep_assert() and lockdep_rcu_dereference() are now being
    used for things that have nothing to do with rcu_dereference(), rename
    lockdep_rcu_dereference() to lockdep_rcu_suspicious() and add a third
    argument that is a string indicating what is suspicious. This third
    argument is passed in from a new third argument to rcu_lockdep_assert().
    Update all calls to rcu_lockdep_assert() to add an informative third
    argument.

    Also, add a pair of rcu_lockdep_assert() calls from within
    rcu_note_context_switch(), one complaining if a context switch occurs
    in an RCU-bh read-side critical section and another complaining if a
    context switch occurs in an RCU-sched read-side critical section.
    These are present only if the PROVE_RCU kernel parameter is enabled.

    Finally, fix some checkpatch whitespace complaints in lockdep.c.

    Again, you must enable PROVE_RCU to see these new diagnostics. But you
    are enabling PROVE_RCU to check out new RCU uses in any case, aren't you?

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     

25 May, 2011

1 commit

  • In order to convert i_mmap_lock to a mutex we need a mutex equivalent to
    spin_lock_nest_lock(), thus provide the mutex_lock_nest_lock() annotation.

    As with spin_lock_nest_lock(), mutex_lock_nest_lock() allows annotation of
    the locking pattern where an outer lock serializes the acquisition order
    of nested locks. That is, if every time you lock multiple locks A, say A1
    and A2 you first acquire N, the order of acquiring A1 and A2 is
    irrelevant.

    Signed-off-by: Peter Zijlstra
    Cc: Benjamin Herrenschmidt
    Cc: David Miller
    Cc: Martin Schwidefsky
    Cc: Russell King
    Cc: Paul Mundt
    Cc: Jeff Dike
    Cc: Richard Weinberger
    Cc: Tony Luck
    Cc: KAMEZAWA Hiroyuki
    Cc: Hugh Dickins
    Cc: Mel Gorman
    Cc: KOSAKI Motohiro
    Cc: Nick Piggin
    Cc: Namhyung Kim
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Zijlstra
     

22 Jan, 2011

1 commit


20 Jan, 2011

1 commit

  • During early boot, local IRQ is disabled until IRQ subsystem is
    properly initialized. During this time, no one should enable
    local IRQ and some operations which usually are not allowed with
    IRQ disabled, e.g. operations which might sleep or require
    communications with other processors, are allowed.

    lockdep tracked this with early_boot_irqs_off/on() callbacks.
    As other subsystems need this information too, move it to
    init/main.c and make it generally available. While at it,
    toggle the boolean to early_boot_irqs_disabled instead of
    enabled so that it can be initialized with %false and %true
    indicates the exceptional condition.

    Signed-off-by: Tejun Heo
    Acked-by: Peter Zijlstra
    Acked-by: Pekka Enberg
    Cc: Linus Torvalds
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Tejun Heo
     

11 Jan, 2011

1 commit

  • Currently, the lockdep annotation in flush_work() requires exclusive
    access on the workqueue the target work is queued on and triggers
    warning if a work is trying to flush another work on the same
    workqueue; however, this is no longer true as workqueues can now
    execute multiple works concurrently.

    This patch adds lock_map_acquire_read() and make process_one_work()
    hold read access to the workqueue while executing a work and
    start_flush_work() check for write access if concurrnecy level is one
    or the workqueue has a rescuer (as only one execution resource - the
    rescuer - is guaranteed to be available under memory pressure), and
    read access if higher.

    This better represents what's going on and removes spurious lockdep
    warnings which are triggered by fake dependency chain created through
    flush_work().

    * Peter pointed out that flushing another work from a WQ_MEM_RECLAIM
    wq breaks forward progress guarantee under memory pressure.
    Condition check accordingly updated.

    Signed-off-by: Tejun Heo
    Reported-by: "Rafael J. Wysocki"
    Tested-by: "Rafael J. Wysocki"
    Cc: Peter Zijlstra
    Cc: stable@kernel.org

    Tejun Heo
     

22 Oct, 2010

1 commit

  • * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (96 commits)
    apic, x86: Use BIOS settings for IBS and MCE threshold interrupt LVT offsets
    apic, x86: Check if EILVT APIC registers are available (AMD only)
    x86: ioapic: Call free_irte only if interrupt remapping enabled
    arm: Use ARCH_IRQ_INIT_FLAGS
    genirq, ARM: Fix boot on ARM platforms
    genirq: Fix CONFIG_GENIRQ_NO_DEPRECATED=y build
    x86: Switch sparse_irq allocations to GFP_KERNEL
    genirq: Switch sparse_irq allocator to GFP_KERNEL
    genirq: Make sparse_lock a mutex
    x86: lguest: Use new irq allocator
    genirq: Remove the now unused sparse irq leftovers
    genirq: Sanitize dynamic irq handling
    genirq: Remove arch_init_chip_data()
    x86: xen: Sanitise sparse_irq handling
    x86: Use sane enumeration
    x86: uv: Clean up the direct access to irq_desc
    x86: Make io_apic.c local functions static
    genirq: Remove irq_2_iommu
    x86: Speed up the irq_remapped check in hot pathes
    intr_remap: Simplify the code further
    ...

    Fix up trivial conflicts in arch/x86/Kconfig

    Linus Torvalds
     

19 Oct, 2010

1 commit

  • Current lockdep_map only caches one class with subclass == 0,
    and looks up hash table of classes when subclass != 0.

    It seems that this has no problem because the case of
    subclass != 0 is rare. But locks of struct rq are
    acquired with subclass == 1 when task migration is executed.
    Task migration is high frequent event, so I modified lockdep
    to cache subclasses.

    I measured the score of perf bench sched messaging.
    This patch has slightly but certain (order of milli seconds
    or 10 milli seconds) effect when lots of tasks are running.
    I'll show the result in the tail of this description.

    NR_LOCKDEP_CACHING_CLASSES specifies how many classes can be
    cached in the instances of lockdep_map.
    I discussed with Peter Zijlstra in LinuxCon Japan about
    this approach and he taught me that caching every subclasses(8)
    is cleary waste of memory. So number of cached classes
    should be configurable.

    === Score comparison of benchmarks ===
    # "min" means best score, and "max" means worst score

    for i in `seq 1 10`; do ./perf bench -f simple sched messaging; done

    before: min: 0.565000, max: 0.583000, avg: 0.572500
    after: min: 0.559000, max: 0.568000, avg: 0.563300

    # with more processes
    for i in `seq 1 10`; do ./perf bench -f simple sched messaging -g 40; done

    before: min: 2.274000, max: 2.298000, avg: 2.286300
    after: min: 2.242000, max: 2.270000, avg: 2.259700

    Signed-off-by: Hitoshi Mitake
    Cc: Frederic Weisbecker
    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Hitoshi Mitake
     

12 Oct, 2010

1 commit

  • early_init_irq_lock_class() is called way before anything touches the
    irq descriptors. In case of SPARSE_IRQ=y this is a NOP operation
    because the radix tree is empty at this point. For the SPARSE_IRQ=n
    case it's sufficient to set the lock class in early_init_irq().

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Ingo Molnar

    Thomas Gleixner
     

22 May, 2010

1 commit

  • The conversion of device->sem to device->mutex resulted in lockdep
    warnings. Create a novalidate class for now until the driver folks
    come up with separate classes. That way we have at least the basic
    mutex debugging coverage.

    Add a checkpatch error so the usage is reserved for device->mutex.

    [ tglx: checkpatch and compile fix for LOCKDEP=n ]

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Peter Zijlstra
     

13 Mar, 2010

1 commit

  • Extern declarations in sysctl.c should be moved to their own header file,
    and then include them in relavant .c files.

    Move lockdep extern declarations to linux/lockdep.h

    Signed-off-by: Dave Young
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Young
     

25 Feb, 2010

1 commit

  • Make rcu_dereference_check() print the list of held locks in
    addition to the stack dump to ease debugging.

    Signed-off-by: Paul E. McKenney
    Cc: laijs@cn.fujitsu.com
    Cc: dipankar@in.ibm.com
    Cc: mathieu.desnoyers@polymtl.ca
    Cc: josh@joshtriplett.org
    Cc: dvhltc@us.ibm.com
    Cc: niv@us.ibm.com
    Cc: peterz@infradead.org
    Cc: rostedt@goodmis.org
    Cc: Valdis.Kletnieks@vt.edu
    Cc: dhowells@redhat.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Paul E. McKenney
     

02 Aug, 2009

3 commits

  • We still can apply DaveM's generation count optimization to
    BFS, based on the following idea:

    - before doing each BFS, increase the global generation id
    by 1

    - if one node in the graph has been visited, mark it as
    visited by storing the current global generation id into
    the node's dep_gen_id field

    - so we can decide if one node has been visited already, by
    comparing the node's dep_gen_id with the global generation id.

    By applying DaveM's generation count optimization to current
    implementation of BFS, we gain the following advantages:

    - we save MAX_LOCKDEP_ENTRIES/8 bytes memory;

    - we remove the bitmap_zero(bfs_accessed, MAX_LOCKDEP_ENTRIES);
    in each BFS, which is very time-consuming since
    MAX_LOCKDEP_ENTRIES may be very large.(16384UL)

    Signed-off-by: Ming Lei
    Signed-off-by: Peter Zijlstra
    Cc: "David S. Miller"
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Ming Lei
     
  • spin_lock_nest_lock() allows to take many instances of the same
    class, this can easily lead to overflow of MAX_LOCK_DEPTH.

    To avoid this overflow, we'll stop accounting instances but
    start reference counting the class in the held_lock structure.

    [ We could maintain a list of instances, if we'd move the hlock
    stuff into __lock_acquired(), but that would require
    significant modifications to the current code. ]

    We restrict this mode to spin_lock_nest_lock() only, because it
    degrades the lockdep quality due to lost of instance.

    For lockstat this means we don't track lock statistics for any
    but the first lock in the series.

    Currently nesting is limited to 11 bits because that was the
    spare space available in held_lock. This yields a 2048
    instances maximium.

    Signed-off-by: Peter Zijlstra
    Cc: Marcelo Tosatti
    Cc: Linus Torvalds
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Add a lockdep helper to validate that we indeed are the owner
    of a lock.

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

24 Jul, 2009

2 commits

  • Some cleanups of the lockdep code after the BFS series:

    - Remove the last traces of the generation id
    - Fixup comment style
    - Move the bfs routines into lockdep.c
    - Cleanup the bfs routines

    [ tom.leiming@gmail.com: Fix crash ]
    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Currently lockdep will print the 1st circle detected if it
    exists when acquiring a new (next) lock.

    This patch prints the shortest path from the next lock to be
    acquired to the previous held lock if a circle is found.

    The patch still uses the current method to check circle, and
    once the circle is found, breadth-first search algorithem is
    used to compute the shortest path from the next lock to the
    previous lock in the forward lock dependency graph.

    Printing the shortest path will shorten the dependency chain,
    and make troubleshooting for possible circular locking easier.

    Signed-off-by: Ming Lei
    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Ming Lei
     

23 Jun, 2009

1 commit

  • Some filesystems need to set lockdep map for i_mutex differently for
    different directories. For example OCFS2 has system directories (for
    orphan inode tracking and for gathering all system files like journal
    or quota files into a single place) which have different locking
    locking rules than standard directories. For a filesystem setting
    lockdep map is naturaly done when the inode is read but we have to
    modify unlock_new_inode() not to overwrite the lockdep map the filesystem
    has set.

    Acked-by: peterz@infradead.org
    CC: mingo@redhat.com
    Signed-off-by: Jan Kara
    Signed-off-by: Joel Becker

    Jan Kara
     

03 Apr, 2009

1 commit

  • SGI has observed that on large systems, interrupts are not serviced for a
    long period of time when waiting for a rwlock. The following patch series
    re-enables irqs while waiting for the lock, resembling the code which is
    already there for spinlocks.

    I only made the ia64 version, because the patch adds some overhead to the
    fast path. I assume there is currently no demand to have this for other
    architectures, because the systems are not so large. Of course, the
    possibility to implement raw_{read|write}_lock_flags for any architecture
    is still there.

    This patch:

    The new macro LOCK_CONTENDED_FLAGS expands to the correct implementation
    depending on the config options, so that IRQ's are re-enabled when
    possible, but they remain disabled if CONFIG_LOCKDEP is set.

    Signed-off-by: Petr Tesarik
    Signed-off-by: Robin Holt
    Cc:
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: "Luck, Tony"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robin Holt
     

15 Feb, 2009

4 commits

  • For convenience later.

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • s/HELD_OVER/ENABLED/g

    so that its similar to the hard and soft-irq names.

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • s/\(LOCKF\?_ENABLED_[^ ]*\)S\(_READ\)\?\>/\1\2/g

    So that the USED_IN and ENABLED have the same names.

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Here is another version, with the incremental patch rolled up, and
    added reclaim context annotation to kswapd, and allocation tracing
    to slab allocators (which may only ever reach the page allocator
    in rare cases, so it is good to put annotations here too).

    Haven't tested this version as such, but it should be getting closer
    to merge worthy ;)

    --
    After noticing some code in mm/filemap.c accidentally perform a __GFP_FS
    allocation when it should not have been, I thought it might be a good idea to
    try to catch this kind of thing with lockdep.

    I coded up a little idea that seems to work. Unfortunately the system has to
    actually be in __GFP_FS page reclaim, then take the lock, before it will mark
    it. But at least that might still be some orders of magnitude more common
    (and more debuggable) than an actual deadlock condition, so we have some
    improvement I hope (the concept is no less complete than discovery of a lock's
    interrupt contexts).

    I guess we could even do the same thing with __GFP_IO (normal reclaim), and
    even GFP_NOIO locks too... but filesystems will have the most locks and fiddly
    code paths, so let's start there and see how it goes.

    It *seems* to work. I did a quick test.

    =================================
    [ INFO: inconsistent lock state ]
    2.6.28-rc6-00007-ged31348-dirty #26
    ---------------------------------
    inconsistent {in-reclaim-W} -> {ov-reclaim-W} usage.
    modprobe/8526 [HC0[0]:SC0[0]:HE1:SE1] takes:
    (testlock){--..}, at: [] brd_init+0x55/0x216 [brd]
    {in-reclaim-W} state was registered at:
    [] __lock_acquire+0x75b/0x1a60
    [] lock_acquire+0x91/0xc0
    [] mutex_lock_nested+0xb1/0x310
    [] brd_init+0x2b/0x216 [brd]
    [] _stext+0x3b/0x170
    [] sys_init_module+0xaf/0x1e0
    [] system_call_fastpath+0x16/0x1b
    [] 0xffffffffffffffff
    irq event stamp: 3929
    hardirqs last enabled at (3929): [] mutex_lock_nested+0x285/0x310
    hardirqs last disabled at (3928): [] mutex_lock_nested+0x59/0x310
    softirqs last enabled at (3732): [] sk_filter+0x83/0xe0
    softirqs last disabled at (3730): [] sk_filter+0x16/0xe0

    other info that might help us debug this:
    1 lock held by modprobe/8526:
    #0: (testlock){--..}, at: [] brd_init+0x55/0x216 [brd]

    stack backtrace:
    Pid: 8526, comm: modprobe Not tainted 2.6.28-rc6-00007-ged31348-dirty #26
    Call Trace:
    [] print_usage_bug+0x193/0x1d0
    [] mark_lock+0xaf0/0xca0
    [] mark_held_locks+0x55/0xc0
    [] ? brd_init+0x0/0x216 [brd]
    [] trace_reclaim_fs+0x2a/0x60
    [] __alloc_pages_internal+0x475/0x580
    [] ? mutex_lock_nested+0x26e/0x310
    [] ? brd_init+0x0/0x216 [brd]
    [] brd_init+0x6a/0x216 [brd]
    [] ? brd_init+0x0/0x216 [brd]
    [] _stext+0x3b/0x170
    [] ? mutex_unlock+0x9/0x10
    [] ? __mutex_unlock_slowpath+0x10d/0x180
    [] ? trace_hardirqs_on_caller+0x12c/0x190
    [] sys_init_module+0xaf/0x1e0
    [] system_call_fastpath+0x16/0x1b

    Signed-off-by: Nick Piggin
    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Nick Piggin
     

31 Dec, 2008

1 commit

  • * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86, sparseirq: clean up Kconfig entry
    x86: turn CONFIG_SPARSE_IRQ off by default
    sparseirq: fix numa_migrate_irq_desc dependency and comments
    sparseirq: add kernel-doc notation for new member in irq_desc, -v2
    locking, irq: enclose irq_desc_lock_class in CONFIG_LOCKDEP
    sparseirq, xen: make sure irq_desc is allocated for interrupts
    sparseirq: fix !SMP building, #2
    x86, sparseirq: move irq_desc according to smp_affinity, v7
    proc: enclose desc variable of show_stat() in CONFIG_SPARSE_IRQ
    sparse irqs: add irqnr.h to the user headers list
    sparse irqs: handle !GENIRQ platforms
    sparseirq: fix !SMP && !PCI_MSI && !HT_IRQ build
    sparseirq: fix Alpha build failure
    sparseirq: fix typo in !CONFIG_IO_APIC case
    x86, MSI: pass irq_cfg and irq_desc
    x86: MSI start irq numbering from nr_irqs_gsi
    x86: use NR_IRQS_LEGACY
    sparse irq_desc[] array: core kernel and x86 changes
    genirq: record IRQ_LEVEL in irq_desc[]
    irq.h: remove padding from irq_desc on 64bits

    Linus Torvalds
     

18 Dec, 2008

1 commit

  • Impact: simplify code

    commit "08678b0: generic: sparse irqs: use irq_desc() [...]" introduced
    the irq_desc_lock_class variable.

    But it is used only if CONFIG_SPARSE_IRQ=Y or CONFIG_TRACE_IRQFLAGS=Y.
    Otherwise, following warnings happen:

    CC kernel/irq/handle.o
    kernel/irq/handle.c:26: warning: 'irq_desc_lock_class' defined but not used

    Actually, current early_init_irq_lock_class has a bit strange and messy ifdef.
    In addition, it is not valueable.

    1. this function is protected by !CONFIG_SPARSE_IRQ, but that is not necessary.
    if CONFIG_SPARSE_IRQ=Y, desc of all irq number are initialized by NULL
    at first - then this function calling is safe.

    2. this function protected by CONFIG_TRACE_IRQFLAGS too. but it is not
    necessary either, because lockdep_set_class() doesn't have bad side
    effect even if CONFIG_TRACE_IRQFLAGS=n.

    This patch bloat kernel size a bit on CONFIG_TRACE_IRQFLAGS=n and
    CONFIG_SPARSE_IRQ=Y - but that's ok. early_init_irq_lock_class() is not
    a fastpatch at all.

    To avoid messy ifdefs is more important than a few bytes diet.

    Signed-off-by: KOSAKI Motohiro
    Signed-off-by: Ingo Molnar

    KOSAKI Motohiro
     

04 Dec, 2008

1 commit

  • Impact: introduce new lockdep API

    Allow to change a held lock's class. Basically the same as the existing
    code to change a subclass therefore reuse all that.

    The XFS code will be able to use this to annotate their inode locking.

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

14 Nov, 2008

1 commit

  • fix this warning:

    net/bluetooth/af_bluetooth.c:60: warning: ‘bt_key_strings’ defined but not used
    net/bluetooth/af_bluetooth.c:71: warning: ‘bt_slock_key_strings’ defined but not used

    this is a lockdep macro problem in the !LOCKDEP case.

    We cannot convert it to an inline because the macro works on multiple types,
    but we can mark the parameter used.

    [ also clean up a misaligned tab in sock_lock_init_class_and_name() ]

    [ also remove #ifdefs from around af_family_clock_key strings - which
    were certainly added to get rid of the ugly build warnings. ]

    Signed-off-by: Ingo Molnar
    Signed-off-by: David S. Miller

    Ingo Molnar
     

12 Nov, 2008

1 commit

  • fix this warning:

    net/bluetooth/af_bluetooth.c:60: warning: ‘bt_key_strings’ defined but not used
    net/bluetooth/af_bluetooth.c:71: warning: ‘bt_slock_key_strings’ defined but not used

    this is a lockdep macro problem in the !LOCKDEP case.

    We cannot convert it to an inline because the macro works on multiple types,
    but we can mark the parameter used.

    [ also clean up a misaligned tab in sock_lock_init_class_and_name() ]

    [ also remove #ifdefs from around af_family_clock_key strings - which
    were certainly added to get rid of the ugly build warnings. ]

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

20 Oct, 2008

1 commit


10 Sep, 2008

1 commit


11 Aug, 2008

3 commits