]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'config' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 22 Oct 2010 17:43:11 +0000 (10:43 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 22 Oct 2010 17:43:11 +0000 (10:43 -0700)
* 'config' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl:
  BKL: introduce CONFIG_BKL.
  dabusb: remove the BKL
  sunrpc: remove the big kernel lock
  init/main.c: remove BKL notations
  blktrace: remove the big kernel lock
  rtmutex-tester: make it build without BKL
  dvb-core: kill the big kernel lock
  dvb/bt8xx: kill the big kernel lock
  tlclk: remove big kernel lock
  fix rawctl compat ioctls breakage on amd64 and itanic
  uml: kill big kernel lock
  parisc: remove big kernel lock
  cris: autoconvert trivial BKL users
  alpha: kill big kernel lock
  isapnp: BKL removal
  s390/block: kill the big kernel lock
  hpet: kill BKL, add compat_ioctl

1  2 
arch/um/drivers/hostaudio_kern.c
arch/um/drivers/ubd_kern.c
arch/um/kernel/exec.c
fs/nfs/Kconfig
fs/nfsd/Kconfig
init/Kconfig
init/main.c
lib/Kconfig.debug
net/sunrpc/rpc_pipe.c

index 63c740a85b4cca0ed9333091593885cbdfface2e,d92ff6d602972a3865e456c7ac6f6d67a3179901..f9f6a4e205901ee603d56d0167fb3c6e0807e868
@@@ -8,7 -8,7 +8,7 @@@
  #include "linux/slab.h"
  #include "linux/sound.h"
  #include "linux/soundcard.h"
- #include "linux/smp_lock.h"
+ #include "linux/mutex.h"
  #include "asm/uaccess.h"
  #include "init.h"
  #include "os.h"
@@@ -40,11 -40,6 +40,11 @@@ static char *mixer = HOSTAUDIO_DEV_MIXE
  "    This is used to specify the host mixer device to the hostaudio driver.\n"\
  "    The default is \"" HOSTAUDIO_DEV_MIXER "\".\n\n"
  
 +module_param(dsp, charp, 0644);
 +MODULE_PARM_DESC(dsp, DSP_HELP);
 +module_param(mixer, charp, 0644);
 +MODULE_PARM_DESC(mixer, MIXER_HELP);
 +
  #ifndef MODULE
  static int set_dsp(char *name, int *add)
  {
@@@ -61,8 -56,19 +61,10 @@@ static int set_mixer(char *name, int *a
  }
  
  __uml_setup("mixer=", set_mixer, "mixer=<mixer device>\n" MIXER_HELP);
 -
 -#else /*MODULE*/
 -
 -module_param(dsp, charp, 0644);
 -MODULE_PARM_DESC(dsp, DSP_HELP);
 -
 -module_param(mixer, charp, 0644);
 -MODULE_PARM_DESC(mixer, MIXER_HELP);
 -
  #endif
  
+ static DEFINE_MUTEX(hostaudio_mutex);
  /* /dev/dsp file operations */
  
  static ssize_t hostaudio_read(struct file *file, char __user *buffer,
@@@ -198,9 -204,9 +200,9 @@@ static int hostaudio_open(struct inode 
                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) {
@@@ -259,9 -265,9 +261,9 @@@ static int hostmixer_open_mixdev(struc
                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) {
index 9734994cba1e86c53f60dead72952f7feb3ab02d,0c053607ce98b63362f6ac75b7e1e9df9d11f189..ba4a98ba39c0322989f32deaf36f7df990cd61f9
@@@ -33,7 -33,7 +33,7 @@@
  #include "linux/mm.h"
  #include "linux/slab.h"
  #include "linux/vmalloc.h"
- #include "linux/smp_lock.h"
+ #include "linux/mutex.h"
  #include "linux/blkpg.h"
  #include "linux/genhd.h"
  #include "linux/spinlock.h"
@@@ -100,6 -100,7 +100,7 @@@ static inline void ubd_set_bit(__u64 bi
  #define DRIVER_NAME "uml-blkdev"
  
  static DEFINE_MUTEX(ubd_lock);
+ static DEFINE_MUTEX(ubd_mutex); /* replaces BKL, might not be needed */
  
  static int ubd_open(struct block_device *bdev, fmode_t mode);
  static int ubd_release(struct gendisk *disk, fmode_t mode);
@@@ -163,7 -164,6 +164,7 @@@ struct ubd 
        struct scatterlist sg[MAX_SG];
        struct request *request;
        int start_sg, end_sg;
 +      sector_t rq_pos;
  };
  
  #define DEFAULT_COW { \
        .request =              NULL, \
        .start_sg =             0, \
        .end_sg =               0, \
 +      .rq_pos =               0, \
  }
  
  /* Protected by ubd_lock */
@@@ -1101,7 -1100,7 +1102,7 @@@ static int ubd_open(struct block_devic
        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){
                err = -EROFS;
        }*/
  out:
-       unlock_kernel();
+       mutex_unlock(&ubd_mutex);
        return err;
  }
  
@@@ -1128,10 -1127,10 +1129,10 @@@ static int ubd_release(struct gendisk *
  {
        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;
  }
  
@@@ -1230,6 -1229,7 +1231,6 @@@ static void do_ubd_request(struct reque
  {
        struct io_thread_req *io_req;
        struct request *req;
 -      sector_t sector;
        int n;
  
        while(1){
                                return;
  
                        dev->request = req;
 +                      dev->rq_pos = blk_rq_pos(req);
                        dev->start_sg = 0;
                        dev->end_sg = blk_rq_map_sg(q, req, dev->sg);
                }
  
                req = dev->request;
 -              sector = blk_rq_pos(req);
                while(dev->start_sg < dev->end_sg){
                        struct scatterlist *sg = &dev->sg[dev->start_sg];
  
                                return;
                        }
                        prepare_request(req, io_req,
 -                                      (unsigned long long)sector << 9,
 +                                      (unsigned long long)dev->rq_pos << 9,
                                        sg->offset, sg->length, sg_page(sg));
  
 -                      sector += sg->length >> 9;
                        n = os_write_file(thread_fd, &io_req,
                                          sizeof(struct io_thread_req *));
                        if(n != sizeof(struct io_thread_req *)){
                                return;
                        }
  
 +                      dev->rq_pos += sg->length >> 9;
                        dev->start_sg++;
                }
                dev->end_sg = 0;
diff --combined arch/um/kernel/exec.c
index 49b5e1eb32622abbdab4b3631207460bc80a1e14,460ce86f4019d11791da552c22b4292ebda3ed00..340268be00b5a934f6fc3ac632c26e53b58623ec
@@@ -62,7 -62,7 +62,7 @@@ static long execve1(const char *file
        return error;
  }
  
 -long um_execve(const char *file, char __user *__user *argv, char __user *__user *env)
 +long um_execve(const char *file, const char __user *const __user *argv, const char __user *const __user *env)
  {
        long err;
  
        return err;
  }
  
 -long sys_execve(const char __user *file, char __user *__user *argv,
 -              char __user *__user *env)
 +long sys_execve(const char __user *file, const char __user *const __user *argv,
 +              const char __user *const __user *env)
  {
        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;
  }
diff --combined fs/nfs/Kconfig
index f7e13db613cbce9a3014b826c9d00414169f4de8,10b9524bb90848952600917d56ca3412d48faa01..b950415d7c4340b0bb30da28cbb6e96c1a011826
@@@ -1,6 -1,7 +1,7 @@@
  config NFS_FS
        tristate "NFS client support"
        depends on INET && FILE_LOCKING
+       depends on BKL # fix as soon as lockd is done
        select LOCKD
        select SUNRPC
        select NFS_ACL_SUPPORT if NFS_V3_ACL
@@@ -63,7 -64,6 +64,7 @@@ config NFS_V3_AC
  config NFS_V4
        bool "NFS client support for NFS version 4"
        depends on NFS_FS
 +      select SUNRPC_GSS
        help
          This option enables support for version 4 of the NFS protocol
          (RFC 3530) in the kernel's NFS client.
diff --combined fs/nfsd/Kconfig
index 4264377552e207f57550b9e72d53776e0689ca81,429d4a14227688940f7a0395d171fc0506e173e8..7cf4ddafb4abc3b0ae4f511bb0d264eab0f563d4
@@@ -2,6 -2,7 +2,7 @@@ config NFS
        tristate "NFS server support"
        depends on INET
        depends on FILE_LOCKING
+       depends on BKL # fix as soon as lockd is done
        select LOCKD
        select SUNRPC
        select EXPORTFS
@@@ -69,7 -70,6 +70,7 @@@ config NFSD_V
        depends on NFSD && PROC_FS && EXPERIMENTAL
        select NFSD_V3
        select FS_POSIX_ACL
 +      select SUNRPC_GSS
        help
          This option enables support in your system's NFS server for
          version 4 of the NFS protocol (RFC 3530).
diff --combined init/Kconfig
index 36890f0c8456db1eb212abc46a876e145fa8e0ca,2005a1d499280b162e84cb5a960d747bb4d972b7..be85a0ab1b822176b4c715266adfea779035af70
@@@ -21,13 -21,6 +21,13 @@@ config CONSTRUCTOR
        depends on !UML
        default y
  
 +config HAVE_IRQ_WORK
 +      bool
 +
 +config IRQ_WORK
 +      bool
 +      depends on HAVE_IRQ_WORK
 +
  menu "General setup"
  
  config EXPERIMENTAL
@@@ -71,7 -64,7 +71,7 @@@ config BROKEN_ON_SM
  
  config LOCK_KERNEL
        bool
-       depends on SMP || PREEMPT
+       depends on (SMP || PREEMPT) && BKL
        default y
  
  config INIT_ENV_ARG_LIMIT
@@@ -339,8 -332,6 +339,8 @@@ config AUDIT_TRE
        depends on AUDITSYSCALL
        select FSNOTIFY
  
 +source "kernel/irq/Kconfig"
 +
  menu "RCU Subsystem"
  
  choice
  
  config TREE_RCU
        bool "Tree-based hierarchical RCU"
 +      depends on !PREEMPT && SMP
        help
          This option selects the RCU implementation that is
          designed for very large SMP system with hundreds or
          smaller systems.
  
  config TREE_PREEMPT_RCU
 -      bool "Preemptable tree-based hierarchical RCU"
 +      bool "Preemptible tree-based hierarchical RCU"
        depends on PREEMPT
        help
          This option selects the RCU implementation that is
@@@ -375,22 -365,8 +375,22 @@@ config TINY_RC
          is not required.  This option greatly reduces the
          memory footprint of RCU.
  
 +config TINY_PREEMPT_RCU
 +      bool "Preemptible UP-only small-memory-footprint RCU"
 +      depends on !SMP && PREEMPT
 +      help
 +        This option selects the RCU implementation that is designed
 +        for real-time UP systems.  This option greatly reduces the
 +        memory footprint of RCU.
 +
  endchoice
  
 +config PREEMPT_RCU
 +      def_bool ( TREE_PREEMPT_RCU || TINY_PREEMPT_RCU )
 +      help
 +        This option enables preemptible-RCU code that is common between
 +        the TREE_PREEMPT_RCU and TINY_PREEMPT_RCU implementations.
 +
  config RCU_TRACE
        bool "Enable tracing for RCU"
        depends on TREE_RCU || TREE_PREEMPT_RCU
@@@ -411,12 -387,9 +411,12 @@@ config RCU_FANOU
        help
          This option controls the fanout of hierarchical implementations
          of RCU, allowing RCU to work efficiently on machines with
 -        large numbers of CPUs.  This value must be at least the cube
 -        root of NR_CPUS, which allows NR_CPUS up to 32,768 for 32-bit
 -        systems and up to 262,144 for 64-bit systems.
 +        large numbers of CPUs.  This value must be at least the fourth
 +        root of NR_CPUS, which allows NR_CPUS to be insanely large.
 +        The default value of RCU_FANOUT should be used for production
 +        systems, but if you are stress-testing the RCU implementation
 +        itself, small RCU_FANOUT values allow you to test large-system
 +        code paths on small(er) systems.
  
          Select a specific number if testing RCU itself.
          Take the default if unsure.
@@@ -1014,7 -987,6 +1014,7 @@@ config PERF_EVENT
        default y if (PROFILING || PERF_COUNTERS)
        depends on HAVE_PERF_EVENTS
        select ANON_INODES
 +      select IRQ_WORK
        help
          Enable kernel support for various performance events provided
          by software and hardware.
diff --combined init/main.c
index 9684c9670b48ef2157919ea97bea37c81e32f2f8,cb0b927c101a35a252ec084c3bb59e376c9ca0b9..e59af24a0b7c0dbb8417ff3b5c0818d544ac8060
@@@ -424,7 -424,6 +424,6 @@@ static void __init setup_command_line(c
  static __initdata DECLARE_COMPLETION(kthreadd_done);
  
  static noinline void __init_refok rest_init(void)
-       __releases(kernel_lock)
  {
        int pid;
  
@@@ -556,6 -555,7 +555,6 @@@ asmlinkage void __init start_kernel(voi
  
        local_irq_disable();
        early_boot_irqs_off();
 -      early_init_irq_lock_class();
  
  /*
   * Interrupts are still disabled. Do necessary setups, then
@@@ -818,7 -818,6 +817,6 @@@ static void run_init_process(const cha
   * makes it inline to init() and it becomes part of init.text section
   */
  static noinline int init_post(void)
-       __releases(kernel_lock)
  {
        /* need to finish all async __init code before freeing the memory */
        async_synchronize_full();
diff --combined lib/Kconfig.debug
index 21ac83070a805030150bab1a229be48c3f79485a,088eea1c2bef2058fb147366c4a812f5f0de2334..7b2a8ca97ada66b90c786c69bd44dc71b84c492c
@@@ -461,6 -461,15 +461,15 @@@ config DEBUG_MUTEXE
         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
@@@ -482,7 -491,6 +491,7 @@@ config PROVE_LOCKIN
        select DEBUG_SPINLOCK
        select DEBUG_MUTEXES
        select DEBUG_LOCK_ALLOC
 +      select TRACE_IRQFLAGS
        default n
        help
         This feature enables the kernel to prove that all locking
@@@ -540,23 -548,6 +549,23 @@@ config PROVE_RCU_REPEATEDL
         disabling, allowing multiple RCU-lockdep warnings to be printed
         on a single reboot.
  
 +       Say Y to allow multiple RCU-lockdep warnings per boot.
 +
 +       Say N if you are unsure.
 +
 +config SPARSE_RCU_POINTER
 +      bool "RCU debugging: sparse-based checks for pointer usage"
 +      default n
 +      help
 +       This feature enables the __rcu sparse annotation for
 +       RCU-protected pointers.  This annotation will cause sparse
 +       to flag any non-RCU used of annotated pointers.  This can be
 +       helpful when debugging RCU usage.  Please note that this feature
 +       is not intended to enforce code cleanliness; it is instead merely
 +       a debugging aid.
 +
 +       Say Y to make sparse flag questionable use of RCU-protected pointers
 +
         Say N if you are unsure.
  
  config LOCKDEP
@@@ -597,10 -588,11 +606,10 @@@ config DEBUG_LOCKDE
          of more runtime overhead.
  
  config TRACE_IRQFLAGS
 -      depends on DEBUG_KERNEL
        bool
 -      default y
 -      depends on TRACE_IRQFLAGS_SUPPORT
 -      depends on PROVE_LOCKING
 +      help
 +        Enables hooks to interrupt enabling and disabling for
 +        either tracing or lock debugging.
  
  config DEBUG_SPINLOCK_SLEEP
        bool "Spinlock debugging: sleep-inside-spinlock checking"
@@@ -849,30 -841,6 +858,30 @@@ config RCU_CPU_STALL_DETECTO
  
          Say Y if you are unsure.
  
 +config RCU_CPU_STALL_TIMEOUT
 +      int "RCU CPU stall timeout in seconds"
 +      depends on RCU_CPU_STALL_DETECTOR
 +      range 3 300
 +      default 60
 +      help
 +        If a given RCU grace period extends more than the specified
 +        number of seconds, a CPU stall warning is printed.  If the
 +        RCU grace period persists, additional CPU stall warnings are
 +        printed at more widely spaced intervals.
 +
 +config RCU_CPU_STALL_DETECTOR_RUNNABLE
 +      bool "RCU CPU stall checking starts automatically at boot"
 +      depends on RCU_CPU_STALL_DETECTOR
 +      default y
 +      help
 +        If set, start checking for RCU CPU stalls immediately on
 +        boot.  Otherwise, RCU CPU stall checking must be manually
 +        enabled.
 +
 +        Say Y if you are unsure.
 +
 +        Say N if you wish to suppress RCU CPU stall checking during boot.
 +
  config RCU_CPU_STALL_VERBOSE
        bool "Print additional per-task information for RCU_CPU_STALL_DETECTOR"
        depends on RCU_CPU_STALL_DETECTOR && TREE_PREEMPT_RCU
diff --combined net/sunrpc/rpc_pipe.c
index 8c8eef2b8f26a205bef37706b900c6936a492ed8,1e97d8610291ad89148478e88660cfc6d216339d..28bcd52e3ce97428c296989cdb637d71f31a6693
@@@ -27,7 -27,6 +27,6 @@@
  #include <linux/workqueue.h>
  #include <linux/sunrpc/rpc_pipe_fs.h>
  #include <linux/sunrpc/cache.h>
- #include <linux/smp_lock.h>
  
  static struct vfsmount *rpc_mount __read_mostly;
  static int rpc_mount_count;
@@@ -48,7 -47,7 +47,7 @@@ static void rpc_purge_list(struct rpc_i
                return;
        do {
                msg = list_entry(head->next, struct rpc_pipe_msg, list);
 -              list_del(&msg->list);
 +              list_del_init(&msg->list);
                msg->errno = err;
                destroy_msg(msg);
        } while (!list_empty(head));
@@@ -208,7 -207,7 +207,7 @@@ rpc_pipe_release(struct inode *inode, s
        if (msg != NULL) {
                spin_lock(&inode->i_lock);
                msg->errno = -EAGAIN;
 -              list_del(&msg->list);
 +              list_del_init(&msg->list);
                spin_unlock(&inode->i_lock);
                rpci->ops->destroy_msg(msg);
        }
@@@ -268,7 -267,7 +267,7 @@@ rpc_pipe_read(struct file *filp, char _
        if (res < 0 || msg->len == msg->copied) {
                filp->private_data = NULL;
                spin_lock(&inode->i_lock);
 -              list_del(&msg->list);
 +              list_del_init(&msg->list);
                spin_unlock(&inode->i_lock);
                rpci->ops->destroy_msg(msg);
        }
@@@ -309,40 -308,33 +308,33 @@@ rpc_pipe_poll(struct file *filp, struc
        return mask;
  }
  
- static int
- rpc_pipe_ioctl_unlocked(struct file *filp, unsigned int cmd, unsigned long arg)
+ static long
+ rpc_pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
  {
-       struct rpc_inode *rpci = RPC_I(filp->f_path.dentry->d_inode);
+       struct inode *inode = filp->f_path.dentry->d_inode;
+       struct rpc_inode *rpci = RPC_I(inode);
        int len;
  
        switch (cmd) {
        case FIONREAD:
-               if (rpci->ops == NULL)
+               spin_lock(&inode->i_lock);
+               if (rpci->ops == NULL) {
+                       spin_unlock(&inode->i_lock);
                        return -EPIPE;
+               }
                len = rpci->pipelen;
                if (filp->private_data) {
                        struct rpc_pipe_msg *msg;
                        msg = (struct rpc_pipe_msg *)filp->private_data;
                        len += msg->len - msg->copied;
                }
+               spin_unlock(&inode->i_lock);
                return put_user(len, (int __user *)arg);
        default:
                return -EINVAL;
        }
  }
  
- static long
- rpc_pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
- {
-       long ret;
-       lock_kernel();
-       ret = rpc_pipe_ioctl_unlocked(filp, cmd, arg);
-       unlock_kernel();
-       return ret;
- }
  static const struct file_operations rpc_pipe_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
@@@ -371,23 -363,21 +363,23 @@@ rpc_show_info(struct seq_file *m, void 
  static int
  rpc_info_open(struct inode *inode, struct file *file)
  {
 -      struct rpc_clnt *clnt;
 +      struct rpc_clnt *clnt = NULL;
        int ret = single_open(file, rpc_show_info, NULL);
  
        if (!ret) {
                struct seq_file *m = file->private_data;
 -              mutex_lock(&inode->i_mutex);
 -              clnt = RPC_I(inode)->private;
 -              if (clnt) {
 -                      kref_get(&clnt->cl_kref);
 +
 +              spin_lock(&file->f_path.dentry->d_lock);
 +              if (!d_unhashed(file->f_path.dentry))
 +                      clnt = RPC_I(inode)->private;
 +              if (clnt != NULL && atomic_inc_not_zero(&clnt->cl_count)) {
 +                      spin_unlock(&file->f_path.dentry->d_lock);
                        m->private = clnt;
                } else {
 +                      spin_unlock(&file->f_path.dentry->d_lock);
                        single_release(inode, file);
                        ret = -EINVAL;
                }
 -              mutex_unlock(&inode->i_mutex);
        }
        return ret;
  }