Arnd Bergmann noted that he's working on removing the BKL from the Linux kernel, "I've spent some time continuing the work of the people on Cc and many others to remove the big kernel lock from Linux and I now have [a] bkl-removal branch in my git tree". He went on to explain that his branch is working, and lets him run the Linux kernel, "on [a] quad-core machine with the only users of the BKL being mostly obscure device driver modules." Arnd noted that this effort has a long history, "the oldest patch in this series is roughly eight years old and is Willy's patch to remove the BKL from fs/locks.c, and I took a series of patches from Jan that removes it from most of the VFS."
Arnd noted that his patch adds a global mutex to the TTY layer, which he called the 'Big TTY Mutex' and described as, "the basic idea here is to make recursive locking and the release-on-sleep explicit, so every mutex_lock, wait_event, workqueue_flush and schedule in the TTY layer now explicitly releases the BTM before blocking." Alan Cox suggested that this portion of the patch was best dropped for now, "it would be nice to get the other bits in first removing BKL from most of the kernel and building kernels which are non BKL except for the tty layer. That (after Ingo's box from hell has run it a bit) would reasonably test the assertion that the tty layer has no BKL requirements that are driven by [code] external to tty layer code." Andrew Morton suggested that the patches be pushed upstream to their appropriate maintainers for an additional sanity check, "Seems that there might be a few tricksy bits in here. Please do push at least the non-obvious parts out to the relevant people."
From: Arnd Bergmann Subject: [GIT, RFC] Killing the Big Kernel Lock Date: Mar 24, 2:40 pm 2010 I've spent some time continuing the work of the people on Cc and many others to remove the big kernel lock from Linux and I now have bkl-removal branch in my git tree at git://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git that lets me run a kernel on my quad-core machine with the only users of the BKL being mostly obscure device driver modules. The oldest patch in this series is roughly eight years old and is Willy's patch to remove the BKL from fs/locks.c, and I took a series of patches from Jan that removes it from most of the VFS. The other non-obvious changes are: - all file operations that either have an .ioctl method or do not have their own .llseek method used to implicitly require the BKL. I've changed that so they need to explicitly set .llseek = default_llseek, .unlocked_ioctl = default_ioctl, and changed all the code that either has supplied a .ioctl method or looks like it needs the BKL somewhere else, meaning the default_llseek function might actually do something. - The block layer now has a global bkldev_mutex that is used in all block drivers in place of the BKL. The only recursive instance of the BKL was __blkdev_get(), which is now called with the blkdev_mutex held instead of grabbing the BKL. This has some possible performance implications that need to be looked into. - The init/main.c code no longer take the BKL. I figured that this was completely unnecessary because there is no other code running at the same time that takes the BKL. - The most invasive change is in the TTY layer, which has a new global mutex (sorry!). I know that Alan has plans of his own to remove the BKL from this subsystem, so my patches may not go anywhere, but they seem to work fine for me. I've called the new lock the 'Big TTY Mutex' (BTM), a name that probably makes more sense if you happen to speak German. The basic idea here is to make recursive locking and the release-on-sleep explicit, so every mutex_lock, wait_event, workqueue_flush and schedule in the TTY layer now explicitly releases the BTM before blocking. - All drivers that still require the BKL are now listed as 'depends on BKL' in Kconfig, and you can set that symbol to 'y', 'm' or 'n'. If the lock itself is a module, only other modules can use it, and /proc/modules will tell you exactly which ones those are. I've thought about adding a module_init function in that module that will taint the kernel, but so far I haven't done that. - Included is a debugfs file that gives statistics over the BKL usage from early boot on. This is now obsolete and will not get merged, but I'm including it for reference. Frederic has volunteered to help merging all of this upstream, which I very much welcome. The shape that the tree is in now is very inconsistent, especially some of the bits at the end are a bit dodgy and all of it needs more testing. I've built-tested an allmodconfig kernel with CONFIG_BKL disabled on x86_64, i386, powerpc64, powerpc32, s390 and arm to make sure I catch all the modules that depend on BKL, and I've been running various versions of this tree on my desktop machine over the last few weeks while adding stuff. Arnd --- Arnd Bergmann (44): input: kill BKL, fix input_open_file locking ptrace: kill BKL procfs: kill BKL in llseek random: forbid llseek on random chardev x86/microcode: use nonseekable_open perf_event: use nonseekable_open dm: use nonseekable_open vgaarb: use nonseekable_open kvm: don't require BKL nvram: kill BKL do_coredump: do not take BKL hpet: kill BKL, add compat_ioctl proc/pci: kill BKL autofs/autofs4: move compat_ioctl handling into fs usb/mon: kill BKL usage fat: push down BKL sunrpc: push down BKL pcmcia: push down BKL vfs: kill BKL in default_llseek BKL: introduce CONFIG_BKL. bkl-removal: make fops->ioctl and default_llseek optional x86: update defconfig to CONFIG_BKL=m bkl removal: make unlocked_ioctl mandatory bkl removal: use default_llseek in code that uses the BKL BKL removal: mark remaining users as 'depends on BKL' tty: replace BKL with a new tty_lock tty: make atomic_write_lock release tty_lock tty: make tty_port->mutex nest under tty_lock tty: make termios mutex nest under tty_lock tty: make ldisc_mutex nest under tty_lock tty: never hold tty_lock() while getting tty_mutex ppp: use big tty mutex tty: release tty lock when blocking tty: implement BTM as mutex instead of BKL briq_panel: do not use BTM affs: remove leftover unlock_kernel kvm: don't require BKL block: replace BKL with global mutex init: kill BKL usage debug: instrument big kernel lock BKL removal: make the BKL modular Matthew Wilcox (1): [RFC] Remove BKL from fs/locks.c Jan Blunck (19): JFS: Free sbi memory in error path BKL: Explicitly add BKL around get_sb/fill_super BKL: Remove outdated comment and include BKL: Remove BKL from Amiga FFS BKL: Remove BKL from BFS BKL: Remove BKL from CifsFS BKL: Remove BKL from ext3 fill_super() BKL: Remove BKL from ext3_put_super() and ext3_remount() BKL: Remove BKL from ext4 filesystem BKL: Remove smp_lock.h from exofs BKL: Remove BKL from HFS BKL: Remove BKL from HFS+ BKL: Remove BKL from JFS BKL: Remove BKL from NILFS2 BKL: Remove BKL from NTFS BKL: Remove BKL from cgroup BKL: Remove BKL from do_new_mount() ext2: Add ext2_sb_info s_lock spinlock BKL: Remove BKL from ext2 filesystem --
From: Alan Cox Subject: Re: [GIT, RFC] Killing the Big Kernel Lock Date: Mar 24, 3:10 pm 2010 > - The most invasive change is in the TTY layer, which has a new global > mutex (sorry!). I know that Alan has plans of his own to remove the BKL > from this subsystem, so my patches may not go anywhere, but they seem > to work fine for me. > I've called the new lock the 'Big TTY Mutex' (BTM), a name that probably > makes more sense if you happen to speak German. Chuckle (I don't but I looked it up) > The basic idea here is to make recursive locking and the release-on-sleep > explicit, so every mutex_lock, wait_event, workqueue_flush and schedule > in the TTY layer now explicitly releases the BTM before blocking. I'm not sure if that is actually the path of sanity (yours at least), nor the right way to whack the other BKL users whose use is horrible but essentially private. It would be nice to get the other bits in first removing BKL from most of the kernel and building kernels which are non BKL except for the tty layer. That (after Ingo's box from hell has run it a bit) would reasonably test the assertion that the tty layer has no BKL requirements that are driven by external to tty layer code. That to me would test the biggest question of all and be a reasonably good base from which to then either apply the tty BTM patches or attack the problem properly with the BKL localised to one subtree. Alan --
From: Arnd Bergmann Subject: Re: [GIT, RFC] Killing the Big Kernel Lock Date: Mar 24, 3:25 pm 2010 On Wednesday 24 March 2010 23:10:16 Alan Cox wrote: > > The basic idea here is to make recursive locking and the release-on-sleep > > explicit, so every mutex_lock, wait_event, workqueue_flush and schedule > > in the TTY layer now explicitly releases the BTM before blocking. > > I'm not sure if that is actually the path of sanity (yours at least), nor > the right way to whack the other BKL users whose use is horrible but > essentially private. > > It would be nice to get the other bits in first removing BKL from most of > the kernel and building kernels which are non BKL except for the tty > layer. That (after Ingo's box from hell has run it a bit) would > reasonably test the assertion that the tty layer has no BKL requirements > that are driven by external to tty layer code. Yes, we can do that by applying all patches except 'tty: implement BTM as mutex instead of BKL', which is the only one in the tty section of my series that should really change the behaviour. Building a kernel with all other BKL users gone currently implies disabling usbcore, videodev, soundcore, i4l and capi, as well as a large number of obsolete device drivers. The only ones that I can imagine still interacting with the tty code are the ISDN drivers, and even those look pretty unlikely. > That to me would test the biggest question of all and be a reasonably > good base from which to then either apply the tty BTM patches or attack > the problem properly with the BKL localised to one subtree. We could also make the 'tty: implement BTM as mutex instead of BKL' patch a config option that makes it possible to test it out some more while conservative users just continue to get the BKL semantics. Arnd --
From: Andrew Morton Subject: Re: [GIT, RFC] Killing the Big Kernel Lock Date: Mar 24, 2:07 pm 2010 On Wed, 24 Mar 2010 22:40:54 +0100 Arnd Bergmann <arnd@arndb.de> wrote: > I've spent some time continuing the work of the people on Cc and many others > to remove the big kernel lock from Linux <looks inside ptrace.c> Seems that there might be a few tricksy bits in here. Please do push at least the non-obvious parts out to the relevant people. It'd be interesting to see the overall diffstat? --
From: Arnd Bergmann Subject: Re: [GIT, RFC] Killing the Big Kernel Lock Date: Mar 25, 3:26 am 2010 On Wednesday 24 March 2010, Andrew Morton wrote: > On Wed, 24 Mar 2010 22:40:54 +0100 Arnd Bergmann <arnd@arndb.de> wrote: > > > I've spent some time continuing the work of the people on Cc and many others > > to remove the big kernel lock from Linux > > <looks inside ptrace.c> > > Seems that there might be a few tricksy bits in here. Please do push > at least the non-obvious parts out to the relevant people. Sure, that is certainly the plan. Regarding the ptrace bits, this is one of a handful of places where the BKL was put in by someone a really long time ago but with the rest of the series applied, it becomes evident that there is nothing whatsoever that it serializes with, so removing the BKL here does not make the situation worse. It could still be a bug that needs to be fixed by adding a new serialization method no matter if the BKL is there or not. > It'd be interesting to see the overall diffstat? Let me give you three separate diffstats. One is for the trivial pushdown of the BKL into all the ioctl and llseek functions as well as marking all remaining users as 'depends on BKL' in Kconfig, the second one is for the TTY layer conversion to the Big TTY Mutex and the third one is all the rest. Arnd --- Big TTY Mutex conversion: drivers/char/Makefile | 2 + drivers/char/amiserial.c | 16 ++-- drivers/char/cyclades.c | 20 ++-- drivers/char/epca.c | 4 +- drivers/char/isicom.c | 10 +- drivers/char/istallion.c | 20 ++-- drivers/char/mxser.c | 10 +- drivers/char/n_hdlc.c | 16 ++-- drivers/char/n_r3964.c | 10 +- drivers/char/pty.c | 8 +- drivers/char/riscom8.c | 8 +- drivers/char/rocket.c | 8 +- drivers/char/serial167.c | 4 +- drivers/char/specialix.c | 10 +- drivers/char/stallion.c | 12 ++-- drivers/char/sx.c | 12 ++-- drivers/char/synclink.c | 10 ++- drivers/char/synclink_gt.c | 8 +- drivers/char/synclinkmp.c | 12 ++-- drivers/char/tty_buffer.c | 2 +- drivers/char/tty_io.c | 123 +++++++++++++++------------ drivers/char/tty_ioctl.c | 36 ++++---- drivers/char/tty_ldisc.c | 53 +++++++----- drivers/char/tty_lock.c | 100 ++++++++++++++++++++++ drivers/char/tty_port.c | 6 +- drivers/char/vc_screen.c | 4 +- drivers/char/vt.c | 4 +- drivers/char/vt_ioctl.c | 12 ++-- drivers/isdn/i4l/isdn_common.c | 20 ++-- drivers/isdn/i4l/isdn_tty.c | 8 +- drivers/net/irda/irtty-sir.c | 5 +- drivers/net/ppp_generic.c | 29 +++--- drivers/serial/68360serial.c | 4 +- drivers/serial/crisv10.c | 8 +- drivers/serial/serial_core.c | 42 +++++----- drivers/staging/strip/strip.c | 2 +- drivers/usb/class/cdc-acm.c | 2 +- drivers/usb/serial/usb-serial.c | 18 ++-- drivers/video/console/vgacon.c | 4 +- include/linux/init_task.h | 1 + include/linux/sched.h | 1 + include/linux/tty.h | 180 +++++++++++++++++++++++++++++++++++++++ kernel/fork.c | 1 + ioctl/llseek pushdown, Kconfig: 43 files changed, 590 insertions(+), 275 deletions(-) Documentation/DocBook/kernel-hacking.tmpl | 2 +- Documentation/filesystems/vfs.txt | 3 +- arch/arm/kernel/etm.c | 1 - arch/cris/arch-v10/drivers/ds1302.c | 3 - arch/cris/arch-v10/drivers/gpio.c | 2 - arch/cris/arch-v10/drivers/i2c.c | 2 - arch/cris/arch-v10/drivers/pcf8563.c | 3 - arch/cris/arch-v10/drivers/sync_serial.c | 4 +- arch/cris/arch-v32/drivers/cryptocop.c | 4 +- arch/cris/arch-v32/drivers/i2c.c | 2 - arch/cris/arch-v32/drivers/mach-a3/gpio.c | 2 - arch/cris/arch-v32/drivers/mach-fs/gpio.c | 2 - arch/cris/arch-v32/drivers/pcf8563.c | 5 +- arch/cris/arch-v32/drivers/sync_serial.c | 4 +- arch/ia64/kernel/perfmon.c | 2 - arch/ia64/sn/kernel/sn2/sn_hwperf.c | 2 - arch/m68k/bvme6000/rtc.c | 2 - arch/m68k/mvme16x/rtc.c | 2 - arch/powerpc/platforms/iseries/Kconfig | 1 - arch/s390/Kconfig | 1 - arch/um/drivers/harddog_kern.c | 2 - arch/um/drivers/hostaudio_kern.c | 3 - arch/um/drivers/mmapper_kern.c | 3 - arch/x86/Kconfig | 3 +- arch/x86/kvm/Kconfig | 1 - drivers/block/DAC960.c | 3 +- drivers/block/Kconfig | 6 +- drivers/block/paride/pg.c | 2 - drivers/block/paride/pt.c | 2 - drivers/block/pktcdvd.c | 3 - drivers/char/Kconfig | 25 +- drivers/char/apm-emulation.c | 2 - drivers/char/applicom.c | 2 - drivers/char/ds1302.c | 1 - drivers/char/ds1620.c | 2 - drivers/char/dtlk.c | 2 - drivers/char/generic_nvram.c | 2 - drivers/char/genrtc.c | 2 - drivers/char/i8k.c | 2 - drivers/char/ip2/ip2main.c | 1 - drivers/char/ipmi/Kconfig | 2 - drivers/char/ipmi/ipmi_devintf.c | 2 - drivers/char/ipmi/ipmi_watchdog.c | 2 - drivers/char/istallion.c | 1 - drivers/char/lp.c | 1 - drivers/char/mmtimer.c | 1 - drivers/char/nwflash.c | 1 - drivers/char/pcmcia/Kconfig | 4 +- drivers/char/raw.c | 4 - drivers/char/rio/rio_linux.c | 1 - drivers/char/stallion.c | 1 - drivers/char/sx.c | 1 - drivers/char/uv_mmtimer.c | 1 - drivers/char/viotape.c | 1 - drivers/crypto/Kconfig | 2 +- drivers/firewire/Kconfig | 1 - drivers/firewire/core-cdev.c | 2 - drivers/gpu/drm/Kconfig | 5 +- drivers/gpu/drm/i810/i810_dma.c | 2 - drivers/gpu/drm/i830/i830_dma.c | 2 - drivers/hid/Kconfig | 2 +- drivers/hid/usbhid/Kconfig | 2 +- drivers/hid/usbhid/hiddev.c | 3 +- drivers/hwmon/Kconfig | 2 +- drivers/hwmon/fschmd.c | 2 - drivers/ide/Kconfig | 1 - drivers/ide/ide-tape.c | 1 - drivers/ieee1394/Kconfig | 6 +- drivers/ieee1394/dv1394.c | 2 - drivers/ieee1394/raw1394.c | 2 - drivers/ieee1394/video1394.c | 4 +- drivers/infiniband/Kconfig | 6 +- drivers/infiniband/core/ucm.c | 2 - drivers/infiniband/core/ucma.c | 2 - drivers/infiniband/core/user_mad.c | 3 - drivers/infiniband/core/uverbs_main.c | 11 +- drivers/input/joystick/Kconfig | 2 +- drivers/input/misc/Kconfig | 13 +- drivers/input/misc/hp_sdc_rtc.c | 2 - drivers/input/misc/uinput.c | 1 - drivers/input/mouse/Kconfig | 4 +- drivers/input/serio/Kconfig | 1 - drivers/input/tablet/Kconfig | 8 +- drivers/input/touchscreen/Kconfig | 2 +- drivers/isdn/Kconfig | 2 - drivers/isdn/capi/Kconfig | 2 +- drivers/isdn/capi/capi.c | 1 - drivers/isdn/divert/divert_procfs.c | 2 - drivers/isdn/hardware/eicon/Kconfig | 2 +- drivers/isdn/hysdn/Kconfig | 2 +- drivers/isdn/i4l/Kconfig | 1 - drivers/isdn/i4l/isdn_common.c | 1 - drivers/isdn/mISDN/Kconfig | 1 - drivers/isdn/mISDN/timerdev.c | 3 - drivers/macintosh/Kconfig | 7 +- drivers/macintosh/ans-lcd.c | 2 - drivers/macintosh/nvram.c | 2 - drivers/macintosh/via-pmu.c | 2 - drivers/media/Kconfig | 5 +- drivers/media/dvb/bt8xx/Kconfig | 2 +- drivers/media/dvb/bt8xx/dst_ca.c | 1 - drivers/media/dvb/dvb-core/dmxdev.c | 3 - drivers/media/dvb/dvb-core/dvb_ca_en50221.c | 3 - drivers/media/dvb/dvb-core/dvb_frontend.c | 5 +- drivers/media/dvb/dvb-core/dvb_net.c | 3 - drivers/media/dvb/firewire/Kconfig | 2 +- drivers/media/dvb/firewire/firedtv-ci.c | 3 - drivers/media/dvb/ttpci/Kconfig | 2 +- drivers/media/dvb/ttpci/av7110.c | 3 - drivers/media/dvb/ttpci/av7110_av.c | 5 - drivers/media/dvb/ttpci/av7110_ca.c | 3 - drivers/media/video/Kconfig | 13 +- drivers/media/video/cpia.c | 2 - drivers/media/video/v4l2-dev.c | 2 - drivers/message/fusion/Kconfig | 2 +- drivers/message/i2o/Kconfig | 2 +- drivers/misc/Kconfig | 2 +- drivers/mtd/Kconfig | 1 - drivers/mtd/mtdchar.c | 1 - drivers/mtd/ubi/Kconfig | 2 +- drivers/mtd/ubi/cdev.c | 2 - drivers/net/Kconfig | 1 - drivers/net/appletalk/Kconfig | 1 - drivers/net/ppp_generic.c | 4 +- drivers/net/wan/Kconfig | 2 +- drivers/net/wireless/Kconfig | 4 +- drivers/net/wireless/airo.c | 9 - drivers/net/wireless/ray_cs.c | 3 - drivers/pci/hotplug/Kconfig | 2 +- drivers/pcmcia/Kconfig | 3 +- drivers/platform/x86/Kconfig | 1 - drivers/pnp/isapnp/Kconfig | 2 +- drivers/rtc/Kconfig | 1 - drivers/rtc/rtc-m41t80.c | 1 - drivers/s390/block/Kconfig | 2 +- drivers/s390/char/Kconfig | 2 +- drivers/s390/char/fs3270.c | 1 - drivers/s390/char/tape_char.c | 2 +- drivers/s390/cio/chsc_sch.c | 2 - drivers/s390/crypto/zcrypt_api.c | 1 - drivers/s390/scsi/zfcp_cfdc.c | 2 - drivers/sbus/char/envctrl.c | 1 - drivers/sbus/char/openprom.c | 1 - drivers/scsi/3w-9xxx.c | 2 - drivers/scsi/3w-sas.c | 2 - drivers/scsi/3w-xxxx.c | 2 - drivers/scsi/Kconfig | 28 +- drivers/scsi/aacraid/linit.c | 1 - drivers/scsi/dpt_i2o.c | 2 - drivers/scsi/gdth.c | 2 - drivers/scsi/megaraid.c | 2 - drivers/scsi/megaraid/Kconfig.megaraid | 6 +- drivers/scsi/megaraid/megaraid_mm.c | 2 - drivers/scsi/megaraid/megaraid_sas.c | 1 - drivers/scsi/mpt2sas/Kconfig | 2 +- drivers/scsi/mpt2sas/mpt2sas_ctl.c | 1 - drivers/scsi/osd/Kconfig | 2 +- drivers/scsi/osd/osd_uld.c | 2 - drivers/scsi/osst.c | 2 - drivers/scsi/pmcraid.c | 2 - drivers/scsi/st.c | 1 - drivers/spi/spidev.c | 2 - drivers/staging/comedi/comedi_fops.c | 2 - drivers/staging/dream/pmem.c | 3 - drivers/staging/dream/qdsp5/audio_aac.c | 2 - drivers/staging/dream/qdsp5/audio_mp3.c | 2 - drivers/staging/poch/poch.c | 3 - drivers/staging/sep/sep_driver.c | 2 - drivers/staging/vme/devices/vme_user.c | 2 - drivers/telephony/Kconfig | 2 +- drivers/telephony/ixj.c | 1 - drivers/usb/Kconfig | 2 +- drivers/usb/class/Kconfig | 1 - drivers/usb/class/usblp.c | 2 - drivers/usb/gadget/Kconfig | 2 - drivers/usb/gadget/printer.c | 1 - drivers/usb/host/Kconfig | 2 +- drivers/usb/misc/Kconfig | 8 +- drivers/usb/misc/idmouse.c | 2 - drivers/usb/misc/iowarrior.c | 1 - drivers/usb/misc/rio500.c | 1 - drivers/usb/misc/sisusbvga/Kconfig | 2 +- fs/adfs/Kconfig | 1 - fs/afs/Kconfig | 1 - fs/autofs/Kconfig | 1 - fs/autofs/root.c | 1 - fs/autofs4/Kconfig | 1 - fs/autofs4/dev-ioctl.c | 2 - fs/btrfs/super.c | 1 - fs/coda/Kconfig | 1 - fs/coda/pioctl.c | 3 - fs/coda/psdev.c | 2 - fs/ecryptfs/Kconfig | 1 - fs/ecryptfs/file.c | 2 - fs/ecryptfs/miscdev.c | 2 - fs/fat/Kconfig | 3 - fs/freevxfs/Kconfig | 1 - fs/hfsplus/Kconfig | 1 - fs/hfsplus/dir.c | 2 - fs/hfsplus/inode.c | 2 - fs/hpfs/Kconfig | 1 - fs/ioctl.c | 11 +- fs/isofs/Kconfig | 1 - fs/jffs2/Kconfig | 1 - fs/ncpfs/Kconfig | 1 - fs/ncpfs/dir.c | 2 - fs/ncpfs/file.c | 1 - fs/nfs/Kconfig | 2 +- fs/nfsd/Kconfig | 1 - fs/ocfs2/Kconfig | 1 - fs/qnx4/Kconfig | 1 - fs/read_write.c | 34 + fs/reiserfs/Kconfig | 1 - fs/smbfs/Kconfig | 1 - fs/smbfs/dir.c | 2 - fs/smbfs/file.c | 1 - fs/squashfs/Kconfig | 1 - fs/udf/Kconfig | 1 - fs/udf/dir.c | 2 - fs/udf/file.c | 1 - fs/ufs/Kconfig | 2 +- include/linux/fs.h | 5 + kernel/power/Kconfig | 2 +- lib/Kconfig.debug | 2 +- lib/kernel_lock.c | 37 +- net/bluetooth/hidp/Kconfig | 1 - net/ipx/Kconfig | 1 - net/irda/Kconfig | 2 +- net/irda/irnet/Kconfig | 2 +- net/socket.c | 1 - net/sunrpc/Kconfig | 4 +- net/wanrouter/Kconfig | 2 +- net/x25/Kconfig | 2 +- sound/Kconfig | 2 +- sound/core/control.c | 2 - sound/core/oss/pcm_oss.c | 2 - sound/core/pcm_native.c | 2 - sound/core/seq/seq_clientmgr.c | 2 - sound/oss/au1550_ac97.c | 30 +- sound/oss/dmasound/dmasound_core.c | 2 - sound/oss/msnd_pinnacle.c | 2 - sound/oss/sh_dac_audio.c | 3 - sound/oss/swarm_cs4297a.c | 3 - sound/oss/vwsnd.c | 2 - sound/soc/soc-core.c | 2 - virt/kvm/kvm_main.c | 1 - 248 files changed, 190 insertions(+), 516 deletions(-) The rest: arch/arm/lib/uaccess_with_memcpy.c | 1 + arch/x86/configs/x86_64_defconfig | 29 +- arch/x86/kernel/microcode_core.c | 6 +- block/bsg.c | 2 - block/compat_ioctl.c | 8 +- block/ioctl.c | 24 +- drivers/block/DAC960.c | 4 +- drivers/block/aoe/aoechr.c | 6 +- drivers/block/cciss.c | 4 +- drivers/block/paride/pg.c | 4 +- drivers/block/paride/pt.c | 16 +- drivers/char/briq_panel.c | 1 + drivers/char/dsp56k.c | 1 + drivers/char/hpet.c | 96 +++-- drivers/char/mwave/mwavedd.c | 1 + drivers/char/nvram.c | 7 +- drivers/char/pcmcia/cm4000_cs.c | 1 + drivers/char/pcmcia/cm4040_cs.c | 1 + drivers/char/random.c | 2 + drivers/char/snsc.c | 1 + drivers/char/tlclk.c | 1 + drivers/char/toshiba.c | 1 + drivers/char/xilinx_hwicap/xilinx_hwicap.c | 1 + drivers/gpu/vga/vgaarb.c | 4 +- drivers/hid/hidraw.c | 1 + drivers/input/serio/serio_raw.c | 1 + drivers/isdn/capi/capifs.c | 10 +- drivers/md/dm-ioctl.c | 2 + drivers/media/dvb/dvb-core/dvbdev.c | 1 + drivers/misc/phantom.c | 1 + drivers/pci/proc.c | 4 +- drivers/pcmcia/pcmcia_ioctl.c | 23 +- drivers/sbus/char/display7seg.c | 1 + drivers/sbus/char/jsflash.c | 20 +- drivers/scsi/aacraid/linit.c | 1 + drivers/scsi/ch.c | 1 + drivers/scsi/sg.c | 22 +- drivers/usb/core/file.c | 1 + drivers/usb/core/inode.c | 5 + drivers/usb/gadget/inode.c | 12 +- drivers/usb/misc/usblcd.c | 1 + drivers/usb/mon/mon_bin.c | 14 +- drivers/watchdog/cpwd.c | 1 + fs/adfs/super.c | 8 +- fs/affs/super.c | 14 +- fs/afs/super.c | 5 + fs/autofs/root.c | 67 +++- fs/autofs4/root.c | 69 +++- fs/bad_inode.c | 4 + fs/bfs/inode.c | 7 +- fs/block_dev.c | 20 +- fs/cifs/cifsfs.c | 9 +- fs/coda/inode.c | 8 +- fs/compat_ioctl.c | 43 +-- fs/ecryptfs/main.c | 4 + fs/exec.c | 6 - fs/exofs/super.c | 1 - fs/ext2/inode.c | 5 +- fs/ext2/super.c | 58 ++- fs/ext3/super.c | 12 - fs/ext4/super.c | 11 - fs/fat/dir.c | 11 +- fs/fat/fat.h | 2 +- fs/fat/file.c | 33 ++- fs/fat/namei_msdos.c | 7 +- fs/fat/namei_vfat.c | 7 +- fs/freevxfs/vxfs_lookup.c | 1 + fs/freevxfs/vxfs_super.c | 7 +- fs/hfs/super.c | 6 +- fs/hfsplus/super.c | 5 - fs/hpfs/super.c | 8 +- fs/hppfs/hppfs.c | 2 +- fs/ioctl.c | 2 + fs/isofs/dir.c | 1 + fs/isofs/inode.c | 8 +- fs/jffs2/super.c | 11 +- fs/jfs/super.c | 22 +- fs/locks.c | 110 +++-- fs/namespace.c | 2 - fs/ncpfs/inode.c | 8 +- fs/nfs/super.c | 24 + fs/nilfs2/ioctl.c | 1 - fs/nilfs2/super.c | 10 - fs/ntfs/super.c | 24 +- fs/ocfs2/stack_user.c | 1 + fs/ocfs2/super.c | 5 + fs/proc/base.c | 10 +- fs/proc/inode.c | 8 +- fs/qnx4/dir.c | 1 + fs/qnx4/inode.c | 8 +- fs/read_write.c | 8 + fs/reiserfs/super.c | 4 + fs/smbfs/inode.c | 5 + fs/squashfs/super.c | 6 + fs/super.c | 3 - fs/udf/super.c | 8 +- fs/ufs/super.c | 5 + include/linux/auto_fs.h | 1 + include/linux/blkdev.h | 6 + include/linux/ext2_fs_sb.h | 6 + include/linux/fs.h | 2 + include/linux/sched.h | 2 + include/linux/smp_lock.h | 57 ++- init/main.c | 5 - kernel/cgroup.c | 4 - kernel/perf_event.c | 2 + kernel/ptrace.c | 10 - kernel/sched.c | 17 + kernel/trace/blktrace.c | 14 +- kernel/trace/trace.c | 8 - lib/Kconfig.debug | 17 + lib/Makefile | 4 + lib/kernel_lock.c | 104 +----- lib/kernel_lock_core.c | 307 +++++++++++++ net/sunrpc/cache.c | 30 +- net/sunrpc/rpc_pipe.c | 9 +- sound/core/timer.c | 5 +- sound/sound_core.c | 1 + virt/kvm/kvm_main.c | 6 + 120 files changed, 1156 insertions(+), 540 deletions(-) --
From: Jiri Kosina Subject: Re: [GIT, RFC] Killing the Big Kernel Lock Date: Mar 25, 5:55 am 2010 On Wed, 24 Mar 2010, Arnd Bergmann wrote: > I've spent some time continuing the work of the people on Cc and many others > to remove the big kernel lock from Linux and I now have bkl-removal branch > in my git tree at git://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git > that lets me run a kernel on my quad-core machine with the only users of the BKL > being mostly obscure device driver modules. config USB tristate "Support for Host-side USB" depends on USB_ARCH_HAS_HCD && BKL Well, that's very interesting definition of "obscure" :) -- Jiri Kosina SUSE Labs, Novell Inc. --
From: Arnd Bergmann Subject: Re: [GIT, RFC] Killing the Big Kernel Lock Date: Mar 25, 6:06 am 2010 On Thursday 25 March 2010, Jiri Kosina wrote: > On Wed, 24 Mar 2010, Arnd Bergmann wrote: > > > I've spent some time continuing the work of the people on Cc and many others > > to remove the big kernel lock from Linux and I now have bkl-removal branch > > in my git tree at git://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git > > that lets me run a kernel on my quad-core machine with the only users of the BKL > > being mostly obscure device driver modules. > > config USB > tristate "Support for Host-side USB" > depends on USB_ARCH_HAS_HCD && BKL > > Well, that's very interesting definition of "obscure" :) > That's why I said /mostly/ obscure modules. There are soundcore, usb-core, drm, vfat and a few other very common ones, along with many obscure ones. Arnd --
From: Andi Kleen Subject: Re: [GIT, RFC] Killing the Big Kernel Lock Date: Mar 28, 2:58 pm 2010 Jiri Kosina <jkosina@suse.cz> writes: > On Wed, 24 Mar 2010, Arnd Bergmann wrote: > >> I've spent some time continuing the work of the people on Cc and many others >> to remove the big kernel lock from Linux and I now have bkl-removal branch >> in my git tree at git://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git >> that lets me run a kernel on my quad-core machine with the only users of the BKL >> being mostly obscure device driver modules. > > config USB > tristate "Support for Host-side USB" > depends on USB_ARCH_HAS_HCD && BKL > > Well, that's very interesting definition of "obscure" :) From a quick grep at least EHCI doesn't seem to need it? Except for those two guys in core/*.c: /* keep API that guarantees BKL */ lock_kernel(); retval = driver->ioctl(intf, ctl->ioctl_code, buf); unlock_kernel(); if (retval == -ENOIOCTLCMD) retval = -ENOTTY; I guess that could be just moved into the low level modules with unlocked_ioctl And one use in the usbfs which seems quite bogus and can be probably removed. -Andi -- ak@linux.intel.com -- Speaking for myself only. --
From: Arnd Bergmann Subject: Re: [GIT, RFC] Killing the Big Kernel Lock Date: Mar 25, 6:38 am 2010 On Thursday 25 March 2010, Arnd Bergmann wrote: > On Thursday 25 March 2010, Jiri Kosina wrote: > > config USB > > tristate "Support for Host-side USB" > > depends on USB_ARCH_HAS_HCD && BKL > > > > Well, that's very interesting definition of "obscure" :) > > > > That's why I said /mostly/ obscure modules. There are soundcore, usb-core, drm, > vfat and a few other very common ones, along with many obscure ones. FWIW, this is the full list of 148 modules that require the BKL in an x86 allmodconfig, which is probably the configuration with the largest code coverage. Arnd sound/soundcore.ko sound/soc/snd-soc-core.ko sound/oss/sound.ko sound/oss/msnd_pinnacle.ko sound/oss/msnd_classic.ko sound/core/snd.ko sound/core/snd-pcm.ko sound/core/seq/snd-seq.ko sound/core/oss/snd-pcm-oss.ko net/x25/x25.ko net/wanrouter/wanrouter.ko net/sunrpc/sunrpc.ko net/irda/irnet/irnet.ko net/irda/irda.ko net/ipx/ipx.ko net/appletalk/appletalk.ko fs/ufs/ufs.ko fs/udf/udf.ko fs/squashfs/squashfs.ko fs/smbfs/smbfs.ko fs/reiserfs/reiserfs.ko fs/qnx4/qnx4.ko fs/ocfs2/ocfs2_stack_user.ko fs/ocfs2/ocfs2.ko fs/nfsd/nfsd.ko fs/nfs/nfs.ko fs/ncpfs/ncpfs.ko fs/lockd/lockd.ko fs/jffs2/jffs2.ko fs/isofs/isofs.ko fs/hpfs/hpfs.ko fs/hfsplus/hfsplus.ko fs/freevxfs/freevxfs.ko fs/fat/vfat.ko fs/fat/msdos.ko fs/fat/fat.ko fs/ecryptfs/ecryptfs.ko fs/coda/coda.ko fs/autofs4/autofs4.ko fs/autofs/autofs.ko fs/afs/kafs.ko fs/adfs/adfs.ko drivers/usb/misc/usblcd.ko drivers/usb/misc/sisusbvga/sisusbvga.ko drivers/usb/misc/rio500.ko drivers/usb/misc/iowarrior.ko drivers/usb/misc/idmouse.ko drivers/usb/host/uhci-hcd.ko drivers/usb/gadget/gadgetfs.ko drivers/usb/gadget/g_printer.ko drivers/usb/core/usbcore.ko drivers/usb/class/usblp.ko drivers/telephony/ixj.ko drivers/scsi/st.ko drivers/scsi/scsi_tgt.ko drivers/scsi/pmcraid.ko drivers/scsi/osst.ko drivers/scsi/osd/osd.ko drivers/scsi/mpt2sas/mpt2sas.ko drivers/scsi/megaraid/megaraid_sas.ko drivers/scsi/megaraid/megaraid_mm.ko drivers/scsi/megaraid.ko drivers/scsi/gdth.ko drivers/scsi/dpt_i2o.ko drivers/scsi/ch.ko drivers/scsi/aacraid/aacraid.ko drivers/scsi/3w-xxxx.ko drivers/scsi/3w-sas.ko drivers/scsi/3w-9xxx.ko drivers/rtc/rtc-m41t80.ko drivers/pci/hotplug/cpqphp.ko drivers/net/wireless/ray_cs.ko drivers/net/wireless/airo.ko drivers/net/wan/cosa.ko drivers/net/ppp_generic.ko drivers/mtd/ubi/ubi.ko drivers/mtd/mtdchar.ko drivers/misc/phantom.ko drivers/message/i2o/i2o_config.ko drivers/message/fusion/mptctl.ko drivers/media/video/zoran/zr36067.ko drivers/media/video/videodev.ko drivers/media/video/usbvision/usbvision.ko drivers/media/video/usbvideo/vicam.ko drivers/media/video/tlg2300/poseidon.ko drivers/media/video/stv680.ko drivers/media/video/stradis.ko drivers/media/video/stkwebcam.ko drivers/media/video/se401.ko drivers/media/video/s2255drv.ko drivers/media/video/pwc/pwc.ko drivers/media/video/dabusb.ko drivers/media/video/cx88/cx8800.ko drivers/media/video/cx88/cx88-blackbird.ko drivers/media/video/cx23885/cx23885.ko drivers/media/video/cpia.ko drivers/media/video/bt8xx/bttv.ko drivers/media/radio/si470x/radio-usb-si470x.ko drivers/media/dvb/ttpci/dvb-ttpci.ko drivers/media/dvb/firewire/firedtv.ko drivers/media/dvb/dvb-core/dvb-core.ko drivers/media/dvb/bt8xx/dst_ca.ko drivers/isdn/mISDN/mISDN_core.ko drivers/isdn/i4l/isdn.ko drivers/isdn/hysdn/hysdn.ko drivers/isdn/hardware/eicon/divas.ko drivers/isdn/hardware/eicon/diva_mnt.ko drivers/isdn/hardware/eicon/diva_idi.ko drivers/isdn/divert/dss1_divert.ko drivers/isdn/capi/capifs.ko drivers/isdn/capi/capi.ko drivers/input/serio/serio_raw.ko drivers/input/misc/uinput.ko drivers/infiniband/core/rdma_ucm.ko drivers/infiniband/core/ib_uverbs.ko drivers/infiniband/core/ib_umad.ko drivers/infiniband/core/ib_ucm.ko drivers/ieee1394/video1394.ko drivers/ieee1394/raw1394.ko drivers/ieee1394/dv1394.ko drivers/ide/ide-tape.ko drivers/hwmon/fschmd.ko drivers/hid/usbhid/usbhid.ko drivers/hid/hid.ko drivers/gpu/drm/i830/i830.ko drivers/gpu/drm/i810/i810.ko drivers/gpu/drm/drm.ko drivers/firewire/firewire-core.ko drivers/char/toshiba.ko drivers/char/tlclk.ko drivers/char/stallion.ko drivers/char/raw.ko drivers/char/ppdev.ko drivers/char/pcmcia/cm4040_cs.ko drivers/char/pcmcia/cm4000_cs.ko drivers/char/mwave/mwave.ko drivers/char/lp.ko drivers/char/istallion.ko drivers/char/ipmi/ipmi_watchdog.ko drivers/char/ipmi/ipmi_devintf.ko drivers/char/ip2/ip2.ko drivers/char/i8k.ko drivers/char/dtlk.ko drivers/char/applicom.ko drivers/block/pktcdvd.ko drivers/block/paride/pt.ko drivers/block/paride/pg.ko drivers/block/DAC960.ko --

It lives!
Oh, Jeremy! I had just about given up on Kerneltrap. Great to see updates!
Indeed
... I've almost given up on kernel trap.
Good to see it up and running again.
- Gilboa
KernelTrap gets updated?!
KernelTrap gets updated?! What is this, an April Fools joke?
I hope not! :)
out with BKL?
april 1
The BKL removal is no joke
LWN had an article covering the same (but covering different aspects of it) a couple days ago. This article's legit. :-)
I like having both KT and LWN handy, since they give me different perspectives. Welcome back, KT!
yay!
news again! :)
many thanks Jeremy!