18 Nov, 2010

1 commit

  • Arnd Bergmann did an automated scripting run to find left-over instances
    of , and had made it trigger it on the normal BKL use
    of lock_kernel and unlock_lernel (and apparently release_kernel_lock and
    reacquire_kernel_lock too, used by the scheduler).

    That resulted in commit 451a3c24b013 ("BKL: remove extraneous #include
    ").

    However, hardirq.h was the only remaining user of the old
    'kernel_locked()' interface, and Arnd's script hadn't checked for that.
    So depending on your configuration and what header files had been
    included, you would get errors like "implicit declaration of function
    'kernel_locked'" during the build.

    The right fix is not to just re-instate the smp_lock.h include - it is
    to just remove 'kernel_locked()' entirely, since the only use was this
    one special low-level detail. Just make hardirq.h do it directly.

    In fact this simplifies and clarifies the code, because some trivial
    analysis makes it clear that hardirq.h only ever used _one_ of the two
    definitions of kernel_locked(), so we can remove the other one entirely.

    Reported-by: Zimny Lech
    Reported-and-acked-by: Randy Dunlap
    Acked-by: Arnd Bergmann
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

21 Oct, 2010

1 commit

  • With all the patches we have queued in the BKL removal tree, only a
    few dozen modules are left that actually rely on the BKL, and even
    there are lots of low-hanging fruit. We need to decide what to do
    about them, this patch illustrates one of the options:

    Every user of the BKL is marked as 'depends on BKL' in Kconfig,
    and the CONFIG_BKL becomes a user-visible option. If it gets
    disabled, no BKL using module can be built any more and the BKL
    code itself is compiled out.

    The one exception is file locking, which is practically always
    enabled and does a 'select BKL' instead. This effectively forces
    CONFIG_BKL to be enabled until we have solved the fs/lockd
    mess and can apply the patch that removes the BKL from fs/locks.c.

    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     

29 Sep, 2009

1 commit

  • Currently we are calling the bkl tracepoint callbacks just before the
    bkl lock/unlock operations, ie the tracepoint call is not inside a
    lock_kernel() function but inside a lock_kernel() macro. Hence the
    bkl trace event header must be included from smp_lock.h. This raises
    some nasty circular header dependencies:

    linux/smp_lock.h -> trace/events/bkl.h -> trace/define_trace.h
    -> trace/ftrace.h -> linux/ftrace_event.h -> linux/hardirq.h
    -> linux/smp_lock.h

    This results in incomplete event declarations, spurious event
    definitions and other kind of funny behaviours.

    This is hardly fixable without ugly workarounds. So instead, we push
    the file name, line number and function name as lock_kernel()
    parameters, so that we only deal with the trace event header from
    lib/kernel_lock.c

    This adds two parameters to lock_kernel() and unlock_kernel() but
    it should be fine wrt to performances because this pair dos not seem
    to be called in fast paths.

    Signed-off-by: Frederic Weisbecker
    Cc: Steven Rostedt
    Cc: Ingo Molnar
    Cc: Li Zefan

    Frederic Weisbecker
     

24 Sep, 2009

1 commit

  • Add two events lock_kernel and unlock_kernel() to trace the bkl uses.
    This opens the door for userspace tools to perform statistics about
    the callsites that use it, dependencies with other locks (by pairing
    the trace with lock events), use with recursivity and so on...

    The {__reacquire,release}_kernel_lock() events are not traced because
    these are called from schedule, thus the sched events are sufficient
    to trace them.

    Example of a trace:

    hald-addon-stor-4152 [000] 165.875501: unlock_kernel: depth: 0, fs/block_dev.c:1358 __blkdev_put()
    hald-addon-stor-4152 [000] 167.832974: lock_kernel: depth: 0, fs/block_dev.c:1167 __blkdev_get()

    How to get the callsites that acquire it recursively:

    cd /debug/tracing/events/bkl
    echo "lock_depth > 0" > filter

    firefox-4951 [001] 206.276967: unlock_kernel: depth: 1, fs/reiserfs/super.c:575 reiserfs_dirty_inode()

    You can also filter by file and/or line.

    v2: Use of FILTER_PTR_STRING attribute for files and lines fields to
    make them traceable.

    Signed-off-by: Frederic Weisbecker
    Cc: Steven Rostedt
    Cc: Li Zefan

    Frederic Weisbecker
     

21 Jun, 2008

1 commit

  • A number of driver functions are so obviously trivial that they do not need
    the big kernel lock - at least not overtly. It turns out that the
    acquisition of the BKL in driver open() functions can perform a sort of
    poor-hacker's serialization function, delaying the open operation until the
    driver is certain to have completed its initialization. Add a simple
    cycle_kernel_lock() function for these cases to make it clear that there is
    no need to *hold* the BKL, just to be sure that we can acquire it.

    Signed-off-by: Jonathan Corbet

    Jonathan Corbet
     

26 Jan, 2008

1 commit


17 Jul, 2007

1 commit


26 Apr, 2006

1 commit


14 Nov, 2005

1 commit

  • a) in smp_lock.h #include of sched.h and spinlock.h moved under #ifdef
    CONFIG_LOCK_KERNEL.

    b) interrupt.h now explicitly pulls sched.h (not via smp_lock.h from
    hardirq.h as it used to)

    c) in three more places we need changes to compensate for (a) - one place
    in arch/sparc needs string.h now, hardirq.h needs forward declaration of
    task_struct and preempt.h needs direct include of thread_info.h.

    d) thread_info-related helpers in sched.h and thread_info.h put under
    ifndef __HAVE_THREAD_FUNCTIONS. Obviously safe.

    Signed-off-by: Al Viro
    Signed-off-by: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Al Viro
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds