Skip to content

Commit

Permalink
BKL: That's all, folks
Browse files Browse the repository at this point in the history
This removes the implementation of the big kernel lock,
at last. A lot of people have worked on this in the
past, I so the credit for this patch should be with
everyone who participated in the hunt.

The names on the Cc list are the people that were the
most active in this, according to the recorded git
history, in alphabetical order.

Signed-off-by: Arnd Bergmann <[email protected]>
Acked-by: Alan Cox <[email protected]>
Cc: Alessio Igor Bogani <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Andrew Hendry <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Eric W. Biederman <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Hans Verkuil <[email protected]>
Acked-by: Ingo Molnar <[email protected]>
Cc: Jan Blunck <[email protected]>
Cc: John Kacur <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Oliver Neukum <[email protected]>
Cc: Paul Menage <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Cc: Trond Myklebust <[email protected]>
  • Loading branch information
arndb committed Mar 5, 2011
1 parent ae7eb89 commit 4ba8216
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 232 deletions.
9 changes: 1 addition & 8 deletions include/linux/hardirq.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,6 @@
*/
#define in_nmi() (preempt_count() & NMI_MASK)

#if defined(CONFIG_PREEMPT) && defined(CONFIG_BKL)
# include <linux/sched.h>
# define PREEMPT_INATOMIC_BASE (current->lock_depth >= 0)
#else
# define PREEMPT_INATOMIC_BASE 0
#endif

#if defined(CONFIG_PREEMPT)
# define PREEMPT_CHECK_OFFSET 1
#else
Expand All @@ -113,7 +106,7 @@
* used in the general case to determine whether sleeping is possible.
* Do not use in_atomic() in driver code.
*/
#define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_INATOMIC_BASE)
#define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != 0)

/*
* Check whether we were atomic before we did preempt_disable():
Expand Down
65 changes: 0 additions & 65 deletions include/linux/smp_lock.h

This file was deleted.

5 changes: 0 additions & 5 deletions init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ config BROKEN_ON_SMP
depends on BROKEN || !SMP
default y

config LOCK_KERNEL
bool
depends on (SMP || PREEMPT) && BKL
default y

config INIT_ENV_ARG_LIMIT
int
default 32 if !UML
Expand Down
9 changes: 1 addition & 8 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <linux/init.h>
#include <linux/uaccess.h>
#include <linux/highmem.h>
#include <linux/smp_lock.h>
#include <asm/mmu_context.h>
#include <linux/interrupt.h>
#include <linux/capability.h>
Expand Down Expand Up @@ -3945,9 +3944,6 @@ asmlinkage void __sched schedule(void)
rcu_note_context_switch(cpu);
prev = rq->curr;

release_kernel_lock(prev);
need_resched_nonpreemptible:

schedule_debug(prev);

if (sched_feat(HRTICK))
Expand Down Expand Up @@ -4010,9 +4006,6 @@ asmlinkage void __sched schedule(void)

post_schedule(rq);

if (unlikely(reacquire_kernel_lock(prev)))
goto need_resched_nonpreemptible;

preempt_enable_no_resched();
if (need_resched())
goto need_resched;
Expand Down Expand Up @@ -8074,7 +8067,7 @@ static inline int preempt_count_equals(int preempt_offset)
{
int nested = (preempt_count() & ~PREEMPT_ACTIVE) + rcu_preempt_depth();

return (nested == PREEMPT_INATOMIC_BASE + preempt_offset);
return (nested == preempt_offset);
}

void __might_sleep(const char *file, int line, int preempt_offset)
Expand Down
9 changes: 0 additions & 9 deletions lib/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -470,15 +470,6 @@ config DEBUG_MUTEXES
This feature allows mutex semantics violations to be detected and
reported.

config BKL
bool "Big Kernel Lock" if (SMP || PREEMPT)
default y
help
This is the traditional lock that is used in old code instead
of proper locking. All drivers that use the BKL should depend
on this symbol.
Say Y here unless you are working on removing the BKL.

config DEBUG_LOCK_ALLOC
bool "Lock debugging: detect incorrect freeing of live locks"
depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
Expand Down
1 change: 0 additions & 1 deletion lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ obj-$(CONFIG_GENERIC_FIND_LAST_BIT) += find_last_bit.o
CFLAGS_hweight.o = $(subst $(quote),,$(CONFIG_ARCH_HWEIGHT_CFLAGS))
obj-$(CONFIG_GENERIC_HWEIGHT) += hweight.o

obj-$(CONFIG_LOCK_KERNEL) += kernel_lock.o
obj-$(CONFIG_BTREE) += btree.o
obj-$(CONFIG_DEBUG_PREEMPT) += smp_processor_id.o
obj-$(CONFIG_DEBUG_LIST) += list_debug.o
Expand Down
136 changes: 0 additions & 136 deletions lib/kernel_lock.c

This file was deleted.

0 comments on commit 4ba8216

Please sign in to comment.