Re: [PATCH v3 00/10] BKL conversion in tty layer

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Arnd Bergmann
Date: Thursday, June 17, 2010 - 12:40 pm

On Thursday 17 June 2010 21:13:52 Tony Luck wrote:


Ah, I forgot to test the tty series without the other patches I have
in my bkl removal repository and without CONFIG_TTY_MUTEX.

Does the patch below make this go away? We should probably include
the 'misc' branch of my BKL repository in -next to fix this.

	Arnd

--
From 99b699e56b23775c0c9a131208e1a5e13f6cfad3 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Mon, 15 Mar 2010 19:00:34 +0100
Subject: [PATCH] init: remove the BKL from startup code

I have shown by code review that no driver takes
the BKL at init time any more, so whatever the
init code was locking against is no longer there
and it is now safe to remove the BKL there.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/init/main.c b/init/main.c
index 3bdb152..81821e1 100644
--- a/init/main.c
+++ b/init/main.c
@@ -434,7 +434,6 @@ static noinline void __init_refok rest_init(void)
 	rcu_read_lock();
 	kthreadd_task = find_task_by_pid_ns(pid, &init_pid_ns);
 	rcu_read_unlock();
-	unlock_kernel();
 
 	/*
 	 * The boot idle thread must execute schedule()
@@ -555,7 +554,6 @@ asmlinkage void __init start_kernel(void)
  * Interrupts are still disabled. Do necessary setups, then
  * enable them
  */
-	lock_kernel();
 	tick_init();
 	boot_cpu_init();
 	page_address_init();
@@ -819,7 +817,6 @@ static noinline int init_post(void)
 	/* need to finish all async __init code before freeing the memory */
 	async_synchronize_full();
 	free_initmem();
-	unlock_kernel();
 	mark_rodata_ro();
 	system_state = SYSTEM_RUNNING;
 	numa_default_policy();
@@ -855,8 +852,6 @@ static noinline int init_post(void)
 
 static int __init kernel_init(void * unused)
 {
-	lock_kernel();
-
 	/*
 	 * init can allocate pages on any node
 	 */
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 086d363..8047ca5 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -734,13 +734,6 @@ __acquires(kernel_lock)
 		return -1;
 	}
 
-	/*
-	 * When this gets called we hold the BKL which means that
-	 * preemption is disabled. Various trace selftests however
-	 * need to disable and enable preemption for successful tests.
-	 * So we drop the BKL here and grab it after the tests again.
-	 */
-	unlock_kernel();
 	mutex_lock(&trace_types_lock);
 
 	tracing_selftest_running = true;
@@ -822,7 +815,6 @@ __acquires(kernel_lock)
 #endif
 
  out_unlock:
-	lock_kernel();
 	return ret;
 }
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v3 00/10] BKL conversion in tty layer, Arnd Bergmann, (Sat May 15, 1:59 pm)
[PATCH 06/10] tty: annotate tty_write_lock, Arnd Bergmann, (Sat May 15, 1:59 pm)
Re: [PATCH v3 00/10] BKL conversion in tty layer, Alan Cox, (Mon May 17, 6:41 am)
Re: [PATCH v3 00/10] BKL conversion in tty layer, Greg KH, (Mon May 17, 8:30 am)
Re: [PATCH v3 00/10] BKL conversion in tty layer, Arnd Bergmann, (Mon May 17, 11:30 am)
Re: [PATCH v3 00/10] BKL conversion in tty layer, Arnd Bergmann, (Mon May 17, 11:49 am)
Re: [PATCH v3 00/10] BKL conversion in tty layer, Greg KH, (Mon May 17, 9:27 pm)
Re: [PATCH v3 00/10] BKL conversion in tty layer, Arnd Bergmann, (Tue May 18, 2:52 pm)
Re: [PATCH v3 00/10] BKL conversion in tty layer, Greg KH, (Tue May 18, 6:50 pm)
Re: [PATCH v3 00/10] BKL conversion in tty layer, Arnd Bergmann, (Sat May 22, 6:54 am)
Re: [PATCH v3 00/10] BKL conversion in tty layer, Tony Luck, (Thu Jun 17, 12:13 pm)
Re: [PATCH v3 00/10] BKL conversion in tty layer, Arnd Bergmann, (Thu Jun 17, 12:40 pm)
Re: [PATCH v3 00/10] BKL conversion in tty layer, Tony Luck, (Thu Jun 17, 1:15 pm)
Re: [PATCH v3 00/10] BKL conversion in tty layer, Arnd Bergmann, (Thu Jun 17, 2:48 pm)
Re: [PATCH v3 00/10] BKL conversion in tty layer, Frederic Weisbecker, (Thu Jun 17, 3:09 pm)
[PATCH] tty: avoid recursive BTM in pty_close, Arnd Bergmann, (Fri Jun 18, 5:58 am)
Re: [PATCH] tty: avoid recursive BTM in pty_close, Alan Cox, (Fri Jun 18, 9:21 am)
Re: [PATCH] tty: avoid recursive BTM in pty_close, Tony Luck, (Fri Jun 18, 9:52 am)
Re: [PATCH] tty: avoid recursive BTM in pty_close, Arnd Bergmann, (Fri Jun 18, 11:35 am)
Re: [PATCH] tty: avoid recursive BTM in pty_close, Tony Luck, (Fri Jun 18, 1:25 pm)
Re: [PATCH] tty: avoid recursive BTM in pty_close, Arnd Bergmann, (Sat Jun 19, 5:32 am)
Re: [PATCH] tty: avoid recursive BTM in pty_close, Tony Luck, (Mon Jun 28, 10:17 am)
Re: [PATCH] tty: avoid recursive BTM in pty_close, Arnd Bergmann, (Mon Jun 28, 12:03 pm)