linux-um archives
 help / color / mirror / Atom feed
* [PATCH 00/18] Make the big kernel lock optional
@ 2010-09-14 19:34 Arnd Bergmann
  2010-09-14 19:35 ` [uml-devel] [PATCH 10/18] uml: kill big kernel lock Arnd Bergmann
  2010-09-15  9:37 ` [PATCH 00/18] Make the big kernel lock optional Stephen Rothwell
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2010-09-14 19:34 UTC (permalink / raw)
  To: arnd
  Cc: Al Viro, Andrew Morton, Arjan van de Ven, Bob Picco,
	Clemens Ladisch, Geert Uytterhoeven, Heiko Carstens, Helge Deller,
	Ingo Molnar, Ivan Kokshaysky, James E.J. Bottomley,
	Jaroslav Kysela, Jeff Dike, Jesper Nilsson, Jesse Barnes,
	Karsten Keil, Kyle McMartin, Linus Torvalds, Mark Gross,
	Martin Schwidefsky, Matt Turner, Mauro Carvalho Chehab,
	Mikael Starvik, Paul Mundt, Richard Henderson, Roman Zippel,
	Stephen Rothwell, Tejun Heo, Thomas Gleixner, linux-alpha,
	linux-cris-kernel, linux-m68k, linux-media, linux-parisc,
	linux-pci, linux-s390, linux-sh, netdev, user-mode-linux-devel

This is a set of simple patches to remove the big kernel
lock in some remaining areas and introduce a Kconfig
option which I'd like to have included in linux-next
and get included in the 2.6.37 merge window.

I have a total of five topic branches, which together
remove the BKL from all code except those modules
which get marked as 'depends on BKL' in the final
patch of this series.

It's fine if maintainers want to add some of these
patches to their own queue, as long as they all make
it into linux-next.

Stephen, please add
git+ssh://master.kernel.org/pub/scm/linux/kernel/git/arnd/bkl.git config

Arnd Bergmann (17):
  hpet: kill BKL, add compat_ioctl
  proc/pci: kill BKL
  s390/block: kill the big kernel lock
  isapnp: BKL removal
  alpha: kill big kernel lock
  cris: autoconvert trivial BKL users
  m68k: remove big kernel lock
  parisc: remove big kernel lock
  sh: kill big kernel lock
  uml: kill big kernel lock
  tlclk: remove big kernel lock
  i4l: kill big kernel lock
  misdn: kill big kernel lock
  dvb/bt8xx: kill the big kernel lock
  dvb-core: kill the big kernel lock
  rtmutex-tester: make it build without BKL
  BKL: introduce CONFIG_BKL.

Al Viro (1):
  fix rawctl compat ioctls breakage on amd64 and itanic

 arch/alpha/kernel/osf_sys.c                 |    5 -
 arch/alpha/kernel/traps.c                   |    3 -
 arch/cris/arch-v10/drivers/ds1302.c         |    7 +-
 arch/cris/arch-v10/drivers/pcf8563.c        |    6 +-
 arch/cris/arch-v10/drivers/sync_serial.c    |   11 +-
 arch/cris/arch-v32/drivers/cryptocop.c      |    4 +-
 arch/cris/arch-v32/drivers/mach-a3/gpio.c   |   11 +-
 arch/cris/arch-v32/drivers/mach-fs/gpio.c   |   11 +-
 arch/cris/arch-v32/drivers/pcf8563.c        |    6 +-
 arch/cris/arch-v32/drivers/sync_serial.c    |   11 +-
 arch/m68k/kernel/sys_m68k.c                 |    7 +-
 arch/parisc/kernel/perf.c                   |    4 -
 arch/sh/kernel/ptrace_64.c                  |    9 +-
 arch/um/drivers/harddog_kern.c              |   13 +-
 arch/um/drivers/hostaudio_kern.c            |    8 +-
 arch/um/drivers/ubd_kern.c                  |    8 +-
 arch/um/kernel/exec.c                       |    2 -
 drivers/char/hpet.c                         |   98 +++++++----
 drivers/char/raw.c                          |  243 +++++++++++++++-----------
 drivers/char/tlclk.c                        |    6 +-
 drivers/gpu/drm/Kconfig                     |    5 +-
 drivers/isdn/capi/Kconfig                   |    2 +-
 drivers/isdn/i4l/isdn_tty.c                 |   11 +-
 drivers/isdn/mISDN/stack.c                  |    7 -
 drivers/media/Kconfig                       |    1 +
 drivers/media/dvb/bt8xx/dst_ca.c            |    7 +-
 drivers/media/dvb/dvb-core/dmxdev.c         |   17 +--
 drivers/media/dvb/dvb-core/dvb_ca_en50221.c |    8 +-
 drivers/media/dvb/dvb-core/dvb_net.c        |    9 +-
 drivers/media/dvb/dvb-core/dvbdev.c         |   17 +-
 drivers/net/appletalk/Kconfig               |    1 +
 drivers/pci/proc.c                          |    4 +-
 drivers/pnp/isapnp/proc.c                   |   13 +-
 drivers/s390/block/dasd.c                   |    6 -
 drivers/s390/block/dasd_ioctl.c             |   17 +--
 drivers/s390/block/dcssblk.c                |    5 -
 drivers/staging/cx25821/Kconfig             |    1 +
 drivers/staging/easycap/Kconfig             |    1 +
 drivers/staging/go7007/Kconfig              |    1 +
 drivers/staging/usbip/Kconfig               |    2 +-
 drivers/usb/gadget/Kconfig                  |    2 +-
 fs/Kconfig                                  |    1 +
 fs/adfs/Kconfig                             |    1 +
 fs/afs/Kconfig                              |    1 +
 fs/autofs/Kconfig                           |    1 +
 fs/autofs4/Kconfig                          |    1 +
 fs/ceph/Kconfig                             |    1 +
 fs/coda/Kconfig                             |    1 +
 fs/compat_ioctl.c                           |   70 --------
 fs/ecryptfs/Kconfig                         |    1 +
 fs/freevxfs/Kconfig                         |    1 +
 fs/hpfs/Kconfig                             |    1 +
 fs/jffs2/Kconfig                            |    1 +
 fs/ncpfs/Kconfig                            |    1 +
 fs/nfs/Kconfig                              |    1 +
 fs/nfsd/Kconfig                             |    1 +
 fs/ocfs2/Kconfig                            |    1 +
 fs/qnx4/Kconfig                             |    1 +
 fs/reiserfs/Kconfig                         |    1 +
 fs/smbfs/Kconfig                            |    1 +
 fs/squashfs/Kconfig                         |    1 +
 fs/udf/Kconfig                              |    1 +
 fs/ufs/Kconfig                              |    1 +
 include/linux/smp_lock.h                    |    7 +-
 init/Kconfig                                |    2 +-
 kernel/rtmutex-tester.c                     |    6 +
 kernel/trace/Kconfig                        |    1 +
 lib/Kconfig.debug                           |    9 +
 net/ipx/Kconfig                             |    1 +
 net/irda/Kconfig                            |    1 +
 net/irda/irnet/Kconfig                      |    1 +
 net/x25/Kconfig                             |    1 +
 72 files changed, 355 insertions(+), 375 deletions(-)

Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Bob Picco <bob.picco@hp.com>
Cc: Clemens Ladisch <clemens@ladisch.de>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mark Gross <mark.gross@intel.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-alpha@vger.kernel.org
Cc: linux-cris-kernel@axis.com
Cc: linux-m68k@lists.linux-m68k.org
Cc: linux-media@vger.kernel.org
Cc: linux-parisc@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: user-mode-linux-devel@lists.sourceforge.net


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [uml-devel] [PATCH 10/18] uml: kill big kernel lock
  2010-09-14 19:34 [PATCH 00/18] Make the big kernel lock optional Arnd Bergmann
@ 2010-09-14 19:35 ` Arnd Bergmann
  2010-09-15  9:37 ` [PATCH 00/18] Make the big kernel lock optional Stephen Rothwell
  1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2010-09-14 19:35 UTC (permalink / raw)
  To: arnd; +Cc: Jeff Dike, user-mode-linux-devel

Three uml device drivers still use the big kernel lock,
but all of them can be safely converted to using
a per-driver mutex instead. Most likely this is not
even necessary, so after further review these can
and should be removed as well.

The exec system call no longer requires the BKL either,
so remove it from there, too.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: user-mode-linux-devel@lists.sourceforge.net
---
 arch/um/drivers/harddog_kern.c   |   13 +++++++------
 arch/um/drivers/hostaudio_kern.c |    8 ++++----
 arch/um/drivers/ubd_kern.c       |    8 ++++----
 arch/um/kernel/exec.c            |    2 --
 4 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/arch/um/drivers/harddog_kern.c b/arch/um/drivers/harddog_kern.c
index cfcac1f..8603627 100644
--- a/arch/um/drivers/harddog_kern.c
+++ b/arch/um/drivers/harddog_kern.c
@@ -42,7 +42,7 @@
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
 #include <linux/reboot.h>
-#include <linux/smp_lock.h>
+#include <linux/mutex.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
@@ -50,6 +50,7 @@
 
 MODULE_LICENSE("GPL");
 
+static DEFINE_MUTEX(harddog_mutex);
 static DEFINE_SPINLOCK(lock);
 static int timer_alive;
 static int harddog_in_fd = -1;
@@ -66,7 +67,7 @@ static int harddog_open(struct inode *inode, struct file *file)
 	int err = -EBUSY;
 	char *sock = NULL;
 
-	lock_kernel();
+	mutex_lock(&harddog_mutex);
 	spin_lock(&lock);
 	if(timer_alive)
 		goto err;
@@ -83,11 +84,11 @@ static int harddog_open(struct inode *inode, struct file *file)
 
 	timer_alive = 1;
 	spin_unlock(&lock);
-	unlock_kernel();
+	mutex_unlock(&harddog_mutex);
 	return nonseekable_open(inode, file);
 err:
 	spin_unlock(&lock);
-	unlock_kernel();
+	mutex_unlock(&harddog_mutex);
 	return err;
 }
 
@@ -153,9 +154,9 @@ static long harddog_ioctl(struct file *file,
 {
 	long ret;
 
-	lock_kernel();
+	mutex_lock(&harddog_mutex);
 	ret = harddog_ioctl_unlocked(file, cmd, arg);
-	unlock_kernel();
+	mutex_unlock(&harddog_mutex);
 
 	return ret;
 }
diff --git a/arch/um/drivers/hostaudio_kern.c b/arch/um/drivers/hostaudio_kern.c
index 0c46e39..fde18dc 100644
--- a/arch/um/drivers/hostaudio_kern.c
+++ b/arch/um/drivers/hostaudio_kern.c
@@ -202,9 +202,9 @@ static int hostaudio_open(struct inode *inode, struct file *file)
 		w = 1;
 
 	kparam_block_sysfs_write(dsp);
-	lock_kernel();
+	mutex_lock(&hostaudio_mutex);
 	ret = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0);
-	unlock_kernel();
+	mutex_unlock(&hostaudio_mutex);
 	kparam_unblock_sysfs_write(dsp);
 
 	if (ret < 0) {
@@ -263,9 +263,9 @@ static int hostmixer_open_mixdev(struct inode *inode, struct file *file)
 		w = 1;
 
 	kparam_block_sysfs_write(mixer);
-	lock_kernel();
+	mutex_lock(&hostaudio_mutex);
 	ret = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0);
