annotating the remaining BKL users
Subsystems (33)
Arnd Bergmann
maintainerRFC 1/1 annotating the remaining BKL users
With all the patches we have queued in the BKL removal tree, only a few dozen modules are left that actually rely on the BKL, and even there are lots of low-hanging fruit. We need to decide what to do about them, this patch illustrates one of the options:
Every user of the BKL is marked as 'depends on BKL' in Kconfig, and the CONFIG_BKL becomes a user-visible option. If it gets disabled, no BKL using module can be built any more and the BKL code itself is compiled out.
Eventually, I hope that all code that people care about gets rid of the BKL and we can toss the rest into drivers/staging and delete it some time later.
As an alternative to this patch, we could just mark all these modules as "select BKL" in Kconfig and not make it the option user-visible.
I'd like to hear preferences for one approach or the other, especially from Linus, so we can give this some better testing in -next before the merge window.
--- arch/alpha/Kconfig | 1 + arch/cris/Kconfig | 1 + arch/m68k/Kconfig | 1 + arch/parisc/Kconfig | 1 + arch/sh/Kconfig | 1 + arch/sparc/Kconfig | 1 + arch/um/Kconfig.common | 1 + drivers/char/Kconfig | 4 ++-- drivers/gpu/drm/Kconfig | 3 ++- drivers/isdn/Kconfig | 1 + drivers/isdn/capi/Kconfig | 2 +- drivers/isdn/mISDN/Kconfig | 1 + drivers/media/Kconfig | 3 ++- drivers/message/i2o/Kconfig | 2 +- drivers/misc/Kconfig | 2 +- drivers/net/appletalk/Kconfig | 1 + drivers/s390/block/Kconfig | 2 +- drivers/sbus/char/Kconfig | 2 +- drivers/staging/cx25821/Kconfig | 2 +- drivers/staging/easycap/Kconfig | 2 +- drivers/staging/go7007/Kconfig | 2 +- drivers/staging/hv/Kconfig | 2 +- drivers/staging/spectra/Kconfig | 2 +- drivers/staging/usbip/Kconfig | 2 +- drivers/usb/gadget/Kconfig | 2 +- fs/adfs/Kconfig | 1 + fs/afs/Kconfig | 1 + fs/autofs/Kconfig | 1 + fs/autofs4/Kconfig | 1 + fs/ceph/Kconfig | 2 +- fs/coda/Kconfig | 1 + fs/ecryptfs/Kconfig | 1 + fs/fat/Kconfig | 2 ++ fs/freevxfs/Kconfig | 1 + fs/hpfs/Kconfig | 1 + fs/isofs/Kconfig | 1 + fs/jffs2/Kconfig | 1 + fs/ncpfs/Kconfig | 1 + fs/nfs/Kconfig | 2 +- fs/nfsd/Kconfig | 1 + fs/ocfs2/Kconfig | 1 + fs/qnx4/Kconfig | 1 + fs/reiserfs/Kconfig | 1 + fs/smbfs/Kconfig | 1 + fs/squashfs/Kconfig | 2 +- fs/udf/Kconfig | 1 + fs/ufs/Kconfig | 2 +- include/linux/smp_lock.h | 7 +++++-- init/Kconfig | 2 +- kernel/trace/Kconfig | 1 + lib/Kconfig.debug | 11 ++++++++++- net/ipx/Kconfig | 1 + net/irda/Kconfig | 2 +- net/irda/irnet/Kconfig | 2 +- net/x25/Kconfig | 2 +- 55 files changed, 72 insertions(+), 27 deletions(-)
arch/alpha/Kconfig +1 -0
@@ -11,6 +11,7 @@ config ALPHA select HAVE_SYSCALL_WRAPPERS select HAVE_PERF_EVENTS select HAVE_DMA_ATTRS + select BKL help The Alpha is a 64-bit general-purpose processor designed and marketed by the Digital Equipment Corporation of blessed memory,
arch/cris/Kconfig +1 -0
@@ -61,6 +61,7 @@ config CRIS bool default y select HAVE_IDE + select BKL config HZ int
arch/m68k/Kconfig +1 -0
@@ -8,6 +8,7 @@ config M68K select HAVE_AOUT select HAVE_IDE select GENERIC_ATOMIC64 + select BKL config MMU bool
arch/parisc/Kconfig +1 -0
@@ -17,6 +17,7 @@ config PARISC select INIT_ALL_POSSIBLE select BUG select HAVE_PERF_EVENTS + select BKL select GENERIC_ATOMIC64 if !64BIT help The PA-RISC microprocessor is designed by Hewlett-Packard and used
arch/sh/Kconfig +1 -0
@@ -26,6 +26,7 @@ config SUPERH select HAVE_REGS_AND_STACK_ACCESS_API select RTC_LIB select GENERIC_ATOMIC64 + select BKL help The SuperH is a RISC processor targeted for use in embedded systems and consumer electronics; it was also used in the Sega Dreamcast
arch/sparc/Kconfig +1 -0
@@ -33,6 +33,7 @@ config SPARC config SPARC32 def_bool !64BIT + select BKL config SPARC64 def_bool 64BIT
arch/um/Kconfig.common +1 -0
@@ -10,6 +10,7 @@ config GENERIC_HARDIRQS config UML bool + select BKL default y config MMU
drivers/char/Kconfig +2 -2
@@ -1049,7 +1049,7 @@ config CS5535_GPIO config RAW_DRIVER tristate "RAW driver (/dev/raw/rawN)" - depends on BLOCK + depends on BLOCK && BKL help The raw driver permits block devices to be bound to /dev/raw/rawN. Once bound, I/O against /dev/raw/rawN uses efficient zero-copy I/O.
@@ -1117,7 +1117,7 @@ source "drivers/char/tpm/Kconfig" config TELCLOCK tristate "Telecom clock driver for ATCA SBC" - depends on EXPERIMENTAL && X86 + depends on EXPERIMENTAL && X86 && BKL default n help The telecom clock device is specific to the MPCBL0010 and MPCBL0050
drivers/gpu/drm/Kconfig +2 -1
@@ -73,7 +73,7 @@ source "drivers/gpu/drm/radeon/Kconfig" config DRM_I810 tristate "Intel I810" - depends on DRM && AGP && AGP_INTEL + depends on DRM && AGP && AGP_INTEL && BKL help Choose this option if you have an Intel I810 graphics card. If M is selected, the module will be called i810. AGP support is required
@@ -86,6 +86,7 @@ choice config DRM_I830 tristate "i830 driver" + depends on BKL help Choose this option if you have a system that has Intel 830M, 845G, 852GM, 855GM or 865G integrated graphics. If M is selected, the
drivers/isdn/Kconfig +1 -0
@@ -22,6 +22,7 @@ if ISDN menuconfig ISDN_I4L tristate "Old ISDN4Linux (deprecated)" + depends on BKL ---help--- This driver allows you to use an ISDN adapter for networking connections and as dialin/out device. The isdn-tty's have a built
drivers/isdn/capi/Kconfig +1 -1
@@ -35,7 +35,7 @@ config ISDN_CAPI_CAPI20 config ISDN_CAPI_CAPIFS_BOOL bool "CAPI2.0 filesystem support (DEPRECATED)" - depends on ISDN_CAPI_MIDDLEWARE && ISDN_CAPI_CAPI20 + depends on ISDN_CAPI_MIDDLEWARE && ISDN_CAPI_CAPI20 && BKL help This option provides a special file system, similar to /dev/pts with device nodes for the special ttys established by using the
drivers/isdn/mISDN/Kconfig +1 -0
@@ -4,6 +4,7 @@ menuconfig MISDN tristate "Modular ISDN driver" + depends on BKL help Enable support for the modular ISDN driver.
drivers/media/Kconfig +2 -1
@@ -19,6 +19,7 @@ comment "Multimedia core support" config VIDEO_DEV tristate "Video For Linux" + depends on BKL ---help--- V4L core support for video capture and overlay devices, webcams and AM/FM radio cards.
@@ -75,7 +76,7 @@ config VIDEO_V4L1_COMPAT config DVB_CORE tristate "DVB for Linux" - depends on NET && INET + depends on NET && INET && BKL select CRC32 help DVB core utility functions for device handling, software fallbacks etc.
drivers/message/i2o/Kconfig +1 -1
@@ -85,7 +85,7 @@ config I2O_BUS config I2O_BLOCK tristate "I2O Block OSM" - depends on BLOCK + depends on BLOCK && BKL ---help--- Include support for the I2O Block OSM. The Block OSM presents disk and other structured block devices to the operating system. If you
drivers/misc/Kconfig +1 -1
@@ -263,7 +263,7 @@ config HP_ILO config SGI_GRU tristate "SGI GRU driver" - depends on X86_UV && SMP + depends on X86_UV && SMP && BKL default n select MMU_NOTIFIER ---help---
drivers/net/appletalk/Kconfig +1 -0
@@ -3,6 +3,7 @@ # config ATALK tristate "Appletalk protocol support" + depends on BKL select LLC ---help--- AppleTalk is the protocol that Apple computers can use to communicate
drivers/s390/block/Kconfig +1 -1
@@ -19,7 +19,7 @@ config DCSSBLK config DASD tristate "Support for DASD devices" - depends on CCW && BLOCK + depends on CCW && BLOCK && BKL select IOSCHED_DEADLINE help Enable this option if you want to access DASDs directly utilizing
drivers/sbus/char/Kconfig +1 -1
@@ -31,7 +31,7 @@ config TADPOLE_TS102_UCTRL config SUN_JSFLASH tristate "JavaStation OS Flash SIMM (EXPERIMENTAL)" - depends on EXPERIMENTAL && SPARC32 + depends on EXPERIMENTAL && SPARC32 && BKL help If you say Y here, you will be able to boot from your JavaStation's Flash memory.
drivers/staging/cx25821/Kconfig +1 -1
@@ -1,6 +1,6 @@ config VIDEO_CX25821 tristate "Conexant cx25821 support" - depends on DVB_CORE && VIDEO_DEV && PCI && I2C && INPUT + depends on DVB_CORE && VIDEO_DEV && PCI && I2C && INPUT && BKL select I2C_ALGOBIT select VIDEO_BTCX select VIDEO_TVEEPROM
drivers/staging/easycap/Kconfig +1 -1
@@ -1,6 +1,6 @@ config EASYCAP tristate "EasyCAP USB ID 05e1:0408 support" - depends on USB && VIDEO_DEV + depends on USB && VIDEO_DEV && BKL ---help--- This is an integrated audio/video driver for EasyCAP cards with
drivers/staging/go7007/Kconfig +1 -1
@@ -1,6 +1,6 @@ config VIDEO_GO7007 tristate "WIS GO7007 MPEG encoder support" - depends on VIDEO_DEV && PCI && I2C && INPUT + depends on VIDEO_DEV && PCI && I2C && INPUT && BKL depends on SND select VIDEOBUF_DMA_SG select VIDEO_IR
drivers/staging/hv/Kconfig +1 -1
@@ -10,7 +10,7 @@ if HYPERV config HYPERV_STORAGE tristate "Microsoft Hyper-V virtual storage driver" - depends on SCSI + depends on SCSI && BKL default HYPERV help Select this option to enable the Hyper-V virtual storage driver.
drivers/staging/spectra/Kconfig +1 -1
@@ -1,7 +1,7 @@ menuconfig SPECTRA tristate "Denali Spectra Flash Translation Layer" - depends on BLOCK + depends on BLOCK && BKL depends on X86_MRST default n ---help---
drivers/staging/usbip/Kconfig +1 -1
@@ -1,6 +1,6 @@ config USB_IP_COMMON tristate "USB IP support (EXPERIMENTAL)" - depends on USB && NET && EXPERIMENTAL + depends on USB && NET && EXPERIMENTAL && BKL default N ---help--- This enables pushing USB packets over IP to allow remote
drivers/usb/gadget/Kconfig +1 -1
@@ -697,7 +697,7 @@ config USB_ETH_EEM config USB_GADGETFS tristate "Gadget Filesystem (EXPERIMENTAL)" - depends on EXPERIMENTAL + depends on EXPERIMENTAL && BKL help This driver provides a filesystem based API that lets user mode programs implement a single-configuration USB device, including
fs/adfs/Kconfig +1 -0
@@ -1,6 +1,7 @@ config ADFS_FS tristate "ADFS file system support (EXPERIMENTAL)" depends on BLOCK && EXPERIMENTAL + depends on BKL help The Acorn Disc Filing System is the standard file system of the RiscOS operating system which runs on Acorn's ARM-based Risc PC
fs/afs/Kconfig +1 -0
@@ -1,6 +1,7 @@ config AFS_FS tristate "Andrew File System support (AFS) (EXPERIMENTAL)" depends on INET && EXPERIMENTAL + depends on BKL select AF_RXRPC select DNS_RESOLVER help
fs/autofs/Kconfig +1 -0
@@ -1,5 +1,6 @@ config AUTOFS_FS tristate "Kernel automounter support" + depends on BKL help The automounter is a tool to automatically mount remote file systems on demand. This implementation is partially kernel-based to reduce
fs/autofs4/Kconfig +1 -0
@@ -1,5 +1,6 @@ config AUTOFS4_FS tristate "Kernel automounter version 4 support (also supports v3)" + depends on BKL help The automounter is a tool to automatically mount remote file systems on demand. This implementation is partially kernel-based to reduce
fs/ceph/Kconfig +1 -1
@@ -1,6 +1,6 @@ config CEPH_FS tristate "Ceph distributed file system (EXPERIMENTAL)" - depends on INET && EXPERIMENTAL + depends on INET && EXPERIMENTAL && BKL select LIBCRC32C select CRYPTO_AES help
fs/coda/Kconfig +1 -0
@@ -1,6 +1,7 @@ config CODA_FS tristate "Coda file system support (advanced network fs)" depends on INET + depends on BKL help Coda is an advanced network file system, similar to NFS in that it enables you to mount file systems of a remote server and access them
fs/ecryptfs/Kconfig +1 -0
@@ -1,6 +1,7 @@ config ECRYPT_FS tristate "eCrypt filesystem layer support (EXPERIMENTAL)" depends on EXPERIMENTAL && KEYS && CRYPTO + depends on BKL select CRYPTO_ECB select CRYPTO_CBC select CRYPTO_MD5
fs/fat/Kconfig +2 -0
@@ -34,6 +34,7 @@ config FAT_FS config MSDOS_FS tristate "MSDOS fs support" + depends on BKL select FAT_FS help This allows you to mount MSDOS partitions of your hard drive (unless
@@ -59,6 +60,7 @@ config MSDOS_FS config VFAT_FS tristate "VFAT (Windows-95) fs support" + depends on BKL select FAT_FS help This option provides support for normal Windows file systems with
fs/freevxfs/Kconfig +1 -0
@@ -1,6 +1,7 @@ config VXFS_FS tristate "FreeVxFS file system support (VERITAS VxFS(TM) compatible)" depends on BLOCK + depends on BKL help FreeVxFS is a file system driver that support the VERITAS VxFS(TM) file system format. VERITAS VxFS(TM) is the standard file system
fs/hpfs/Kconfig +1 -0
@@ -1,6 +1,7 @@ config HPFS_FS tristate "OS/2 HPFS file system support" depends on BLOCK + depends on BKL help OS/2 is IBM's operating system for PC's, the same as Warp, and HPFS is the file system used for organizing files on OS/2 hard disk
fs/isofs/Kconfig +1 -0
@@ -1,5 +1,6 @@ config ISO9660_FS tristate "ISO 9660 CDROM file system support" + depends on BKL help This is the standard file system used on CD-ROMs. It was previously known as "High Sierra File System" and is called "hsfs" on other
fs/jffs2/Kconfig +1 -0
@@ -1,6 +1,7 @@ config JFFS2_FS tristate "Journalling Flash File System v2 (JFFS2) support" select CRC32 + depends on BKL depends on MTD help JFFS2 is the second generation of the Journalling Flash File System
fs/ncpfs/Kconfig +1 -0
@@ -3,6 +3,7 @@ # config NCP_FS tristate "NCP file system support (to mount NetWare volumes)" + depends on BKL depends on IPX!=n || INET help NCP (NetWare Core Protocol) is a protocol that runs over IPX and is
fs/nfs/Kconfig +1 -1
@@ -1,6 +1,6 @@ config NFS_FS tristate "NFS client support" - depends on INET && FILE_LOCKING + depends on INET && FILE_LOCKING && BKL select LOCKD select SUNRPC select NFS_ACL_SUPPORT if NFS_V3_ACL
fs/nfsd/Kconfig +1 -0
@@ -2,6 +2,7 @@ config NFSD tristate "NFS server support" depends on INET depends on FILE_LOCKING + depends on BKL select LOCKD select SUNRPC select EXPORTFS
fs/ocfs2/Kconfig +1 -0
@@ -1,5 +1,6 @@ config OCFS2_FS tristate "OCFS2 file system support" + depends on BKL depends on NET && SYSFS select CONFIGFS_FS select JBD2
fs/qnx4/Kconfig +1 -0
@@ -1,5 +1,6 @@ config QNX4FS_FS tristate "QNX4 file system support (read only)" + depends on BKL depends on BLOCK help This is the file system used by the real-time operating systems
fs/reiserfs/Kconfig +1 -0
@@ -1,5 +1,6 @@ config REISERFS_FS tristate "Reiserfs support" + depends on BKL select CRC32 help Stores not just filenames but the files themselves in a balanced
fs/smbfs/Kconfig +1 -0
@@ -1,5 +1,6 @@ config SMB_FS tristate "SMB file system support (OBSOLETE, please use CIFS)" + depends on BKL depends on INET select NLS help
fs/squashfs/Kconfig +1 -1
@@ -1,6 +1,6 @@ config SQUASHFS tristate "SquashFS 4.0 - Squashed file system support" - depends on BLOCK + depends on BLOCK && BKL select ZLIB_INFLATE help Saying Y here includes support for SquashFS 4.0 (a Compressed
fs/udf/Kconfig +1 -0
@@ -1,5 +1,6 @@ config UDF_FS tristate "UDF file system support" + depends on BKL select CRC_ITU_T help This is the new file system used on some CD-ROMs and DVDs. Say Y if
fs/ufs/Kconfig +1 -1
@@ -1,6 +1,6 @@ config UFS_FS tristate "UFS file system support (read only)" - depends on BLOCK + depends on BLOCK && BKL help BSD and derivate versions of Unix (such as SunOS, FreeBSD, NetBSD, OpenBSD and NeXTstep) use a file system called UFS. Some System V
include/linux/smp_lock.h +5 -2
@@ -54,12 +54,15 @@ static inline void cycle_kernel_lock(void)#else +#ifdef CONFIG_BKL /* provoke build bug if not set */ #define lock_kernel ()#define unlock_kernel () -#define release_kernel_lock (task) do { } while(0)#define cycle_kernel_lock () do { } while(0) -#define reacquire_kernel_lock (task) 0#define kernel_locked () 1 +#endif /* CONFIG_BKL */ + +#define release_kernel_lock (task) do { } while(0) +#define reacquire_kernel_lock (task) 0#endif /* CONFIG_LOCK_KERNEL */ #endif /* __LINUX_SMPLOCK_H */
init/Kconfig +1 -1
@@ -64,7 +64,7 @@ config BROKEN_ON_SMP config LOCK_KERNEL bool - depends on SMP || PREEMPT + depends on (SMP || PREEMPT) && BKL default y config INIT_ENV_ARG_LIMIT
kernel/trace/Kconfig +1 -0
@@ -327,6 +327,7 @@ config BLK_DEV_IO_TRACE bool "Support for tracing block IO actions" depends on SYSFS depends on BLOCK + depends on BKL select RELAY select DEBUG_FS select TRACEPOINTS
lib/Kconfig.debug +10 -1
@@ -441,7 +441,7 @@ config DEBUG_PI_LIST config RT_MUTEX_TESTER bool "Built-in scriptable tester for rt-mutexes" - depends on DEBUG_KERNEL && RT_MUTEXES + depends on DEBUG_KERNEL && RT_MUTEXES && BKL = y help This option enables a rt-mutex tester.
@@ -461,6 +461,15 @@ 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
net/ipx/Kconfig +1 -0
@@ -3,6 +3,7 @@ # config IPX tristate "The IPX protocol" + depends on BKL select LLC ---help--- This is support for the Novell networking protocol, IPX, commonly
net/irda/Kconfig +1 -1
@@ -3,7 +3,7 @@ # menuconfig IRDA - depends on NET && !S390 + depends on NET && !S390 && BKL tristate "IrDA (infrared) subsystem support" select CRC_CCITT ---help---
net/irda/irnet/Kconfig +1 -1
@@ -1,6 +1,6 @@ config IRNET tristate "IrNET protocol" - depends on IRDA && PPP + depends on IRDA && PPP && BKL help Say Y here if you want to build support for the IrNET protocol. To compile it as a module, choose M here: the module will be
net/x25/Kconfig +1 -1
@@ -4,7 +4,7 @@ config X25 tristate "CCITT X.25 Packet Layer (EXPERIMENTAL)" - depends on EXPERIMENTAL + depends on EXPERIMENTAL && BKL ---help--- X.25 is a set of standardized network protocols, similar in scope to frame relay; the one physical line from your box to the X.25 network
Signature · 1 line
1.7.1
Quoted 4 lines · Arnd Bergmann
I'd like to hear preferences for one approach or the other, especially from Linus, so we can give this some better testing in -next before the merge window.
Hmm. I like your patch. It seems to have a good balance of "select BKL" (for architectures that require it for some reason) and "depends on BKL" (for individual modules).
That said, I'd also like to see a comment _why_ the architectures in question depends on the BKL. Some of those look pretty historical (the sparc32 register window spill code? Does it _really_ need the BKL at all, or is that just a remnant of "let's get the BKL at each kernel entry").
So with the added rule that "each select BKL needs a quick comment why", I'd be happy with it. And maybe it would make people take a second look.
Linus
David Miller
maintainerFrom: Linus Torvalds <[email protected]>
Date: Wed, 8 Sep 2010 17:20:57 -0700
Quoted 5 lines
That said, I'd also like to see a comment _why_ the architectures in question depends on the BKL. Some of those look pretty historical (the sparc32 register window spill code? Does it _really_ need the BKL at all, or is that just a remnant of "let's get the BKL at each kernel entry").
It probably doesn't or can be trivially removed.
I'll have a go at this.
Arnd Bergmann
maintainerQuoted 9 lines · Linus Torvalds
Quoted 4 lines · Arnd Bergmann
I'd like to hear preferences for one approach or the other, especially from Linus, so we can give this some better testing in -next before the merge window.
Hmm. I like your patch. It seems to have a good balance of "select BKL" (for architectures that require it for some reason) and "depends on BKL" (for individual modules).
Actually, I was using "select" only for the cases where there is no other option, like architectures that unconditionally reuire it.
Quoted 5 lines
That said, I'd also like to see a comment _why_ the architectures in question depends on the BKL. Some of those look pretty historical (the sparc32 register window spill code? Does it _really_ need the BKL at all, or is that just a remnant of "let's get the BKL at each kernel entry").
Right. I'm pretty sure we can trivially fix all the arch code, I just had no incentive to start that yet and instead did the annotations.
Quoted 3 lines
So with the added rule that "each select BKL needs a quick comment why", I'd be happy with it. And maybe it would make people take a second look.
Ok. Making people take a look was also a reason why I posted this patch separately. I might actually add comments to all of the "depends on BKL" as well to make it clear which category they all fall into and motivate janitors to take care of the easy ones.
As mentioned in another thread, the only nontrivial ones besides fs/{locks.c,lockd} (which we need to fix before the BKL can become optional) are probably:
drivers/{media,staging,usb/gadget,char/raw} fs/{autofs,coda,hpfs,isofs,ncpfs,nfs,smbfs,udf,ufs} net/{appletalk,ipx,irda,ax25}
Arnd