lkml.org 
[lkml]   [2009]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: irq lock inversion
    Hello, Jiri.

    Jiri Kosina wrote:
    > Hmm, I wonder why I don't see this lockdep warning myself with
    > head on 1836d9592, even though I have
    >
    > CONFIG_PROVE_LOCKING=y
    > CONFIG_TRACE_IRQFLAGS=y
    >
    > ... ?

    You need pcpu_mem_free() hit vfree() to trigger the warning by
    allocating a lot of small percpu areas so that allocation map inside a
    chunk becomes larger than 4k and then get extended once more.

    > Anyway, how about something like this? (I can't verify myself that it even
    > fixes the warning, as I don't see it for some odd reason)
    >
    > From: Jiri Kosina <jkosina@suse.cz>
    > Subject: lockdep: avoid false positives about irq-safety
    >
    > Commit 403a91b1 ("percpu: allow pcpu_alloc() to be called
    > with IRQs off") introduced this warning:
    >
    > =========================================================
    > [ INFO: possible irq lock inversion dependency detected ]
    > 2.6.32-rc5-tip-04815-g12f0f93-dirty #745
    > ---------------------------------------------------------
    > hub 1-3:1.0: state 7 ports 2 chg 0000 evt 0004
    > ksoftirqd/65/199 just changed the state of lock:
    > (pcpu_lock){..-...}, at: [<ffffffff81130e04>] free_percpu+0x38/0x104
    > but this lock took another, SOFTIRQ-unsafe lock in the past:
    > (vmap_area_lock){+.+...}
    >
    > and interrupts could create inverse lock ordering between them.
    >
    > This warning is bogus -- sched_init() is being called very early with IRQs
    > disabled, and the irqsave/restore code paths in pcpu_alloc() are only for early
    > init. The path can never be called from irq context once the early init
    > finishes. Rationale for this is explained in changelog of the commit mentioned
    > above.
    >
    > This problem can be encountered generally in any other early code running
    > with IRQs off and using irqsave/irqrestore.
    >
    > Reported-by: Yinghai Lu <yhlu.kernel@gmail.com>
    > Signed-off-by: Jiri Kosina <jkosina@suse.cz>

    Looks good to me. Ingo, what do you think?

    Thanks.

    --
    tejun


    \
     
     \ /
      Last update: 2009-11-06 06:57    [W:0.033 / U:31.208 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site