-	unlock_kernel();
+	mutex_unlock(&hostaudio_mutex);
 	kparam_unblock_sysfs_write(mixer);
 
 	if (ret < 0) {
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 1bcd208..dc73bc8 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -1099,7 +1099,7 @@ static int ubd_open(struct block_device *bdev, fmode_t mode)
 	struct ubd *ubd_dev = disk->private_data;
 	int err = 0;
 
-	lock_kernel();
+	mutex_lock(&ubd_mutex);
 	if(ubd_dev->count == 0){
 		err = ubd_open_dev(ubd_dev);
 		if(err){
@@ -1118,7 +1118,7 @@ static int ubd_open(struct block_device *bdev, fmode_t mode)
 	        err = -EROFS;
 	}*/
 out:
-	unlock_kernel();
+	mutex_unlock(&ubd_mutex);
 	return err;
 }
 
@@ -1126,10 +1126,10 @@ static int ubd_release(struct gendisk *disk, fmode_t mode)
 {
 	struct ubd *ubd_dev = disk->private_data;
 
-	lock_kernel();
+	mutex_lock(&ubd_mutex);
 	if(--ubd_dev->count == 0)
 		ubd_close_dev(ubd_dev);
-	unlock_kernel();
+	mutex_unlock(&ubd_mutex);
 	return 0;
 }
 
diff --git a/arch/um/kernel/exec.c b/arch/um/kernel/exec.c
index cd145ed..460ce86 100644
--- a/arch/um/kernel/exec.c
+++ b/arch/um/kernel/exec.c
@@ -78,13 +78,11 @@ long sys_execve(const char __user *file, char __user *__user *argv,
 	long error;
 	char *filename;
 
-	lock_kernel();
 	filename = getname(file);
 	error = PTR_ERR(filename);
 	if (IS_ERR(filename)) goto out;
 	error = execve1(filename, argv, env);
 	putname(filename);
  out:
-	unlock_kernel();
 	return error;
 }
-- 
1.7.1


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 00/18] Make the big kernel lock optional
  2010-09-14 19:34 [PATCH 00/18] Make the big kernel lock optional Arnd Bergmann
  2010-09-14 19:35 ` [uml-devel] [PATCH 10/18] uml: kill big kernel lock Arnd Bergmann
@ 2010-09-15  9:37 ` Stephen Rothwell
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2010-09-15  9:37 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Al Viro, Andrew Morton, Arjan van de Ven, Bob Picco,
	Clemens Ladisch, Geert Uytterhoeven, Heiko Carstens, Helge Deller,
	Ingo Molnar, Ivan Kokshaysky, James E.J. Bottomley,
	Jaroslav Kysela, Jeff Dike, Jesper Nilsson, Jesse Barnes,
	Karsten Keil, Kyle McMartin, Linus Torvalds, Mark Gross,
	Martin Schwidefsky, Matt Turner, Mauro Carvalho Chehab,
	Mikael Starvik, Paul Mundt, Richard Henderson, Roman Zippel,
	Tejun Heo, Thomas Gleixner, linux-alpha, linux-cris-kernel,
	linux-m68k, linux-media, linux-parisc, linux-pci, linux-s390,
	linux-sh, netdev, user-mode-linux-devel

[-- Attachment #1: Type: text/plain, Size: 1739 bytes --]

On Tue, 14 Sep 2010 21:34:51 +0200 Arnd Bergmann <arnd@arndb.de> wrote:
>
> Stephen, please add
> git+ssh://master.kernel.org/pub/scm/linux/kernel/git/arnd/bkl.git config

Added from today.

Thanks for adding your subsystem tree as a participant of linux-next.  As
you may know, this is not a judgment of your code.  The purpose of
linux-next is for integration testing and to lower the impact of
conflicts between subsystems in the next merge window. 

You will need to ensure that the patches/commits in your tree/series have
been:
     * submitted under GPL v2 (or later) and include the Contributor's
	Signed-off-by,
     * posted to the relevant mailing list,
     * reviewed by you (or another maintainer of your subsystem tree),
     * successfully unit tested, and 
     * destined for the current or next Linux merge window.

Basically, this should be just what you would send to Linus (or ask him
to fetch).  It is allowed to be rebased if you deem it necessary.

-- 
Cheers,
Stephen Rothwell 
sfr@canb.auug.org.au

Legal Stuff:
By participating in linux-next, your subsystem tree contributions are
public and will be included in the linux-next trees.  You may be sent
e-mail messages indicating errors or other issues when the
patches/commits from your subsystem tree are merged and tested in
linux-next.  These messages may also be cross-posted to the linux-next
mailing list, the linux-kernel mailing list, etc.  The linux-next tree
project and IBM (my employer) make no warranties regarding the linux-next
project, the testing procedures, the results, the e-mails, etc.  If you
don't agree to these ground rules, let me know and I'll remove your tree
from participation in linux-next.

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-09-15  9:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-14 19:34 [PATCH 00/18] Make the big kernel lock optional Arnd Bergmann
2010-09-14 19:35 ` [uml-devel] [PATCH 10/18] uml: kill big kernel lock Arnd Bergmann
2010-09-15  9:37 ` [PATCH 00/18] Make the big kernel lock optional Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox