Skip to content

Commit 625f2a3

Browse files
Jonathan CorbetIngo Molnar
authored andcommitted
sched: Get rid of lock_depth
Neil Brown pointed out that lock_depth somehow escaped the BKL removal work. Let's get rid of it now. Note that the perf scripting utilities still have a bunch of code for dealing with common_lock_depth in tracepoints; I have left that in place in case anybody wants to use that code with older kernels. Suggested-by: Neil Brown <neilb@suse.de> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/r/20110422111910.456c0e84@bike.lwn.net Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent d3bf52e commit 625f2a3

10 files changed

Lines changed: 1 addition & 33 deletions

File tree

‎Documentation/trace/kprobetrace.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ format:
120120
field:unsigned char common_flags; offset:2; size:1; signed:0;
121121
field:unsigned char common_preempt_count; offset:3; size:1;signed:0;
122122
field:int common_pid; offset:4; size:4; signed:1;
123-
field:int common_lock_depth; offset:8; size:4; signed:1;
124123

125124
field:unsigned long __probe_ip; offset:12; size:4; signed:0;
126125
field:int __probe_nargs; offset:16; size:4; signed:1;

‎include/linux/init_task.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ extern struct cred init_cred;
134134
.stack = &init_thread_info, \
135135
.usage = ATOMIC_INIT(2), \
136136
.flags = PF_KTHREAD, \
137-
.lock_depth = -1, \
138137
.prio = MAX_PRIO-20, \
139138
.static_prio = MAX_PRIO-20, \
140139
.normal_prio = MAX_PRIO-20, \

‎include/linux/sched.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -731,10 +731,6 @@ struct sched_info {
731731
/* timestamps */
732732
unsigned long long last_arrival,/* when we last ran on a cpu */
733733
last_queued; /* when we were last queued to run */
734-
#ifdef CONFIG_SCHEDSTATS
735-
/* BKL stats */
736-
unsigned int bkl_count;
737-
#endif
738734
};
739735
#endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */
740736

@@ -1190,8 +1186,6 @@ struct task_struct {
11901186
unsigned int flags; /* per process flags, defined below */
11911187
unsigned int ptrace;
11921188

1193-
int lock_depth; /* BKL lock depth */
1194-
11951189
#ifdef CONFIG_SMP
11961190
struct task_struct *wake_entry;
11971191
int on_cpu;

‎kernel/fork.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,6 @@ static struct task_struct *copy_process(unsigned long clone_flags,
11031103

11041104
posix_cpu_timers_init(p);
11051105

1106-
p->lock_depth = -1; /* -1 = no lock */
11071106
do_posix_clock_monotonic_gettime(&p->start_time);
11081107
p->real_start_time = p->start_time;
11091108
monotonic_to_bootbased(&p->real_start_time);

‎kernel/mutex.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,6 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
162162
for (;;) {
163163
struct task_struct *owner;
164164

165-
/*
166-
* If we own the BKL, then don't spin. The owner of
167-
* the mutex might be waiting on us to release the BKL.
168-
*/
169-
if (unlikely(current->lock_depth >= 0))
170-
break;
171-
172165
/*
173166
* If there's an owner, wait for it to either
174167
* release the lock or go to sleep.

‎kernel/sched.c‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4121,12 +4121,6 @@ static inline void schedule_debug(struct task_struct *prev)
41214121
profile_hit(SCHED_PROFILING, __builtin_return_address(0));
41224122

41234123
schedstat_inc(this_rq(), sched_count);
4124-
#ifdef CONFIG_SCHEDSTATS
4125-
if (unlikely(prev->lock_depth >= 0)) {
4126-
schedstat_inc(this_rq(), rq_sched_info.bkl_count);
4127-
schedstat_inc(prev, sched_info.bkl_count);
4128-
}
4129-
#endif
41304124
}
41314125

41324126
static void put_prev_task(struct rq *rq, struct task_struct *prev)
@@ -5852,11 +5846,8 @@ void __cpuinit init_idle(struct task_struct *idle, int cpu)
58525846
raw_spin_unlock_irqrestore(&rq->lock, flags);
58535847

58545848
/* Set the preempt count _outside_ the spinlocks! */
5855-
#if defined(CONFIG_PREEMPT)
5856-
task_thread_info(idle)->preempt_count = (idle->lock_depth >= 0);
5857-
#else
58585849
task_thread_info(idle)->preempt_count = 0;
5859-
#endif
5850+
58605851
/*
58615852
* The idle tasks have their own, simple scheduling class:
58625853
*/

‎kernel/sched_debug.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,6 @@ static void print_cpu(struct seq_file *m, int cpu)
296296
P(ttwu_count);
297297
P(ttwu_local);
298298

299-
SEQ_printf(m, " .%-30s: %d\n", "bkl_count",
300-
rq->rq_sched_info.bkl_count);
301-
302299
#undef P
303300
#undef P64
304301
#endif
@@ -441,7 +438,6 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m)
441438
P(se.statistics.wait_count);
442439
PN(se.statistics.iowait_sum);
443440
P(se.statistics.iowait_count);
444-
P(sched_info.bkl_count);
445441
P(se.nr_migrations);
446442
P(se.statistics.nr_migrations_cold);
447443
P(se.statistics.nr_failed_migrations_affine);

‎kernel/trace/trace_kprobe.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ const char *reserved_field_names[] = {
5353
"common_preempt_count",
5454
"common_pid",
5555
"common_tgid",
56-
"common_lock_depth",
5756
FIELD_STRING_IP,
5857
FIELD_STRING_RETIP,
5958
FIELD_STRING_FUNC,

‎tools/perf/Documentation/perf-script-perl.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ The format file for the sched_wakep event defines the following fields
6363
field:unsigned char common_flags;
6464
field:unsigned char common_preempt_count;
6565
field:int common_pid;
66-
field:int common_lock_depth;
6766

6867
field:char comm[TASK_COMM_LEN];
6968
field:pid_t pid;

‎tools/perf/Documentation/perf-script-python.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,6 @@ The format file for the sched_wakep event defines the following fields
463463
field:unsigned char common_flags;
464464
field:unsigned char common_preempt_count;
465465
field:int common_pid;
466-
field:int common_lock_depth;
467466

468467
field:char comm[TASK_COMM_LEN];
469468
field:pid_t pid;

0 commit comments

Comments
 (0)