Merge git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/sysctl-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 8 Dec 2009 15:38:50 +0000 (07:38 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 8 Dec 2009 15:38:50 +0000 (07:38 -0800)
* git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/sysctl-2.6: (43 commits)
  security/tomoyo: Remove now unnecessary handling of security_sysctl.
  security/tomoyo: Add a special case to handle accesses through the internal proc mount.
  sysctl: Drop & in front of every proc_handler.
  sysctl: Remove CTL_NONE and CTL_UNNUMBERED
  sysctl: kill dead ctl_handler definitions.
  sysctl: Remove the last of the generic binary sysctl support
  sysctl net: Remove unused binary sysctl code
  sysctl security/tomoyo: Don't look at ctl_name
  sysctl arm: Remove binary sysctl support
  sysctl x86: Remove dead binary sysctl support
  sysctl sh: Remove dead binary sysctl support
  sysctl powerpc: Remove dead binary sysctl support
  sysctl ia64: Remove dead binary sysctl support
  sysctl s390: Remove dead sysctl binary support
  sysctl frv: Remove dead binary sysctl support
  sysctl mips/lasat: Remove dead binary sysctl support
  sysctl drivers: Remove dead binary sysctl support
  sysctl crypto: Remove dead binary sysctl support
  sysctl security/keys: Remove dead binary sysctl support
  sysctl kernel: Remove binary sysctl logic
  ...

12 files changed:
1  2 
drivers/md/md.c
fs/quota/dquot.c
init/Kconfig
kernel/Makefile
kernel/sched.c
kernel/slow-work.c
kernel/sysctl.c
lib/Kconfig.debug
net/core/sysctl_net_core.c
net/ipv4/ip_fragment.c
net/netfilter/nf_log.c
security/tomoyo/realpath.c

diff --combined drivers/md/md.c
@@@ -98,44 -98,40 +98,40 @@@ static struct ctl_table_header *raid_ta
  
  static ctl_table raid_table[] = {
        {
-               .ctl_name       = DEV_RAID_SPEED_LIMIT_MIN,
                .procname       = "speed_limit_min",
                .data           = &sysctl_speed_limit_min,
                .maxlen         = sizeof(int),
                .mode           = S_IRUGO|S_IWUSR,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = DEV_RAID_SPEED_LIMIT_MAX,
                .procname       = "speed_limit_max",
                .data           = &sysctl_speed_limit_max,
                .maxlen         = sizeof(int),
                .mode           = S_IRUGO|S_IWUSR,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
-       { .ctl_name = 0 }
+       { }
  };
  
  static ctl_table raid_dir_table[] = {
        {
-               .ctl_name       = DEV_RAID,
                .procname       = "raid",
                .maxlen         = 0,
                .mode           = S_IRUGO|S_IXUGO,
                .child          = raid_table,
        },
-       { .ctl_name = 0 }
+       { }
  };
  
  static ctl_table raid_root_table[] = {
        {
-               .ctl_name       = CTL_DEV,
                .procname       = "dev",
                .maxlen         = 0,
                .mode           = 0555,
                .child          = raid_dir_table,
        },
-       { .ctl_name = 0 }
+       {  }
  };
  
  static const struct block_device_operations md_fops;
@@@ -944,14 -940,6 +940,14 @@@ static int super_90_validate(mddev_t *m
                            desc->raid_disk < mddev->raid_disks */) {
                        set_bit(In_sync, &rdev->flags);
                        rdev->raid_disk = desc->raid_disk;
 +              } else if (desc->state & (1<<MD_DISK_ACTIVE)) {
 +                      /* active but not in sync implies recovery up to
 +                       * reshape position.  We don't know exactly where
 +                       * that is, so set to zero for now */
 +                      if (mddev->minor_version >= 91) {
 +                              rdev->recovery_offset = 0;
 +                              rdev->raid_disk = desc->raid_disk;
 +                      }
                }
                if (desc->state & (1<<MD_DISK_WRITEMOSTLY))
                        set_bit(WriteMostly, &rdev->flags);
@@@ -1040,19 -1028,8 +1036,19 @@@ static void super_90_sync(mddev_t *mdde
        list_for_each_entry(rdev2, &mddev->disks, same_set) {
                mdp_disk_t *d;
                int desc_nr;
 -              if (rdev2->raid_disk >= 0 && test_bit(In_sync, &rdev2->flags)
 -                  && !test_bit(Faulty, &rdev2->flags))
 +              int is_active = test_bit(In_sync, &rdev2->flags);
 +
 +              if (rdev2->raid_disk >= 0 &&
 +                  sb->minor_version >= 91)
 +                      /* we have nowhere to store the recovery_offset,
 +                       * but if it is not below the reshape_position,
 +                       * we can piggy-back on that.
 +                       */
 +                      is_active = 1;
 +              if (rdev2->raid_disk < 0 ||
 +                  test_bit(Faulty, &rdev2->flags))
 +                      is_active = 0;
 +              if (is_active)
                        desc_nr = rdev2->raid_disk;
                else
                        desc_nr = next_spare++;
                d->number = rdev2->desc_nr;
                d->major = MAJOR(rdev2->bdev->bd_dev);
                d->minor = MINOR(rdev2->bdev->bd_dev);
 -              if (rdev2->raid_disk >= 0 && test_bit(In_sync, &rdev2->flags)
 -                  && !test_bit(Faulty, &rdev2->flags))
 +              if (is_active)
                        d->raid_disk = rdev2->raid_disk;
                else
                        d->raid_disk = rdev2->desc_nr; /* compatibility */
                if (test_bit(Faulty, &rdev2->flags))
                        d->state = (1<<MD_DISK_FAULTY);
 -              else if (test_bit(In_sync, &rdev2->flags)) {
 +              else if (is_active) {
                        d->state = (1<<MD_DISK_ACTIVE);
 -                      d->state |= (1<<MD_DISK_SYNC);
 +                      if (test_bit(In_sync, &rdev2->flags))
 +                              d->state |= (1<<MD_DISK_SYNC);
                        active++;
                        working++;
                } else {
@@@ -1401,6 -1378,8 +1397,6 @@@ static void super_1_sync(mddev_t *mddev
  
        if (rdev->raid_disk >= 0 &&
            !test_bit(In_sync, &rdev->flags)) {
 -              if (mddev->curr_resync_completed > rdev->recovery_offset)
 -                      rdev->recovery_offset = mddev->curr_resync_completed;
                if (rdev->recovery_offset > 0) {
                        sb->feature_map |=
                                cpu_to_le32(MD_FEATURE_RECOVERY_OFFSET);
@@@ -1934,14 -1913,6 +1930,14 @@@ static void sync_sbs(mddev_t * mddev, i
         */
        mdk_rdev_t *rdev;
  
 +      /* First make sure individual recovery_offsets are correct */
 +      list_for_each_entry(rdev, &mddev->disks, same_set) {
 +              if (rdev->raid_disk >= 0 &&
 +                  !test_bit(In_sync, &rdev->flags) &&
 +                  mddev->curr_resync_completed > rdev->recovery_offset)
 +                              rdev->recovery_offset = mddev->curr_resync_completed;
 +
 +      }       
        list_for_each_entry(rdev, &mddev->disks, same_set) {
                if (rdev->sb_events == mddev->events ||
                    (nospares &&
diff --combined fs/quota/dquot.c
  #include <linux/capability.h>
  #include <linux/quotaops.h>
  #include <linux/writeback.h> /* for inode_lock, oddly enough.. */
 -#ifdef CONFIG_QUOTA_NETLINK_INTERFACE
 -#include <net/netlink.h>
 -#include <net/genetlink.h>
 -#endif
  
  #include <asm/uaccess.h>
  
@@@ -1067,6 -1071,73 +1067,6 @@@ static void print_warning(struct dquot 
  }
  #endif
  
 -#ifdef CONFIG_QUOTA_NETLINK_INTERFACE
 -
 -/* Netlink family structure for quota */
 -static struct genl_family quota_genl_family = {
 -      .id = GENL_ID_GENERATE,
 -      .hdrsize = 0,
 -      .name = "VFS_DQUOT",
 -      .version = 1,
 -      .maxattr = QUOTA_NL_A_MAX,
 -};
 -
 -/* Send warning to userspace about user which exceeded quota */
 -static void send_warning(const struct dquot *dquot, const char warntype)
 -{
 -      static atomic_t seq;
 -      struct sk_buff *skb;
 -      void *msg_head;
 -      int ret;
 -      int msg_size = 4 * nla_total_size(sizeof(u32)) +
 -                     2 * nla_total_size(sizeof(u64));
 -
 -      /* We have to allocate using GFP_NOFS as we are called from a
 -       * filesystem performing write and thus further recursion into
 -       * the fs to free some data could cause deadlocks. */
 -      skb = genlmsg_new(msg_size, GFP_NOFS);
 -      if (!skb) {
 -              printk(KERN_ERR
 -                "VFS: Not enough memory to send quota warning.\n");
 -              return;
 -      }
 -      msg_head = genlmsg_put(skb, 0, atomic_add_return(1, &seq),
 -                      &quota_genl_family, 0, QUOTA_NL_C_WARNING);
 -      if (!msg_head) {
 -              printk(KERN_ERR
 -                "VFS: Cannot store netlink header in quota warning.\n");
 -              goto err_out;
 -      }
 -      ret = nla_put_u32(skb, QUOTA_NL_A_QTYPE, dquot->dq_type);
 -      if (ret)
 -              goto attr_err_out;
 -      ret = nla_put_u64(skb, QUOTA_NL_A_EXCESS_ID, dquot->dq_id);
 -      if (ret)
 -              goto attr_err_out;
 -      ret = nla_put_u32(skb, QUOTA_NL_A_WARNING, warntype);
 -      if (ret)
 -              goto attr_err_out;
 -      ret = nla_put_u32(skb, QUOTA_NL_A_DEV_MAJOR,
 -              MAJOR(dquot->dq_sb->s_dev));
 -      if (ret)
 -              goto attr_err_out;
 -      ret = nla_put_u32(skb, QUOTA_NL_A_DEV_MINOR,
 -              MINOR(dquot->dq_sb->s_dev));
 -      if (ret)
 -              goto attr_err_out;
 -      ret = nla_put_u64(skb, QUOTA_NL_A_CAUSED_ID, current_uid());
 -      if (ret)
 -              goto attr_err_out;
 -      genlmsg_end(skb, msg_head);
 -
 -      genlmsg_multicast(skb, 0, quota_genl_family.id, GFP_NOFS);
 -      return;
 -attr_err_out:
 -      printk(KERN_ERR "VFS: Not enough space to compose quota message!\n");
 -err_out:
 -      kfree_skb(skb);
 -}
 -#endif
  /*
   * Write warnings to the console and send warning messages over netlink.
   *
   */
  static void flush_warnings(struct dquot *const *dquots, char *warntype)
  {
 +      struct dquot *dq;
        int i;
  
 -      for (i = 0; i < MAXQUOTAS; i++)
 -              if (dquots[i] && warntype[i] != QUOTA_NL_NOWARN &&
 -                  !warning_issued(dquots[i], warntype[i])) {
 +      for (i = 0; i < MAXQUOTAS; i++) {
 +              dq = dquots[i];
 +              if (dq && warntype[i] != QUOTA_NL_NOWARN &&
 +                  !warning_issued(dq, warntype[i])) {
  #ifdef CONFIG_PRINT_QUOTA_WARNING
 -                      print_warning(dquots[i], warntype[i]);
 -#endif
 -#ifdef CONFIG_QUOTA_NETLINK_INTERFACE
 -                      send_warning(dquots[i], warntype[i]);
 +                      print_warning(dq, warntype[i]);
  #endif
 +                      quota_send_warning(dq->dq_type, dq->dq_id,
 +                                         dq->dq_sb->s_dev, warntype[i]);
                }
 +      }
  }
  
  static int ignore_hardlimit(struct dquot *dquot)
@@@ -2404,100 -2473,89 +2404,89 @@@ const struct quotactl_ops vfs_quotactl_
  
  static ctl_table fs_dqstats_table[] = {
        {
-               .ctl_name       = FS_DQ_LOOKUPS,
                .procname       = "lookups",
                .data           = &dqstats.lookups,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = FS_DQ_DROPS,
                .procname       = "drops",
                .data           = &dqstats.drops,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = FS_DQ_READS,
                .procname       = "reads",
                .data           = &dqstats.reads,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = FS_DQ_WRITES,
                .procname       = "writes",
                .data           = &dqstats.writes,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = FS_DQ_CACHE_HITS,
                .procname       = "cache_hits",
                .data           = &dqstats.cache_hits,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = FS_DQ_ALLOCATED,
                .procname       = "allocated_dquots",
                .data           = &dqstats.allocated_dquots,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = FS_DQ_FREE,
                .procname       = "free_dquots",
                .data           = &dqstats.free_dquots,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = FS_DQ_SYNCS,
                .procname       = "syncs",
                .data           = &dqstats.syncs,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #ifdef CONFIG_PRINT_QUOTA_WARNING
        {
-               .ctl_name       = FS_DQ_WARNINGS,
                .procname       = "warnings",
                .data           = &flag_print_warnings,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
-       { .ctl_name = 0 },
+       { },
  };
  
  static ctl_table fs_table[] = {
        {
-               .ctl_name       = FS_DQSTATS,
                .procname       = "quota",
                .mode           = 0555,
                .child          = fs_dqstats_table,
        },
-       { .ctl_name = 0 },
+       { },
  };
  
  static ctl_table sys_table[] = {
        {
-               .ctl_name       = CTL_FS,
                .procname       = "fs",
                .mode           = 0555,
                .child          = fs_table,
        },
-       { .ctl_name = 0 },
+       { },
  };
  
  static int __init dquot_init(void)
  
        register_shrinker(&dqcache_shrinker);
  
 -#ifdef CONFIG_QUOTA_NETLINK_INTERFACE
 -      if (genl_register_family(&quota_genl_family) != 0)
 -              printk(KERN_ERR
 -                     "VFS: Failed to create quota netlink interface.\n");
 -#endif
 -
        return 0;
  }
  module_init(dquot_init);
diff --combined init/Kconfig
@@@ -334,15 -334,6 +334,15 @@@ config TREE_PREEMPT_RC
          is also required.  It also scales down nicely to
          smaller systems.
  
 +config TINY_RCU
 +      bool "UP-only small-memory-footprint RCU"
 +      depends on !SMP
 +      help
 +        This option selects the RCU implementation that is
 +        designed for UP systems from which real-time response
 +        is not required.  This option greatly reduces the
 +        memory footprint of RCU.
 +
  endchoice
  
  config RCU_TRACE
@@@ -615,7 -606,7 +615,7 @@@ config SYSFS_DEPRECATE
        bool
  
  config SYSFS_DEPRECATED_V2
 -      bool "remove sysfs features which may confuse old userspace tools"
 +      bool "enable deprecated sysfs features which may confuse old userspace tools"
        depends on SYSFS
        default n
        select SYSFS_DEPRECATED
@@@ -763,6 -754,7 +763,7 @@@ config UID1
  
  config SYSCTL_SYSCALL
        bool "Sysctl syscall support" if EMBEDDED
+       depends on PROC_SYSCTL
        default y
        select SYSCTL
        ---help---
@@@ -1107,16 -1099,6 +1108,16 @@@ config SLOW_WOR
  
          See Documentation/slow-work.txt.
  
 +config SLOW_WORK_DEBUG
 +      bool "Slow work debugging through debugfs"
 +      default n
 +      depends on SLOW_WORK && DEBUG_FS
 +      help
 +        Display the contents of the slow work run queue through debugfs,
 +        including items currently executing.
 +
 +        See Documentation/slow-work.txt.
 +
  endmenu               # General setup
  
  config HAVE_GENERIC_DMA_COHERENT
@@@ -1229,4 -1211,3 +1230,4 @@@ source "block/Kconfig
  config PREEMPT_NOTIFIERS
        bool
  
 +source "kernel/Kconfig.locks"
diff --combined kernel/Makefile
@@@ -4,7 -4,7 +4,7 @@@
  
  obj-y     = sched.o fork.o exec_domain.o panic.o printk.o \
            cpu.o exit.o itimer.o time.o softirq.o resource.o \
-           sysctl.o capability.o ptrace.o timer.o user.o \
+           sysctl.o sysctl_binary.o capability.o ptrace.o timer.o user.o \
            signal.o sys.o kmod.o workqueue.o pid.o \
            rcupdate.o extable.o params.o posix-timers.o \
            kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
@@@ -21,7 -21,6 +21,7 @@@ CFLAGS_REMOVE_mutex-debug.o = -p
  CFLAGS_REMOVE_rtmutex-debug.o = -pg
  CFLAGS_REMOVE_cgroup-debug.o = -pg
  CFLAGS_REMOVE_sched_clock.o = -pg
 +CFLAGS_REMOVE_perf_event.o = -pg
  endif
  
  obj-$(CONFIG_FREEZER) += freezer.o
@@@ -83,7 -82,6 +83,7 @@@ obj-$(CONFIG_RCU_TORTURE_TEST) += rcuto
  obj-$(CONFIG_TREE_RCU) += rcutree.o
  obj-$(CONFIG_TREE_PREEMPT_RCU) += rcutree.o
  obj-$(CONFIG_TREE_RCU_TRACE) += rcutree_trace.o
 +obj-$(CONFIG_TINY_RCU) += rcutiny.o
  obj-$(CONFIG_RELAY) += relay.o
  obj-$(CONFIG_SYSCTL) += utsname_sysctl.o
  obj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o
@@@ -96,9 -94,7 +96,9 @@@ obj-$(CONFIG_X86_DS) += trace
  obj-$(CONFIG_RING_BUFFER) += trace/
  obj-$(CONFIG_SMP) += sched_cpupri.o
  obj-$(CONFIG_SLOW_WORK) += slow-work.o
 +obj-$(CONFIG_SLOW_WORK_DEBUG) += slow-work-debugfs.o
  obj-$(CONFIG_PERF_EVENTS) += perf_event.o
 +obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
  
  ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y)
  # According to Alan Modra <alan@linuxcare.com.au>, the -fno-omit-frame-pointer is
diff --combined kernel/sched.c
@@@ -535,12 -535,14 +535,12 @@@ struct rq 
        #define CPU_LOAD_IDX_MAX 5
        unsigned long cpu_load[CPU_LOAD_IDX_MAX];
  #ifdef CONFIG_NO_HZ
 -      unsigned long last_tick_seen;
        unsigned char in_nohz_recently;
  #endif
        /* capture load from *all* tasks on this cpu: */
        struct load_weight load;
        unsigned long nr_load_updates;
        u64 nr_switches;
 -      u64 nr_migrations_in;
  
        struct cfs_rq cfs;
        struct rt_rq rt;
  
        u64 rt_avg;
        u64 age_stamp;
 +      u64 idle_stamp;
 +      u64 avg_idle;
  #endif
  
        /* calc_load related fields */
@@@ -772,7 -772,7 +772,7 @@@ sched_feat_write(struct file *filp, con
        if (!sched_feat_names[i])
                return -EINVAL;
  
 -      filp->f_pos += cnt;
 +      *ppos += cnt;
  
        return cnt;
  }
@@@ -2017,7 -2017,6 +2017,7 @@@ void kthread_bind(struct task_struct *p
        }
  
        spin_lock_irqsave(&rq->lock, flags);
 +      update_rq_clock(rq);
        set_task_cpu(p, cpu);
        p->cpus_allowed = cpumask_of_cpu(cpu);
        p->rt.nr_cpus_allowed = 1;
@@@ -2079,6 -2078,7 +2079,6 @@@ void set_task_cpu(struct task_struct *p
  #endif
        if (old_cpu != new_cpu) {
                p->se.nr_migrations++;
 -              new_rq->nr_migrations_in++;
  #ifdef CONFIG_SCHEDSTATS
                if (task_hot(p, old_rq->clock, NULL))
                        schedstat_inc(p, se.nr_forced2_migrations);
@@@ -2115,7 -2115,6 +2115,7 @@@ migrate_task(struct task_struct *p, in
         * it is sufficient to simply update the task's cpu field.
         */
        if (!p->se.on_rq && !task_running(rq, p)) {
 +              update_rq_clock(rq);
                set_task_cpu(p, dest_cpu);
                return 0;
        }
@@@ -2377,15 -2376,14 +2377,15 @@@ static int try_to_wake_up(struct task_s
        task_rq_unlock(rq, &flags);
  
        cpu = p->sched_class->select_task_rq(p, SD_BALANCE_WAKE, wake_flags);
 -      if (cpu != orig_cpu)
 +      if (cpu != orig_cpu) {
 +              local_irq_save(flags);
 +              rq = cpu_rq(cpu);
 +              update_rq_clock(rq);
                set_task_cpu(p, cpu);
 -
 +              local_irq_restore(flags);
 +      }
        rq = task_rq_lock(p, &flags);
  
 -      if (rq != orig_rq)
 -              update_rq_clock(rq);
 -
        WARN_ON(p->state != TASK_WAKING);
        cpu = task_cpu(p);
  
@@@ -2442,17 -2440,6 +2442,17 @@@ out_running
  #ifdef CONFIG_SMP
        if (p->sched_class->task_wake_up)
                p->sched_class->task_wake_up(rq, p);
 +
 +      if (unlikely(rq->idle_stamp)) {
 +              u64 delta = rq->clock - rq->idle_stamp;
 +              u64 max = 2*sysctl_sched_migration_cost;
 +
 +              if (delta > max)
 +                      rq->avg_idle = max;
 +              else
 +                      update_avg(&rq->avg_idle, delta);
 +              rq->idle_stamp = 0;
 +      }
  #endif
  out:
        task_rq_unlock(rq, &flags);
@@@ -2558,7 -2545,6 +2558,7 @@@ static void __sched_fork(struct task_st
  void sched_fork(struct task_struct *p, int clone_flags)
  {
        int cpu = get_cpu();
 +      unsigned long flags;
  
        __sched_fork(p);
  
  #ifdef CONFIG_SMP
        cpu = p->sched_class->select_task_rq(p, SD_BALANCE_FORK, 0);
  #endif
 +      local_irq_save(flags);
 +      update_rq_clock(cpu_rq(cpu));
        set_task_cpu(p, cpu);
 +      local_irq_restore(flags);
  
  #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
        if (likely(sched_info_on()))
@@@ -2865,14 -2848,14 +2865,14 @@@ context_switch(struct rq *rq, struct ta
         */
        arch_start_context_switch(prev);
  
 -      if (unlikely(!mm)) {
 +      if (likely(!mm)) {
                next->active_mm = oldmm;
                atomic_inc(&oldmm->mm_count);
                enter_lazy_tlb(oldmm, next);
        } else
                switch_mm(oldmm, mm, next);
  
 -      if (unlikely(!prev->mm)) {
 +      if (likely(!prev->mm)) {
                prev->active_mm = NULL;
                rq->prev_mm = oldmm;
        }
@@@ -3035,6 -3018,15 +3035,6 @@@ static void calc_load_account_active(st
  }
  
  /*
 - * Externally visible per-cpu scheduler statistics:
 - * cpu_nr_migrations(cpu) - number of migrations into that cpu
 - */
 -u64 cpu_nr_migrations(int cpu)
 -{
 -      return cpu_rq(cpu)->nr_migrations_in;
 -}
 -
 -/*
   * Update rq->cpu_load[] statistics. This function is usually called every
   * scheduler tick (TICK_NSEC).
   */
@@@ -4134,7 -4126,7 +4134,7 @@@ static int load_balance(int this_cpu, s
        unsigned long flags;
        struct cpumask *cpus = __get_cpu_var(load_balance_tmpmask);
  
 -      cpumask_setall(cpus);
 +      cpumask_copy(cpus, cpu_online_mask);
  
        /*
         * When power savings policy is enabled for the parent domain, idle
@@@ -4297,7 -4289,7 +4297,7 @@@ load_balance_newidle(int this_cpu, stru
        int all_pinned = 0;
        struct cpumask *cpus = __get_cpu_var(load_balance_tmpmask);
  
 -      cpumask_setall(cpus);
 +      cpumask_copy(cpus, cpu_online_mask);
  
        /*
         * When power savings policy is enabled for the parent domain, idle
@@@ -4437,11 -4429,6 +4437,11 @@@ static void idle_balance(int this_cpu, 
        int pulled_task = 0;
        unsigned long next_balance = jiffies + HZ;
  
 +      this_rq->idle_stamp = this_rq->clock;
 +
 +      if (this_rq->avg_idle < sysctl_sched_migration_cost)
 +              return;
 +
        for_each_domain(this_cpu, sd) {
                unsigned long interval;
  
                interval = msecs_to_jiffies(sd->balance_interval);
                if (time_after(next_balance, sd->last_balance + interval))
                        next_balance = sd->last_balance + interval;
 -              if (pulled_task)
 +              if (pulled_task) {
 +                      this_rq->idle_stamp = 0;
                        break;
 +              }
        }
        if (pulled_task || time_after(jiffies, this_rq->next_balance)) {
                /*
@@@ -5061,13 -5046,8 +5061,13 @@@ static void account_guest_time(struct t
        p->gtime = cputime_add(p->gtime, cputime);
  
        /* Add guest time to cpustat. */
 -      cpustat->user = cputime64_add(cpustat->user, tmp);
 -      cpustat->guest = cputime64_add(cpustat->guest, tmp);
 +      if (TASK_NICE(p) > 0) {
 +              cpustat->nice = cputime64_add(cpustat->nice, tmp);
 +              cpustat->guest_nice = cputime64_add(cpustat->guest_nice, tmp);
 +      } else {
 +              cpustat->user = cputime64_add(cpustat->user, tmp);
 +              cpustat->guest = cputime64_add(cpustat->guest, tmp);
 +      }
  }
  
  /*
@@@ -5182,86 -5162,60 +5182,86 @@@ void account_idle_ticks(unsigned long t
   * Use precise platform statistics if available:
   */
  #ifdef CONFIG_VIRT_CPU_ACCOUNTING
 -cputime_t task_utime(struct task_struct *p)
 +void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
  {
 -      return p->utime;
 +      *ut = p->utime;
 +      *st = p->stime;
  }
  
 -cputime_t task_stime(struct task_struct *p)
 +void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
  {
 -      return p->stime;
 +      struct task_cputime cputime;
 +
 +      thread_group_cputime(p, &cputime);
 +
 +      *ut = cputime.utime;
 +      *st = cputime.stime;
  }
  #else
 -cputime_t task_utime(struct task_struct *p)
 +
 +#ifndef nsecs_to_cputime
 +# define nsecs_to_cputime(__nsecs)    nsecs_to_jiffies(__nsecs)
 +#endif
 +
 +void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
  {
 -      clock_t utime = cputime_to_clock_t(p->utime),
 -              total = utime + cputime_to_clock_t(p->stime);
 -      u64 temp;
 +      cputime_t rtime, utime = p->utime, total = cputime_add(utime, p->stime);
  
        /*
         * Use CFS's precise accounting:
         */
 -      temp = (u64)nsec_to_clock_t(p->se.sum_exec_runtime);
 +      rtime = nsecs_to_cputime(p->se.sum_exec_runtime);
  
        if (total) {
 -              temp *= utime;
 +              u64 temp;
 +
 +              temp = (u64)(rtime * utime);
                do_div(temp, total);
 -      }
 -      utime = (clock_t)temp;
 +              utime = (cputime_t)temp;
 +      } else
 +              utime = rtime;
 +
 +      /*
 +       * Compare with previous values, to keep monotonicity:
 +       */
 +      p->prev_utime = max(p->prev_utime, utime);
 +      p->prev_stime = max(p->prev_stime, cputime_sub(rtime, p->prev_utime));
  
 -      p->prev_utime = max(p->prev_utime, clock_t_to_cputime(utime));
 -      return p->prev_utime;
 +      *ut = p->prev_utime;
 +      *st = p->prev_stime;
  }
  
 -cputime_t task_stime(struct task_struct *p)
 +/*
 + * Must be called with siglock held.
 + */
 +void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
  {
 -      clock_t stime;
 +      struct signal_struct *sig = p->signal;
 +      struct task_cputime cputime;
 +      cputime_t rtime, utime, total;
  
 -      /*
 -       * Use CFS's precise accounting. (we subtract utime from
 -       * the total, to make sure the total observed by userspace
 -       * grows monotonically - apps rely on that):
 -       */
 -      stime = nsec_to_clock_t(p->se.sum_exec_runtime) -
 -                      cputime_to_clock_t(task_utime(p));
 +      thread_group_cputime(p, &cputime);
  
 -      if (stime >= 0)
 -              p->prev_stime = max(p->prev_stime, clock_t_to_cputime(stime));
 +      total = cputime_add(cputime.utime, cputime.stime);
 +      rtime = nsecs_to_cputime(cputime.sum_exec_runtime);
  
 -      return p->prev_stime;
 -}
 -#endif
 +      if (total) {
 +              u64 temp;
  
 -inline cputime_t task_gtime(struct task_struct *p)
 -{
 -      return p->gtime;
 +              temp = (u64)(rtime * cputime.utime);
 +              do_div(temp, total);
 +              utime = (cputime_t)temp;
 +      } else
 +              utime = rtime;
 +
 +      sig->prev_utime = max(sig->prev_utime, utime);
 +      sig->prev_stime = max(sig->prev_stime,
 +                            cputime_sub(rtime, sig->prev_utime));
 +
 +      *ut = sig->prev_utime;
 +      *st = sig->prev_stime;
  }
 +#endif
  
  /*
   * This function gets called by the timer code, with HZ frequency.
@@@ -5527,7 -5481,7 +5527,7 @@@ need_resched_nonpreemptible
  }
  EXPORT_SYMBOL(schedule);
  
 -#ifdef CONFIG_SMP
 +#ifdef CONFIG_MUTEX_SPIN_ON_OWNER
  /*
   * Look out! "owner" is an entirely speculative pointer
   * access and not reliable.
@@@ -6221,14 -6175,22 +6221,14 @@@ __setscheduler(struct rq *rq, struct ta
        BUG_ON(p->se.on_rq);
  
        p->policy = policy;
 -      switch (p->policy) {
 -      case SCHED_NORMAL:
 -      case SCHED_BATCH:
 -      case SCHED_IDLE:
 -              p->sched_class = &fair_sched_class;
 -              break;
 -      case SCHED_FIFO:
 -      case SCHED_RR:
 -              p->sched_class = &rt_sched_class;
 -              break;
 -      }
 -
        p->rt_priority = prio;
        p->normal_prio = normal_prio(p);
        /* we are holding p->pi_lock already */
        p->prio = rt_mutex_getprio(p);
 +      if (rt_prio(p->prio))
 +              p->sched_class = &rt_sched_class;
 +      else
 +              p->sched_class = &fair_sched_class;
        set_load_weight(p);
  }
  
@@@ -6973,7 -6935,7 +6973,7 @@@ void show_state_filter(unsigned long st
        /*
         * Only show locks if all tasks are dumped:
         */
 -      if (state_filter == -1)
 +      if (!state_filter)
                debug_show_all_locks();
  }
  
@@@ -7444,17 -7406,16 +7444,16 @@@ static struct ctl_table sd_ctl_dir[] = 
                .procname       = "sched_domain",
                .mode           = 0555,
        },
-       {0, },
+       {}
  };
  
  static struct ctl_table sd_ctl_root[] = {
        {
-               .ctl_name       = CTL_KERN,
                .procname       = "kernel",
                .mode           = 0555,
                .child          = sd_ctl_dir,
        },
-       {0, },
+       {}
  };
  
  static struct ctl_table *sd_alloc_ctl_entry(int n)
@@@ -7778,16 -7739,6 +7777,16 @@@ early_initcall(migration_init)
  
  #ifdef CONFIG_SCHED_DEBUG
  
 +static __read_mostly int sched_domain_debug_enabled;
 +
 +static int __init sched_domain_debug_setup(char *str)
 +{
 +      sched_domain_debug_enabled = 1;
 +
 +      return 0;
 +}
 +early_param("sched_debug", sched_domain_debug_setup);
 +
  static int sched_domain_debug_one(struct sched_domain *sd, int cpu, int level,
                                  struct cpumask *groupmask)
  {
@@@ -7874,9 -7825,6 +7873,9 @@@ static void sched_domain_debug(struct s
        cpumask_var_t groupmask;
        int level = 0;
  
 +      if (!sched_domain_debug_enabled)
 +              return;
 +
        if (!sd) {
                printk(KERN_DEBUG "CPU%d attaching NULL sched-domain.\n", cpu);
                return;
@@@ -7956,8 -7904,6 +7955,8 @@@ sd_parent_degenerate(struct sched_domai
  
  static void free_rootdomain(struct root_domain *rd)
  {
 +      synchronize_sched();
 +
        cpupri_cleanup(&rd->cpupri);
  
        free_cpumask_var(rd->rto_mask);
@@@ -8098,7 -8044,6 +8097,7 @@@ static cpumask_var_t cpu_isolated_map
  /* Setup the mask of cpus configured for isolated domains */
  static int __init isolated_cpu_setup(char *str)
  {
 +      alloc_bootmem_cpumask_var(&cpu_isolated_map);
        cpulist_parse(str, cpu_isolated_map);
        return 1;
  }
@@@ -8935,7 -8880,7 +8934,7 @@@ static int build_sched_domains(const st
        return __build_sched_domains(cpu_map, NULL);
  }
  
 -static struct cpumask *doms_cur;      /* current sched domains */
 +static cpumask_var_t *doms_cur;       /* current sched domains */
  static int ndoms_cur;         /* number of sched domains in 'doms_cur' */
  static struct sched_domain_attr *dattr_cur;
                                /* attribues of custom domains in 'doms_cur' */
@@@ -8957,31 -8902,6 +8956,31 @@@ int __attribute__((weak)) arch_update_c
        return 0;
  }
  
 +cpumask_var_t *alloc_sched_domains(unsigned int ndoms)
 +{
 +      int i;
 +      cpumask_var_t *doms;
 +
 +      doms = kmalloc(sizeof(*doms) * ndoms, GFP_KERNEL);
 +      if (!doms)
 +              return NULL;
 +      for (i = 0; i < ndoms; i++) {
 +              if (!alloc_cpumask_var(&doms[i], GFP_KERNEL)) {
 +                      free_sched_domains(doms, i);
 +                      return NULL;
 +              }
 +      }
 +      return doms;
 +}
 +
 +void free_sched_domains(cpumask_var_t doms[], unsigned int ndoms)
 +{
 +      unsigned int i;
 +      for (i = 0; i < ndoms; i++)
 +              free_cpumask_var(doms[i]);
 +      kfree(doms);
 +}
 +
  /*
   * Set up scheduler domains and groups. Callers must hold the hotplug lock.
   * For now this just excludes isolated cpus, but could be used to
@@@ -8993,12 -8913,12 +8992,12 @@@ static int arch_init_sched_domains(cons
  
        arch_update_cpu_topology();
        ndoms_cur = 1;
 -      doms_cur = kmalloc(cpumask_size(), GFP_KERNEL);
 +      doms_cur = alloc_sched_domains(ndoms_cur);
        if (!doms_cur)
 -              doms_cur = fallback_doms;
 -      cpumask_andnot(doms_cur, cpu_map, cpu_isolated_map);
 +              doms_cur = &fallback_doms;
 +      cpumask_andnot(doms_cur[0], cpu_map, cpu_isolated_map);
        dattr_cur = NULL;
 -      err = build_sched_domains(doms_cur);
 +      err = build_sched_domains(doms_cur[0]);
        register_sched_domain_sysctl();
  
        return err;
@@@ -9048,19 -8968,19 +9047,19 @@@ static int dattrs_equal(struct sched_do
   * doms_new[] to the current sched domain partitioning, doms_cur[].
   * It destroys each deleted domain and builds each new domain.
   *
 - * 'doms_new' is an array of cpumask's of length 'ndoms_new'.
 + * 'doms_new' is an array of cpumask_var_t's of length 'ndoms_new'.
   * The masks don't intersect (don't overlap.) We should setup one
   * sched domain for each mask. CPUs not in any of the cpumasks will
   * not be load balanced. If the same cpumask appears both in the
   * current 'doms_cur' domains and in the new 'doms_new', we can leave
   * it as it is.
   *
 - * The passed in 'doms_new' should be kmalloc'd. This routine takes
 - * ownership of it and will kfree it when done with it. If the caller
 - * failed the kmalloc call, then it can pass in doms_new == NULL &&
 - * ndoms_new == 1, and partition_sched_domains() will fallback to
 - * the single partition 'fallback_doms', it also forces the domains
 - * to be rebuilt.
 + * The passed in 'doms_new' should be allocated using
 + * alloc_sched_domains.  This routine takes ownership of it and will
 + * free_sched_domains it when done with it. If the caller failed the
 + * alloc call, then it can pass in doms_new == NULL && ndoms_new == 1,
 + * and partition_sched_domains() will fallback to the single partition
 + * 'fallback_doms', it also forces the domains to be rebuilt.
   *
   * If doms_new == NULL it will be replaced with cpu_online_mask.
   * ndoms_new == 0 is a special case for destroying existing domains,
   *
   * Call with hotplug lock held
   */
 -/* FIXME: Change to struct cpumask *doms_new[] */
 -void partition_sched_domains(int ndoms_new, struct cpumask *doms_new,
 +void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
                             struct sched_domain_attr *dattr_new)
  {
        int i, j, n;
        /* Destroy deleted domains */
        for (i = 0; i < ndoms_cur; i++) {
                for (j = 0; j < n && !new_topology; j++) {
 -                      if (cpumask_equal(&doms_cur[i], &doms_new[j])
 +                      if (cpumask_equal(doms_cur[i], doms_new[j])
                            && dattrs_equal(dattr_cur, i, dattr_new, j))
                                goto match1;
                }
                /* no match - a current sched domain not in new doms_new[] */
 -              detach_destroy_domains(doms_cur + i);
 +              detach_destroy_domains(doms_cur[i]);
  match1:
                ;
        }
  
        if (doms_new == NULL) {
                ndoms_cur = 0;
 -              doms_new = fallback_doms;
 -              cpumask_andnot(&doms_new[0], cpu_online_mask, cpu_isolated_map);
 +              doms_new = &fallback_doms;
 +              cpumask_andnot(doms_new[0], cpu_online_mask, cpu_isolated_map);
                WARN_ON_ONCE(dattr_new);
        }
  
        /* Build new domains */
        for (i = 0; i < ndoms_new; i++) {
                for (j = 0; j < ndoms_cur && !new_topology; j++) {
 -                      if (cpumask_equal(&doms_new[i], &doms_cur[j])
 +                      if (cpumask_equal(doms_new[i], doms_cur[j])
                            && dattrs_equal(dattr_new, i, dattr_cur, j))
                                goto match2;
                }
                /* no match - add a new doms_new */
 -              __build_sched_domains(doms_new + i,
 +              __build_sched_domains(doms_new[i],
                                        dattr_new ? dattr_new + i : NULL);
  match2:
                ;
        }
  
        /* Remember the new sched domains */
 -      if (doms_cur != fallback_doms)
 -              kfree(doms_cur);
 +      if (doms_cur != &fallback_doms)
 +              free_sched_domains(doms_cur, ndoms_cur);
        kfree(dattr_cur);       /* kfree(NULL) is safe */
        doms_cur = doms_new;
        dattr_cur = dattr_new;
@@@ -9442,6 -9363,10 +9441,6 @@@ void __init sched_init(void
  #ifdef CONFIG_CPUMASK_OFFSTACK
        alloc_size += num_possible_cpus() * cpumask_size();
  #endif
 -      /*
 -       * As sched_init() is called before page_alloc is setup,
 -       * we use alloc_bootmem().
 -       */
        if (alloc_size) {
                ptr = (unsigned long)kzalloc(alloc_size, GFP_NOWAIT);
  
                rq->cpu = i;
                rq->online = 0;
                rq->migration_thread = NULL;
 +              rq->idle_stamp = 0;
 +              rq->avg_idle = 2*sysctl_sched_migration_cost;
                INIT_LIST_HEAD(&rq->migration_queue);
                rq_attach_root(rq, &def_root_domain);
  #endif
        zalloc_cpumask_var(&nohz.cpu_mask, GFP_NOWAIT);
        alloc_cpumask_var(&nohz.ilb_grp_nohz_mask, GFP_NOWAIT);
  #endif
 -      zalloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT);
 +      /* May be allocated at isolcpus cmdline parse time */
 +      if (cpu_isolated_map == NULL)
 +              zalloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT);
  #endif /* SMP */
  
        perf_event_init();
@@@ -10979,7 -10900,6 +10978,7 @@@ void synchronize_sched_expedited(void
                spin_unlock_irqrestore(&rq->lock, flags);
        }
        rcu_expedited_state = RCU_EXPEDITED_STATE_IDLE;
 +      synchronize_sched_expedited_count++;
        mutex_unlock(&rcu_sched_expedited_mutex);
        put_online_cpus();
        if (need_full_sync)
diff --combined kernel/slow-work.c
  #include <linux/kthread.h>
  #include <linux/freezer.h>
  #include <linux/wait.h>
 -
 -#define SLOW_WORK_CULL_TIMEOUT (5 * HZ)       /* cull threads 5s after running out of
 -                                       * things to do */
 -#define SLOW_WORK_OOM_TIMEOUT (5 * HZ)        /* can't start new threads for 5s after
 -                                       * OOM */
 +#include <linux/debugfs.h>
 +#include "slow-work.h"
  
  static void slow_work_cull_timeout(unsigned long);
  static void slow_work_oom_timeout(unsigned long);
@@@ -43,13 -46,12 +43,12 @@@ static unsigned vslow_work_proportion 
  
  #ifdef CONFIG_SYSCTL
  static const int slow_work_min_min_threads = 2;
 -static int slow_work_max_max_threads = 255;
 +static int slow_work_max_max_threads = SLOW_WORK_THREAD_LIMIT;
  static const int slow_work_min_vslow = 1;
  static const int slow_work_max_vslow = 99;
  
  ctl_table slow_work_sysctls[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "min-threads",
                .data           = &slow_work_min_threads,
                .maxlen         = sizeof(unsigned),
@@@ -59,7 -61,6 +58,6 @@@
                .extra2         = &slow_work_max_threads,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "max-threads",
                .data           = &slow_work_max_threads,
                .maxlen         = sizeof(unsigned),
                .extra2         = (void *) &slow_work_max_max_threads,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "vslow-percentage",
                .data           = &vslow_work_proportion,
                .maxlen         = sizeof(unsigned),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = (void *) &slow_work_min_vslow,
                .extra2         = (void *) &slow_work_max_vslow,
        },
-       { .ctl_name = 0 }
+       {}
  };
  #endif
  
@@@ -95,56 -95,6 +92,56 @@@ static DEFINE_TIMER(slow_work_oom_timer
  static struct slow_work slow_work_new_thread; /* new thread starter */
  
  /*
 + * slow work ID allocation (use slow_work_queue_lock)
 + */
 +static DECLARE_BITMAP(slow_work_ids, SLOW_WORK_THREAD_LIMIT);
 +
 +/*
 + * Unregistration tracking to prevent put_ref() from disappearing during module
 + * unload
 + */
 +#ifdef CONFIG_MODULES
 +static struct module *slow_work_thread_processing[SLOW_WORK_THREAD_LIMIT];
 +static struct module *slow_work_unreg_module;
 +static struct slow_work *slow_work_unreg_work_item;
 +static DECLARE_WAIT_QUEUE_HEAD(slow_work_unreg_wq);
 +static DEFINE_MUTEX(slow_work_unreg_sync_lock);
 +
 +static void slow_work_set_thread_processing(int id, struct slow_work *work)
 +{
 +      if (work)
 +              slow_work_thread_processing[id] = work->owner;
 +}
 +static void slow_work_done_thread_processing(int id, struct slow_work *work)
 +{
 +      struct module *module = slow_work_thread_processing[id];
 +
 +      slow_work_thread_processing[id] = NULL;
 +      smp_mb();
 +      if (slow_work_unreg_work_item == work ||
 +          slow_work_unreg_module == module)
 +              wake_up_all(&slow_work_unreg_wq);
 +}
 +static void slow_work_clear_thread_processing(int id)
 +{
 +      slow_work_thread_processing[id] = NULL;
 +}
 +#else
 +static void slow_work_set_thread_processing(int id, struct slow_work *work) {}
 +static void slow_work_done_thread_processing(int id, struct slow_work *work) {}
 +static void slow_work_clear_thread_processing(int id) {}
 +#endif
 +
 +/*
 + * Data for tracking currently executing items for indication through /proc
 + */
 +#ifdef CONFIG_SLOW_WORK_DEBUG
 +struct slow_work *slow_work_execs[SLOW_WORK_THREAD_LIMIT];
 +pid_t slow_work_pids[SLOW_WORK_THREAD_LIMIT];
 +DEFINE_RWLOCK(slow_work_execs_lock);
 +#endif
 +
 +/*
   * The queues of work items and the lock governing access to them.  These are
   * shared between all the CPUs.  It doesn't make sense to have per-CPU queues
   * as the number of threads bears no relation to the number of CPUs.
   * There are two queues of work items: one for slow work items, and one for
   * very slow work items.
   */
 -static LIST_HEAD(slow_work_queue);
 -static LIST_HEAD(vslow_work_queue);
 -static DEFINE_SPINLOCK(slow_work_queue_lock);
 +LIST_HEAD(slow_work_queue);
 +LIST_HEAD(vslow_work_queue);
 +DEFINE_SPINLOCK(slow_work_queue_lock);
 +
 +/*
 + * The following are two wait queues that get pinged when a work item is placed
 + * on an empty queue.  These allow work items that are hogging a thread by
 + * sleeping in a way that could be deferred to yield their thread and enqueue
 + * themselves.
 + */
 +static DECLARE_WAIT_QUEUE_HEAD(slow_work_queue_waits_for_occupation);
 +static DECLARE_WAIT_QUEUE_HEAD(vslow_work_queue_waits_for_occupation);
  
  /*
   * The thread controls.  A variable used to signal to the threads that they
@@@ -182,20 -123,6 +179,20 @@@ static DECLARE_COMPLETION(slow_work_las
  static int slow_work_user_count;
  static DEFINE_MUTEX(slow_work_user_lock);
  
 +static inline int slow_work_get_ref(struct slow_work *work)
 +{
 +      if (work->ops->get_ref)
 +              return work->ops->get_ref(work);
 +
 +      return 0;
 +}
 +
 +static inline void slow_work_put_ref(struct slow_work *work)
 +{
 +      if (work->ops->put_ref)
 +              work->ops->put_ref(work);
 +}
 +
  /*
   * Calculate the maximum number of active threads in the pool that are
   * permitted to process very slow work items.
@@@ -219,7 -146,7 +216,7 @@@ static unsigned slow_work_calc_vsmax(vo
   * Attempt to execute stuff queued on a slow thread.  Return true if we managed
   * it, false if there was nothing to do.
   */
 -static bool slow_work_execute(void)
 +static noinline bool slow_work_execute(int id)
  {
        struct slow_work *work = NULL;
        unsigned vsmax;
        } else {
                very_slow = false; /* avoid the compiler warning */
        }
 +
 +      slow_work_set_thread_processing(id, work);
 +      if (work) {
 +              slow_work_mark_time(work);
 +              slow_work_begin_exec(id, work);
 +      }
 +
        spin_unlock_irq(&slow_work_queue_lock);
  
        if (!work)
        if (!test_and_clear_bit(SLOW_WORK_PENDING, &work->flags))
                BUG();
  
 -      work->ops->execute(work);
 +      /* don't execute if the work is in the process of being cancelled */
 +      if (!test_bit(SLOW_WORK_CANCELLING, &work->flags))
 +              work->ops->execute(work);
  
        if (very_slow)
                atomic_dec(&vslow_work_executing_count);
        clear_bit_unlock(SLOW_WORK_EXECUTING, &work->flags);
  
 +      /* wake up anyone waiting for this work to be complete */
 +      wake_up_bit(&work->flags, SLOW_WORK_EXECUTING);
 +
 +      slow_work_end_exec(id, work);
 +
        /* if someone tried to enqueue the item whilst we were executing it,
         * then it'll be left unenqueued to avoid multiple threads trying to
         * execute it simultaneously
                spin_unlock_irq(&slow_work_queue_lock);
        }
  
 -      work->ops->put_ref(work);
 +      /* sort out the race between module unloading and put_ref() */
 +      slow_work_put_ref(work);
 +      slow_work_done_thread_processing(id, work);
 +
        return true;
  
  auto_requeue:
         * - we transfer our ref on the item back to the appropriate queue
         * - don't wake another thread up as we're awake already
         */
 +      slow_work_mark_time(work);
        if (test_bit(SLOW_WORK_VERY_SLOW, &work->flags))
                list_add_tail(&work->link, &vslow_work_queue);
        else
                list_add_tail(&work->link, &slow_work_queue);
        spin_unlock_irq(&slow_work_queue_lock);
 +      slow_work_clear_thread_processing(id);
        return true;
  }
  
  /**
 + * slow_work_sleep_till_thread_needed - Sleep till thread needed by other work
 + * work: The work item under execution that wants to sleep
 + * _timeout: Scheduler sleep timeout
 + *
 + * Allow a requeueable work item to sleep on a slow-work processor thread until
 + * that thread is needed to do some other work or the sleep is interrupted by
 + * some other event.
 + *
 + * The caller must set up a wake up event before calling this and must have set
 + * the appropriate sleep mode (such as TASK_UNINTERRUPTIBLE) and tested its own
 + * condition before calling this function as no test is made here.
 + *
 + * False is returned if there is nothing on the queue; true is returned if the
 + * work item should be requeued
 + */
 +bool slow_work_sleep_till_thread_needed(struct slow_work *work,
 +                                      signed long *_timeout)
 +{
 +      wait_queue_head_t *wfo_wq;
 +      struct list_head *queue;
 +
 +      DEFINE_WAIT(wait);
 +
 +      if (test_bit(SLOW_WORK_VERY_SLOW, &work->flags)) {
 +              wfo_wq = &vslow_work_queue_waits_for_occupation;
 +              queue = &vslow_work_queue;
 +      } else {
 +              wfo_wq = &slow_work_queue_waits_for_occupation;
 +              queue = &slow_work_queue;
 +      }
 +
 +      if (!list_empty(queue))
 +              return true;
 +
 +      add_wait_queue_exclusive(wfo_wq, &wait);
 +      if (list_empty(queue))
 +              *_timeout = schedule_timeout(*_timeout);
 +      finish_wait(wfo_wq, &wait);
 +
 +      return !list_empty(queue);
 +}
 +EXPORT_SYMBOL(slow_work_sleep_till_thread_needed);
 +
 +/**
   * slow_work_enqueue - Schedule a slow work item for processing
   * @work: The work item to queue
   *
   * allowed to pick items to execute.  This ensures that very slow items won't
   * overly block ones that are just ordinarily slow.
   *
 - * Returns 0 if successful, -EAGAIN if not.
 + * Returns 0 if successful, -EAGAIN if not (or -ECANCELED if cancelled work is
 + * attempted queued)
   */
  int slow_work_enqueue(struct slow_work *work)
  {
 +      wait_queue_head_t *wfo_wq;
 +      struct list_head *queue;
        unsigned long flags;
 +      int ret;
 +
 +      if (test_bit(SLOW_WORK_CANCELLING, &work->flags))
 +              return -ECANCELED;
  
        BUG_ON(slow_work_user_count <= 0);
        BUG_ON(!work);
        BUG_ON(!work->ops);
 -      BUG_ON(!work->ops->get_ref);
  
        /* when honouring an enqueue request, we only promise that we will run
         * the work function in the future; we do not promise to run it once
         * maintaining our promise
         */
        if (!test_and_set_bit_lock(SLOW_WORK_PENDING, &work->flags)) {
 +              if (test_bit(SLOW_WORK_VERY_SLOW, &work->flags)) {
 +                      wfo_wq = &vslow_work_queue_waits_for_occupation;
 +                      queue = &vslow_work_queue;
 +              } else {
 +                      wfo_wq = &slow_work_queue_waits_for_occupation;
 +                      queue = &slow_work_queue;
 +              }
 +
                spin_lock_irqsave(&slow_work_queue_lock, flags);
  
 +              if (unlikely(test_bit(SLOW_WORK_CANCELLING, &work->flags)))
 +                      goto cancelled;
 +
                /* we promise that we will not attempt to execute the work
                 * function in more than one thread simultaneously
                 *
                if (test_bit(SLOW_WORK_EXECUTING, &work->flags)) {
                        set_bit(SLOW_WORK_ENQ_DEFERRED, &work->flags);
                } else {
 -                      if (work->ops->get_ref(work) < 0)
 -                              goto cant_get_ref;
 -                      if (test_bit(SLOW_WORK_VERY_SLOW, &work->flags))
 -                              list_add_tail(&work->link, &vslow_work_queue);
 -                      else
 -                              list_add_tail(&work->link, &slow_work_queue);
 +                      ret = slow_work_get_ref(work);
 +                      if (ret < 0)
 +                              goto failed;
 +                      slow_work_mark_time(work);
 +                      list_add_tail(&work->link, queue);
                        wake_up(&slow_work_thread_wq);
 +
 +                      /* if someone who could be requeued is sleeping on a
 +                       * thread, then ask them to yield their thread */
 +                      if (work->link.prev == queue)
 +                              wake_up(wfo_wq);
                }
  
                spin_unlock_irqrestore(&slow_work_queue_lock, flags);
        }
        return 0;
  
 -cant_get_ref:
 +cancelled:
 +      ret = -ECANCELED;
 +failed:
        spin_unlock_irqrestore(&slow_work_queue_lock, flags);
 -      return -EAGAIN;
 +      return ret;
  }
  EXPORT_SYMBOL(slow_work_enqueue);
  
 +static int slow_work_wait(void *word)
 +{
 +      schedule();
 +      return 0;
 +}
 +
 +/**
 + * slow_work_cancel - Cancel a slow work item
 + * @work: The work item to cancel
 + *
 + * This function will cancel a previously enqueued work item. If we cannot
 + * cancel the work item, it is guarenteed to have run when this function
 + * returns.
 + */
 +void slow_work_cancel(struct slow_work *work)
 +{
 +      bool wait = true, put = false;
 +
 +      set_bit(SLOW_WORK_CANCELLING, &work->flags);
 +      smp_mb();
 +
 +      /* if the work item is a delayed work item with an active timer, we
 +       * need to wait for the timer to finish _before_ getting the spinlock,
 +       * lest we deadlock against the timer routine
 +       *
 +       * the timer routine will leave DELAYED set if it notices the
 +       * CANCELLING flag in time
 +       */
 +      if (test_bit(SLOW_WORK_DELAYED, &work->flags)) {
 +              struct delayed_slow_work *dwork =
 +                      container_of(work, struct delayed_slow_work, work);
 +              del_timer_sync(&dwork->timer);
 +      }
 +
 +      spin_lock_irq(&slow_work_queue_lock);
 +
 +      if (test_bit(SLOW_WORK_DELAYED, &work->flags)) {
 +              /* the timer routine aborted or never happened, so we are left
 +               * holding the timer's reference on the item and should just
 +               * drop the pending flag and wait for any ongoing execution to
 +               * finish */
 +              struct delayed_slow_work *dwork =
 +                      container_of(work, struct delayed_slow_work, work);
 +
 +              BUG_ON(timer_pending(&dwork->timer));
 +              BUG_ON(!list_empty(&work->link));
 +
 +              clear_bit(SLOW_WORK_DELAYED, &work->flags);
 +              put = true;
 +              clear_bit(SLOW_WORK_PENDING, &work->flags);
 +
 +      } else if (test_bit(SLOW_WORK_PENDING, &work->flags) &&
 +                 !list_empty(&work->link)) {
 +              /* the link in the pending queue holds a reference on the item
 +               * that we will need to release */
 +              list_del_init(&work->link);
 +              wait = false;
 +              put = true;
 +              clear_bit(SLOW_WORK_PENDING, &work->flags);
 +
 +      } else if (test_and_clear_bit(SLOW_WORK_ENQ_DEFERRED, &work->flags)) {
 +              /* the executor is holding our only reference on the item, so
 +               * we merely need to wait for it to finish executing */
 +              clear_bit(SLOW_WORK_PENDING, &work->flags);
 +      }
 +
 +      spin_unlock_irq(&slow_work_queue_lock);
 +
 +      /* the EXECUTING flag is set by the executor whilst the spinlock is set
 +       * and before the item is dequeued - so assuming the above doesn't
 +       * actually dequeue it, simply waiting for the EXECUTING flag to be
 +       * released here should be sufficient */
 +      if (wait)
 +              wait_on_bit(&work->flags, SLOW_WORK_EXECUTING, slow_work_wait,
 +                          TASK_UNINTERRUPTIBLE);
 +
 +      clear_bit(SLOW_WORK_CANCELLING, &work->flags);
 +      if (put)
 +              slow_work_put_ref(work);
 +}
 +EXPORT_SYMBOL(slow_work_cancel);
 +
 +/*
 + * Handle expiry of the delay timer, indicating that a delayed slow work item
 + * should now be queued if not cancelled
 + */
 +static void delayed_slow_work_timer(unsigned long data)
 +{
 +      wait_queue_head_t *wfo_wq;
 +      struct list_head *queue;
 +      struct slow_work *work = (struct slow_work *) data;
 +      unsigned long flags;
 +      bool queued = false, put = false, first = false;
 +
 +      if (test_bit(SLOW_WORK_VERY_SLOW, &work->flags)) {
 +              wfo_wq = &vslow_work_queue_waits_for_occupation;
 +              queue = &vslow_work_queue;
 +      } else {
 +              wfo_wq = &slow_work_queue_waits_for_occupation;
 +              queue = &slow_work_queue;
 +      }
 +
 +      spin_lock_irqsave(&slow_work_queue_lock, flags);
 +      if (likely(!test_bit(SLOW_WORK_CANCELLING, &work->flags))) {
 +              clear_bit(SLOW_WORK_DELAYED, &work->flags);
 +
 +              if (test_bit(SLOW_WORK_EXECUTING, &work->flags)) {
 +                      /* we discard the reference the timer was holding in
 +                       * favour of the one the executor holds */
 +                      set_bit(SLOW_WORK_ENQ_DEFERRED, &work->flags);
 +                      put = true;
 +              } else {
 +                      slow_work_mark_time(work);
 +                      list_add_tail(&work->link, queue);
 +                      queued = true;
 +                      if (work->link.prev == queue)
 +                              first = true;
 +              }
 +      }
 +
 +      spin_unlock_irqrestore(&slow_work_queue_lock, flags);
 +      if (put)
 +              slow_work_put_ref(work);
 +      if (first)
 +              wake_up(wfo_wq);
 +      if (queued)
 +              wake_up(&slow_work_thread_wq);
 +}
 +
 +/**
 + * delayed_slow_work_enqueue - Schedule a delayed slow work item for processing
 + * @dwork: The delayed work item to queue
 + * @delay: When to start executing the work, in jiffies from now
 + *
 + * This is similar to slow_work_enqueue(), but it adds a delay before the work
 + * is actually queued for processing.
 + *
 + * The item can have delayed processing requested on it whilst it is being
 + * executed.  The delay will begin immediately, and if it expires before the
 + * item finishes executing, the item will be placed back on the queue when it
 + * has done executing.
 + */
 +int delayed_slow_work_enqueue(struct delayed_slow_work *dwork,
 +                            unsigned long delay)
 +{
 +      struct slow_work *work = &dwork->work;
 +      unsigned long flags;
 +      int ret;
 +
 +      if (delay == 0)
 +              return slow_work_enqueue(&dwork->work);
 +
 +      BUG_ON(slow_work_user_count <= 0);
 +      BUG_ON(!work);
 +      BUG_ON(!work->ops);
 +
 +      if (test_bit(SLOW_WORK_CANCELLING, &work->flags))
 +              return -ECANCELED;
 +
 +      if (!test_and_set_bit_lock(SLOW_WORK_PENDING, &work->flags)) {
 +              spin_lock_irqsave(&slow_work_queue_lock, flags);
 +
 +              if (test_bit(SLOW_WORK_CANCELLING, &work->flags))
 +                      goto cancelled;
 +
 +              /* the timer holds a reference whilst it is pending */
 +              ret = work->ops->get_ref(work);
 +              if (ret < 0)
 +                      goto cant_get_ref;
 +
 +              if (test_and_set_bit(SLOW_WORK_DELAYED, &work->flags))
 +                      BUG();
 +              dwork->timer.expires = jiffies + delay;
 +              dwork->timer.data = (unsigned long) work;
 +              dwork->timer.function = delayed_slow_work_timer;
 +              add_timer(&dwork->timer);
 +
 +              spin_unlock_irqrestore(&slow_work_queue_lock, flags);
 +      }
 +
 +      return 0;
 +
 +cancelled:
 +      ret = -ECANCELED;
 +cant_get_ref:
 +      spin_unlock_irqrestore(&slow_work_queue_lock, flags);
 +      return ret;
 +}
 +EXPORT_SYMBOL(delayed_slow_work_enqueue);
 +
  /*
   * Schedule a cull of the thread pool at some time in the near future
   */
@@@ -714,23 -365,13 +711,23 @@@ static inline bool slow_work_available(
   */
  static int slow_work_thread(void *_data)
  {
 -      int vsmax;
 +      int vsmax, id;
  
        DEFINE_WAIT(wait);
  
        set_freezable();
        set_user_nice(current, -5);
  
 +      /* allocate ourselves an ID */
 +      spin_lock_irq(&slow_work_queue_lock);
 +      id = find_first_zero_bit(slow_work_ids, SLOW_WORK_THREAD_LIMIT);
 +      BUG_ON(id < 0 || id >= SLOW_WORK_THREAD_LIMIT);
 +      __set_bit(id, slow_work_ids);
 +      slow_work_set_thread_pid(id, current->pid);
 +      spin_unlock_irq(&slow_work_queue_lock);
 +
 +      sprintf(current->comm, "kslowd%03u", id);
 +
        for (;;) {
                vsmax = vslow_work_proportion;
                vsmax *= atomic_read(&slow_work_thread_count);
                vsmax *= atomic_read(&slow_work_thread_count);
                vsmax /= 100;
  
 -              if (slow_work_available(vsmax) && slow_work_execute()) {
 +              if (slow_work_available(vsmax) && slow_work_execute(id)) {
                        cond_resched();
                        if (list_empty(&slow_work_queue) &&
                            list_empty(&vslow_work_queue) &&
                        break;
        }
  
 +      spin_lock_irq(&slow_work_queue_lock);
 +      slow_work_set_thread_pid(id, 0);
 +      __clear_bit(id, slow_work_ids);
 +      spin_unlock_irq(&slow_work_queue_lock);
 +
        if (atomic_dec_and_test(&slow_work_thread_count))
                complete_and_exit(&slow_work_last_thread_exited, 0);
        return 0;
@@@ -788,6 -424,21 +785,6 @@@ static void slow_work_cull_timeout(unsi
  }
  
  /*
 - * Get a reference on slow work thread starter
 - */
 -static int slow_work_new_thread_get_ref(struct slow_work *work)
 -{
 -      return 0;
 -}
 -
 -/*
 - * Drop a reference on slow work thread starter
 - */
 -static void slow_work_new_thread_put_ref(struct slow_work *work)
 -{
 -}
 -
 -/*
   * Start a new slow work thread
   */
  static void slow_work_new_thread_execute(struct slow_work *work)
  }
  
  static const struct slow_work_ops slow_work_new_thread_ops = {
 -      .get_ref        = slow_work_new_thread_get_ref,
 -      .put_ref        = slow_work_new_thread_put_ref,
 +      .owner          = THIS_MODULE,
        .execute        = slow_work_new_thread_execute,
 +#ifdef CONFIG_SLOW_WORK_DEBUG
 +      .desc           = slow_work_new_thread_desc,
 +#endif
  };
  
  /*
@@@ -894,13 -543,12 +891,13 @@@ static int slow_work_max_threads_sysctl
  
  /**
   * slow_work_register_user - Register a user of the facility
 + * @module: The module about to make use of the facility
   *
   * Register a user of the facility, starting up the initial threads if there
   * aren't any other users at this point.  This will return 0 if successful, or
   * an error if not.
   */
 -int slow_work_register_user(void)
 +int slow_work_register_user(struct module *module)
  {
        struct task_struct *p;
        int loop;
@@@ -947,81 -595,14 +944,81 @@@ error
  }
  EXPORT_SYMBOL(slow_work_register_user);
  
 +/*
 + * wait for all outstanding items from the calling module to complete
 + * - note that more items may be queued whilst we're waiting
 + */
 +static void slow_work_wait_for_items(struct module *module)
 +{
 +#ifdef CONFIG_MODULES
 +      DECLARE_WAITQUEUE(myself, current);
 +      struct slow_work *work;
 +      int loop;
 +
 +      mutex_lock(&slow_work_unreg_sync_lock);
 +      add_wait_queue(&slow_work_unreg_wq, &myself);
 +
 +      for (;;) {
 +              spin_lock_irq(&slow_work_queue_lock);
 +
 +              /* first of all, we wait for the last queued item in each list
 +               * to be processed */
 +              list_for_each_entry_reverse(work, &vslow_work_queue, link) {
 +                      if (work->owner == module) {
 +                              set_current_state(TASK_UNINTERRUPTIBLE);
 +                              slow_work_unreg_work_item = work;
 +                              goto do_wait;
 +                      }
 +              }
 +              list_for_each_entry_reverse(work, &slow_work_queue, link) {
 +                      if (work->owner == module) {
 +                              set_current_state(TASK_UNINTERRUPTIBLE);
 +                              slow_work_unreg_work_item = work;
 +                              goto do_wait;
 +                      }
 +              }
 +
 +              /* then we wait for the items being processed to finish */
 +              slow_work_unreg_module = module;
 +              smp_mb();
 +              for (loop = 0; loop < SLOW_WORK_THREAD_LIMIT; loop++) {
 +                      if (slow_work_thread_processing[loop] == module)
 +                              goto do_wait;
 +              }
 +              spin_unlock_irq(&slow_work_queue_lock);
 +              break; /* okay, we're done */
 +
 +      do_wait:
 +              spin_unlock_irq(&slow_work_queue_lock);
 +              schedule();
 +              slow_work_unreg_work_item = NULL;
 +              slow_work_unreg_module = NULL;
 +      }
 +
 +      remove_wait_queue(&slow_work_unreg_wq, &myself);
 +      mutex_unlock(&slow_work_unreg_sync_lock);
 +#endif /* CONFIG_MODULES */
 +}
 +
  /**
   * slow_work_unregister_user - Unregister a user of the facility
 + * @module: The module whose items should be cleared
   *
   * Unregister a user of the facility, killing all the threads if this was the
   * last one.
 + *
 + * This waits for all the work items belonging to the nominated module to go
 + * away before proceeding.
   */
 -void slow_work_unregister_user(void)
 +void slow_work_unregister_user(struct module *module)
  {
 +      /* first of all, wait for all outstanding items from the calling module
 +       * to complete */
 +      if (module)
 +              slow_work_wait_for_items(module);
 +
 +      /* then we can actually go about shutting down the facility if need
 +       * be */
        mutex_lock(&slow_work_user_lock);
  
        BUG_ON(slow_work_user_count <= 0);
@@@ -1055,16 -636,6 +1052,16 @@@ static int __init init_slow_work(void
        if (slow_work_max_max_threads < nr_cpus * 2)
                slow_work_max_max_threads = nr_cpus * 2;
  #endif
 +#ifdef CONFIG_SLOW_WORK_DEBUG
 +      {
 +              struct dentry *dbdir;
 +
 +              dbdir = debugfs_create_dir("slow_work", NULL);
 +              if (dbdir && !IS_ERR(dbdir))
 +                      debugfs_create_file("runqueue", S_IFREG | 0400, dbdir,
 +                                          NULL, &slow_work_runqueue_fops);
 +      }
 +#endif
        return 0;
  }
  
diff --combined kernel/sysctl.c
@@@ -27,7 -27,6 +27,6 @@@
  #include <linux/security.h>
  #include <linux/ctype.h>
  #include <linux/kmemcheck.h>
- #include <linux/smp_lock.h>
  #include <linux/fs.h>
  #include <linux/init.h>
  #include <linux/kernel.h>
@@@ -36,7 -35,6 +35,7 @@@
  #include <linux/sysrq.h>
  #include <linux/highuid.h>
  #include <linux/writeback.h>
 +#include <linux/ratelimit.h>
  #include <linux/hugetlb.h>
  #include <linux/initrd.h>
  #include <linux/key.h>
@@@ -61,7 -59,6 +60,6 @@@
  #include <asm/io.h>
  #endif
  
- static int deprecated_sysctl_warning(struct __sysctl_args *args);
  
  #if defined(CONFIG_SYSCTL)
  
@@@ -159,8 -156,6 +157,8 @@@ extern int no_unaligned_warning
  extern int unaligned_dump_stack;
  #endif
  
 +extern struct ratelimit_state printk_ratelimit_state;
 +
  #ifdef CONFIG_RT_MUTEXES
  extern int max_lock_depth;
  #endif
@@@ -210,31 -205,26 +208,26 @@@ extern int lock_stat
  
  static struct ctl_table root_table[] = {
        {
-               .ctl_name       = CTL_KERN,
                .procname       = "kernel",
                .mode           = 0555,
                .child          = kern_table,
        },
        {
-               .ctl_name       = CTL_VM,
                .procname       = "vm",
                .mode           = 0555,
                .child          = vm_table,
        },
        {
-               .ctl_name       = CTL_FS,
                .procname       = "fs",
                .mode           = 0555,
                .child          = fs_table,
        },
        {
-               .ctl_name       = CTL_DEBUG,
                .procname       = "debug",
                .mode           = 0555,
                .child          = debug_table,
        },
        {
-               .ctl_name       = CTL_DEV,
                .procname       = "dev",
                .mode           = 0555,
                .child          = dev_table,
   * NOTE: do not add new entries to this table unless you have read
   * Documentation/sysctl/ctl_unnumbered.txt
   */
-       { .ctl_name = 0 }
+       { }
  };
  
  #ifdef CONFIG_SCHED_DEBUG
@@@ -255,192 -245,166 +248,166 @@@ static int max_wakeup_granularity_ns = 
  
  static struct ctl_table kern_table[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_child_runs_first",
                .data           = &sysctl_sched_child_runs_first,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #ifdef CONFIG_SCHED_DEBUG
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_min_granularity_ns",
                .data           = &sysctl_sched_min_granularity,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &sched_nr_latency_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = sched_nr_latency_handler,
                .extra1         = &min_sched_granularity_ns,
                .extra2         = &max_sched_granularity_ns,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_latency_ns",
                .data           = &sysctl_sched_latency,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &sched_nr_latency_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = sched_nr_latency_handler,
                .extra1         = &min_sched_granularity_ns,
                .extra2         = &max_sched_granularity_ns,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_wakeup_granularity_ns",
                .data           = &sysctl_sched_wakeup_granularity,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &min_wakeup_granularity_ns,
                .extra2         = &max_wakeup_granularity_ns,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_shares_ratelimit",
                .data           = &sysctl_sched_shares_ratelimit,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_shares_thresh",
                .data           = &sysctl_sched_shares_thresh,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_features",
                .data           = &sysctl_sched_features,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_migration_cost",
                .data           = &sysctl_sched_migration_cost,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_nr_migrate",
                .data           = &sysctl_sched_nr_migrate,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_time_avg",
                .data           = &sysctl_sched_time_avg,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "timer_migration",
                .data           = &sysctl_timer_migration,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
                .extra2         = &one,
        },
  #endif
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_rt_period_us",
                .data           = &sysctl_sched_rt_period,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &sched_rt_handler,
+               .proc_handler   = sched_rt_handler,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_rt_runtime_us",
                .data           = &sysctl_sched_rt_runtime,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &sched_rt_handler,
+               .proc_handler   = sched_rt_handler,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_compat_yield",
                .data           = &sysctl_sched_compat_yield,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #ifdef CONFIG_PROVE_LOCKING
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "prove_locking",
                .data           = &prove_locking,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
  #ifdef CONFIG_LOCK_STAT
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "lock_stat",
                .data           = &lock_stat,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
        {
-               .ctl_name       = KERN_PANIC,
                .procname       = "panic",
                .data           = &panic_timeout,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = KERN_CORE_USES_PID,
                .procname       = "core_uses_pid",
                .data           = &core_uses_pid,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = KERN_CORE_PATTERN,
                .procname       = "core_pattern",
                .data           = core_pattern,
                .maxlen         = CORENAME_MAX_SIZE,
                .mode           = 0644,
-               .proc_handler   = &proc_dostring,
-               .strategy       = &sysctl_string,
+               .proc_handler   = proc_dostring,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "core_pipe_limit",
                .data           = &core_pipe_limit,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #ifdef CONFIG_PROC_SYSCTL
        {
                .procname       = "tainted",
                .maxlen         = sizeof(long),
                .mode           = 0644,
-               .proc_handler   = &proc_taint,
+               .proc_handler   = proc_taint,
        },
  #endif
  #ifdef CONFIG_LATENCYTOP
                .data           = &latencytop_enabled,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
  #ifdef CONFIG_BLK_DEV_INITRD
        {
-               .ctl_name       = KERN_REALROOTDEV,
                .procname       = "real-root-dev",
                .data           = &real_root_dev,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "print-fatal-signals",
                .data           = &print_fatal_signals,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #ifdef CONFIG_SPARC
        {
-               .ctl_name       = KERN_SPARC_REBOOT,
                .procname       = "reboot-cmd",
                .data           = reboot_command,
                .maxlen         = 256,
                .mode           = 0644,
-               .proc_handler   = &proc_dostring,
-               .strategy       = &sysctl_string,
+               .proc_handler   = proc_dostring,
        },
        {
-               .ctl_name       = KERN_SPARC_STOP_A,
                .procname       = "stop-a",
                .data           = &stop_a_enabled,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = KERN_SPARC_SCONS_PWROFF,
                .procname       = "scons-poweroff",
                .data           = &scons_pwroff,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
  #ifdef CONFIG_SPARC64
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "tsb-ratio",
                .data           = &sysctl_tsb_ratio,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
  #ifdef __hppa__
        {
-               .ctl_name       = KERN_HPPA_PWRSW,
                .procname       = "soft-power",
                .data           = &pwrsw_enabled,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = KERN_HPPA_UNALIGNED,
                .procname       = "unaligned-trap",
                .data           = &unaligned_enabled,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
        {
-               .ctl_name       = KERN_CTLALTDEL,
                .procname       = "ctrl-alt-del",
                .data           = &C_A_D,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #ifdef CONFIG_FUNCTION_TRACER
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "ftrace_enabled",
                .data           = &ftrace_enabled,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &ftrace_enable_sysctl,
+               .proc_handler   = ftrace_enable_sysctl,
        },
  #endif
  #ifdef CONFIG_STACK_TRACER
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "stack_tracer_enabled",
                .data           = &stack_tracer_enabled,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &stack_trace_sysctl,
+               .proc_handler   = stack_trace_sysctl,
        },
  #endif
  #ifdef CONFIG_TRACING
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "ftrace_dump_on_oops",
                .data           = &ftrace_dump_on_oops,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
  #ifdef CONFIG_MODULES
        {
-               .ctl_name       = KERN_MODPROBE,
                .procname       = "modprobe",
                .data           = &modprobe_path,
                .maxlen         = KMOD_PATH_LEN,
                .mode           = 0644,
-               .proc_handler   = &proc_dostring,
-               .strategy       = &sysctl_string,
+               .proc_handler   = proc_dostring,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "modules_disabled",
                .data           = &modules_disabled,
                .maxlen         = sizeof(int),
                .mode           = 0644,
                /* only handle a transition from default "0" to "1" */
-               .proc_handler   = &proc_dointvec_minmax,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &one,
                .extra2         = &one,
        },
  #endif
  #if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET)
        {
-               .ctl_name       = KERN_HOTPLUG,
                .procname       = "hotplug",
                .data           = &uevent_helper,
                .maxlen         = UEVENT_HELPER_PATH_LEN,
                .mode           = 0644,
-               .proc_handler   = &proc_dostring,
-               .strategy       = &sysctl_string,
+               .proc_handler   = proc_dostring,
        },
  #endif
  #ifdef CONFIG_CHR_DEV_SG
        {
-               .ctl_name       = KERN_SG_BIG_BUFF,
                .procname       = "sg-big-buff",
                .data           = &sg_big_buff,
                .maxlen         = sizeof (int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
  #ifdef CONFIG_BSD_PROCESS_ACCT
        {
-               .ctl_name       = KERN_ACCT,
                .procname       = "acct",
                .data           = &acct_parm,
                .maxlen         = 3*sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
  #ifdef CONFIG_MAGIC_SYSRQ
        {
-               .ctl_name       = KERN_SYSRQ,
                .procname       = "sysrq",
                .data           = &__sysrq_enabled,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
  #ifdef CONFIG_PROC_SYSCTL
                .data           = NULL,
                .maxlen         = sizeof (int),
                .mode           = 0600,
-               .proc_handler   = &proc_do_cad_pid,
+               .proc_handler   = proc_do_cad_pid,
        },
  #endif
        {
-               .ctl_name       = KERN_MAX_THREADS,
                .procname       = "threads-max",
                .data           = &max_threads,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = KERN_RANDOM,
                .procname       = "random",
                .mode           = 0555,
                .child          = random_table,
        },
        {
-               .ctl_name       = KERN_OVERFLOWUID,
                .procname       = "overflowuid",
                .data           = &overflowuid,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &minolduid,
                .extra2         = &maxolduid,
        },
        {
-               .ctl_name       = KERN_OVERFLOWGID,
                .procname       = "overflowgid",
                .data           = &overflowgid,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &minolduid,
                .extra2         = &maxolduid,
        },
  #ifdef CONFIG_S390
  #ifdef CONFIG_MATHEMU
        {
-               .ctl_name       = KERN_IEEE_EMULATION_WARNINGS,
                .procname       = "ieee_emulation_warnings",
                .data           = &sysctl_ieee_emulation_warnings,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
        {
-               .ctl_name       = KERN_S390_USER_DEBUG_LOGGING,
                .procname       = "userprocess_debug",
                .data           = &sysctl_userprocess_debug,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
        {
-               .ctl_name       = KERN_PIDMAX,
                .procname       = "pid_max",
                .data           = &pid_max,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &pid_max_min,
                .extra2         = &pid_max_max,
        },
        {
-               .ctl_name       = KERN_PANIC_ON_OOPS,
                .procname       = "panic_on_oops",
                .data           = &panic_on_oops,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #if defined CONFIG_PRINTK
        {
-               .ctl_name       = KERN_PRINTK,
                .procname       = "printk",
                .data           = &console_loglevel,
                .maxlen         = 4*sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = KERN_PRINTK_RATELIMIT,
                .procname       = "printk_ratelimit",
                .data           = &printk_ratelimit_state.interval,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_jiffies,
-               .strategy       = &sysctl_jiffies,
+               .proc_handler   = proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = KERN_PRINTK_RATELIMIT_BURST,
                .procname       = "printk_ratelimit_burst",
                .data           = &printk_ratelimit_state.burst,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "printk_delay",
                .data           = &printk_delay_msec,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
                .extra2         = &ten_thousand,
        },
  #endif
        {
-               .ctl_name       = KERN_NGROUPS_MAX,
                .procname       = "ngroups_max",
                .data           = &ngroups_max,
                .maxlen         = sizeof (int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
        {
-               .ctl_name       = KERN_UNKNOWN_NMI_PANIC,
                .procname       = "unknown_nmi_panic",
                .data           = &unknown_nmi_panic,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
                .procname       = "nmi_watchdog",
                .data           = &nmi_watchdog_enabled,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_nmi_enabled,
+               .proc_handler   = proc_nmi_enabled,
        },
  #endif
  #if defined(CONFIG_X86)
        {
-               .ctl_name       = KERN_PANIC_ON_NMI,
                .procname       = "panic_on_unrecovered_nmi",
                .data           = &panic_on_unrecovered_nmi,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "panic_on_io_nmi",
                .data           = &panic_on_io_nmi,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = KERN_BOOTLOADER_TYPE,
                .procname       = "bootloader_type",
                .data           = &bootloader_type,
                .maxlen         = sizeof (int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "bootloader_version",
                .data           = &bootloader_version,
                .maxlen         = sizeof (int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "kstack_depth_to_print",
                .data           = &kstack_depth_to_print,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "io_delay_type",
                .data           = &io_delay_type,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
  #if defined(CONFIG_MMU)
        {
-               .ctl_name       = KERN_RANDOMIZE,
                .procname       = "randomize_va_space",
                .data           = &randomize_va_space,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
  #if defined(CONFIG_S390) && defined(CONFIG_SMP)
        {
-               .ctl_name       = KERN_SPIN_RETRY,
                .procname       = "spin_retry",
                .data           = &spin_retry,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
  #if   defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86)
                .data           = &acpi_realmode_flags,
                .maxlen         = sizeof (unsigned long),
                .mode           = 0644,
-               .proc_handler   = &proc_doulongvec_minmax,
+               .proc_handler   = proc_doulongvec_minmax,
        },
  #endif
  #ifdef CONFIG_IA64
        {
-               .ctl_name       = KERN_IA64_UNALIGNED,
                .procname       = "ignore-unaligned-usertrap",
                .data           = &no_unaligned_warning,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "unaligned-dump-stack",
                .data           = &unaligned_dump_stack,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
  #ifdef CONFIG_DETECT_SOFTLOCKUP
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "softlockup_panic",
                .data           = &softlockup_panic,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
                .extra2         = &one,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "softlockup_thresh",
                .data           = &softlockup_thresh,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dosoftlockup_thresh,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dosoftlockup_thresh,
                .extra1         = &neg_one,
                .extra2         = &sixty,
        },
  #endif
  #ifdef CONFIG_DETECT_HUNG_TASK
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "hung_task_panic",
                .data           = &sysctl_hung_task_panic,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
                .extra2         = &one,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "hung_task_check_count",
                .data           = &sysctl_hung_task_check_count,
                .maxlen         = sizeof(unsigned long),
                .mode           = 0644,
-               .proc_handler   = &proc_doulongvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_doulongvec_minmax,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "hung_task_timeout_secs",
                .data           = &sysctl_hung_task_timeout_secs,
                .maxlen         = sizeof(unsigned long),
                .mode           = 0644,
-               .proc_handler   = &proc_dohung_task_timeout_secs,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dohung_task_timeout_secs,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "hung_task_warnings",
                .data           = &sysctl_hung_task_warnings,
                .maxlen         = sizeof(unsigned long),
                .mode           = 0644,
-               .proc_handler   = &proc_doulongvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_doulongvec_minmax,
        },
  #endif
  #ifdef CONFIG_COMPAT
        {
-               .ctl_name       = KERN_COMPAT_LOG,
                .procname       = "compat-log",
                .data           = &compat_log,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
  #ifdef CONFIG_RT_MUTEXES
        {
-               .ctl_name       = KERN_MAX_LOCK_DEPTH,
                .procname       = "max_lock_depth",
                .data           = &max_lock_depth,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "poweroff_cmd",
                .data           = &poweroff_cmd,
                .maxlen         = POWEROFF_CMD_PATH_LEN,
                .mode           = 0644,
-               .proc_handler   = &proc_dostring,
-               .strategy       = &sysctl_string,
+               .proc_handler   = proc_dostring,
        },
  #ifdef CONFIG_KEYS
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "keys",
                .mode           = 0555,
                .child          = key_sysctls,
  #endif
  #ifdef CONFIG_RCU_TORTURE_TEST
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "rcutorture_runnable",
                .data           = &rcutorture_runnable,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
  #ifdef CONFIG_SLOW_WORK
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "slow-work",
                .mode           = 0555,
                .child          = slow_work_sysctls,
  #endif
  #ifdef CONFIG_PERF_EVENTS
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "perf_event_paranoid",
                .data           = &sysctl_perf_event_paranoid,
                .maxlen         = sizeof(sysctl_perf_event_paranoid),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "perf_event_mlock_kb",
                .data           = &sysctl_perf_event_mlock,
                .maxlen         = sizeof(sysctl_perf_event_mlock),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "perf_event_max_sample_rate",
                .data           = &sysctl_perf_event_sample_rate,
                .maxlen         = sizeof(sysctl_perf_event_sample_rate),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
  #ifdef CONFIG_KMEMCHECK
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "kmemcheck",
                .data           = &kmemcheck_enabled,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
  #ifdef CONFIG_BLOCK
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "blk_iopoll",
                .data           = &blk_iopoll_enabled,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
  /*
   * NOTE: do not add new entries to this table unless you have read
   * Documentation/sysctl/ctl_unnumbered.txt
   */
-       { .ctl_name = 0 }
+       { }
  };
  
  static struct ctl_table vm_table[] = {
        {
-               .ctl_name       = VM_OVERCOMMIT_MEMORY,
                .procname       = "overcommit_memory",
                .data           = &sysctl_overcommit_memory,
                .maxlen         = sizeof(sysctl_overcommit_memory),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = VM_PANIC_ON_OOM,
                .procname       = "panic_on_oom",
                .data           = &sysctl_panic_on_oom,
                .maxlen         = sizeof(sysctl_panic_on_oom),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "oom_kill_allocating_task",
                .data           = &sysctl_oom_kill_allocating_task,
                .maxlen         = sizeof(sysctl_oom_kill_allocating_task),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "oom_dump_tasks",
                .data           = &sysctl_oom_dump_tasks,
                .maxlen         = sizeof(sysctl_oom_dump_tasks),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = VM_OVERCOMMIT_RATIO,
                .procname       = "overcommit_ratio",
                .data           = &sysctl_overcommit_ratio,
                .maxlen         = sizeof(sysctl_overcommit_ratio),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = VM_PAGE_CLUSTER,
                .procname       = "page-cluster", 
                .data           = &page_cluster,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = VM_DIRTY_BACKGROUND,
                .procname       = "dirty_background_ratio",
                .data           = &dirty_background_ratio,
                .maxlen         = sizeof(dirty_background_ratio),
                .mode           = 0644,
-               .proc_handler   = &dirty_background_ratio_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = dirty_background_ratio_handler,
                .extra1         = &zero,
                .extra2         = &one_hundred,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "dirty_background_bytes",
                .data           = &dirty_background_bytes,
                .maxlen         = sizeof(dirty_background_bytes),
                .mode           = 0644,
-               .proc_handler   = &dirty_background_bytes_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = dirty_background_bytes_handler,
                .extra1         = &one_ul,
        },
        {
-               .ctl_name       = VM_DIRTY_RATIO,
                .procname       = "dirty_ratio",
                .data           = &vm_dirty_ratio,
                .maxlen         = sizeof(vm_dirty_ratio),
                .mode           = 0644,
-               .proc_handler   = &dirty_ratio_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = dirty_ratio_handler,
                .extra1         = &zero,
                .extra2         = &one_hundred,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "dirty_bytes",
                .data           = &vm_dirty_bytes,
                .maxlen         = sizeof(vm_dirty_bytes),
                .mode           = 0644,
-               .proc_handler   = &dirty_bytes_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = dirty_bytes_handler,
                .extra1         = &dirty_bytes_min,
        },
        {
                .data           = &dirty_writeback_interval,
                .maxlen         = sizeof(dirty_writeback_interval),
                .mode           = 0644,
-               .proc_handler   = &dirty_writeback_centisecs_handler,
+               .proc_handler   = dirty_writeback_centisecs_handler,
        },
        {
                .procname       = "dirty_expire_centisecs",
                .data           = &dirty_expire_interval,
                .maxlen         = sizeof(dirty_expire_interval),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = VM_NR_PDFLUSH_THREADS,
                .procname       = "nr_pdflush_threads",
                .data           = &nr_pdflush_threads,
                .maxlen         = sizeof nr_pdflush_threads,
                .mode           = 0444 /* read-only*/,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = VM_SWAPPINESS,
                .procname       = "swappiness",
                .data           = &vm_swappiness,
                .maxlen         = sizeof(vm_swappiness),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
                .extra2         = &one_hundred,
        },
                .data           = NULL,
                .maxlen         = sizeof(unsigned long),
                .mode           = 0644,
-               .proc_handler   = &hugetlb_sysctl_handler,
+               .proc_handler   = hugetlb_sysctl_handler,
                .extra1         = (void *)&hugetlb_zero,
                .extra2         = (void *)&hugetlb_infinity,
         },
         {
-               .ctl_name       = VM_HUGETLB_GROUP,
                .procname       = "hugetlb_shm_group",
                .data           = &sysctl_hugetlb_shm_group,
                .maxlen         = sizeof(gid_t),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
         },
         {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "hugepages_treat_as_movable",
                .data           = &hugepages_treat_as_movable,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &hugetlb_treat_movable_handler,
+               .proc_handler   = hugetlb_treat_movable_handler,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "nr_overcommit_hugepages",
                .data           = NULL,
                .maxlen         = sizeof(unsigned long),
                .mode           = 0644,
-               .proc_handler   = &hugetlb_overcommit_handler,
+               .proc_handler   = hugetlb_overcommit_handler,
                .extra1         = (void *)&hugetlb_zero,
                .extra2         = (void *)&hugetlb_infinity,
        },
  #endif
        {
-               .ctl_name       = VM_LOWMEM_RESERVE_RATIO,
                .procname       = "lowmem_reserve_ratio",
                .data           = &sysctl_lowmem_reserve_ratio,
                .maxlen         = sizeof(sysctl_lowmem_reserve_ratio),
                .mode           = 0644,
-               .proc_handler   = &lowmem_reserve_ratio_sysctl_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = lowmem_reserve_ratio_sysctl_handler,
        },
        {
-               .ctl_name       = VM_DROP_PAGECACHE,
                .procname       = "drop_caches",
                .data           = &sysctl_drop_caches,
                .maxlen         = sizeof(int),
                .mode           = 0644,
                .proc_handler   = drop_caches_sysctl_handler,
-               .strategy       = &sysctl_intvec,
        },
        {
-               .ctl_name       = VM_MIN_FREE_KBYTES,
                .procname       = "min_free_kbytes",
                .data           = &min_free_kbytes,
                .maxlen         = sizeof(min_free_kbytes),
                .mode           = 0644,
-               .proc_handler   = &min_free_kbytes_sysctl_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = min_free_kbytes_sysctl_handler,
                .extra1         = &zero,
        },
        {
-               .ctl_name       = VM_PERCPU_PAGELIST_FRACTION,
                .procname       = "percpu_pagelist_fraction",
                .data           = &percpu_pagelist_fraction,
                .maxlen         = sizeof(percpu_pagelist_fraction),
                .mode           = 0644,
-               .proc_handler   = &percpu_pagelist_fraction_sysctl_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = percpu_pagelist_fraction_sysctl_handler,
                .extra1         = &min_percpu_pagelist_fract,
        },
  #ifdef CONFIG_MMU
        {
-               .ctl_name       = VM_MAX_MAP_COUNT,
                .procname       = "max_map_count",
                .data           = &sysctl_max_map_count,
                .maxlen         = sizeof(sysctl_max_map_count),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec
+               .proc_handler   = proc_dointvec
        },
  #else
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "nr_trim_pages",
                .data           = &sysctl_nr_trim_pages,
                .maxlen         = sizeof(sysctl_nr_trim_pages),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
        },
  #endif
        {
-               .ctl_name       = VM_LAPTOP_MODE,
                .procname       = "laptop_mode",
                .data           = &laptop_mode,
                .maxlen         = sizeof(laptop_mode),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_jiffies,
-               .strategy       = &sysctl_jiffies,
+               .proc_handler   = proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = VM_BLOCK_DUMP,
                .procname       = "block_dump",
                .data           = &block_dump,
                .maxlen         = sizeof(block_dump),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec,
                .extra1         = &zero,
        },
        {
-               .ctl_name       = VM_VFS_CACHE_PRESSURE,
                .procname       = "vfs_cache_pressure",
                .data           = &sysctl_vfs_cache_pressure,
                .maxlen         = sizeof(sysctl_vfs_cache_pressure),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec,
                .extra1         = &zero,
        },
  #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
        {
-               .ctl_name       = VM_LEGACY_VA_LAYOUT,
                .procname       = "legacy_va_layout",
                .data           = &sysctl_legacy_va_layout,
                .maxlen         = sizeof(sysctl_legacy_va_layout),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec,
                .extra1         = &zero,
        },
  #endif
  #ifdef CONFIG_NUMA
        {
-               .ctl_name       = VM_ZONE_RECLAIM_MODE,
                .procname       = "zone_reclaim_mode",
                .data           = &zone_reclaim_mode,
                .maxlen         = sizeof(zone_reclaim_mode),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec,
                .extra1         = &zero,
        },
        {
-               .ctl_name       = VM_MIN_UNMAPPED,
                .procname       = "min_unmapped_ratio",
                .data           = &sysctl_min_unmapped_ratio,
                .maxlen         = sizeof(sysctl_min_unmapped_ratio),
                .mode           = 0644,
-               .proc_handler   = &sysctl_min_unmapped_ratio_sysctl_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = sysctl_min_unmapped_ratio_sysctl_handler,
                .extra1         = &zero,
                .extra2         = &one_hundred,
        },
        {
-               .ctl_name       = VM_MIN_SLAB,
                .procname       = "min_slab_ratio",
                .data           = &sysctl_min_slab_ratio,
                .maxlen         = sizeof(sysctl_min_slab_ratio),
                .mode           = 0644,
-               .proc_handler   = &sysctl_min_slab_ratio_sysctl_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = sysctl_min_slab_ratio_sysctl_handler,
                .extra1         = &zero,
                .extra2         = &one_hundred,
        },
  #endif
  #ifdef CONFIG_SMP
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "stat_interval",
                .data           = &sysctl_stat_interval,
                .maxlen         = sizeof(sysctl_stat_interval),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_jiffies,
-               .strategy       = &sysctl_jiffies,
+               .proc_handler   = proc_dointvec_jiffies,
        },
  #endif
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "mmap_min_addr",
                .data           = &dac_mmap_min_addr,
                .maxlen         = sizeof(unsigned long),
                .mode           = 0644,
-               .proc_handler   = &mmap_min_addr_handler,
+               .proc_handler   = mmap_min_addr_handler,
        },
  #ifdef CONFIG_NUMA
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "numa_zonelist_order",
                .data           = &numa_zonelist_order,
                .maxlen         = NUMA_ZONELIST_ORDER_LEN,
                .mode           = 0644,
-               .proc_handler   = &numa_zonelist_order_handler,
-               .strategy       = &sysctl_string,
+               .proc_handler   = numa_zonelist_order_handler,
        },
  #endif
  #if (defined(CONFIG_X86_32) && !defined(CONFIG_UML))|| \
     (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL))
        {
-               .ctl_name       = VM_VDSO_ENABLED,
                .procname       = "vdso_enabled",
                .data           = &vdso_enabled,
                .maxlen         = sizeof(vdso_enabled),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec,
                .extra1         = &zero,
        },
  #endif
  #ifdef CONFIG_HIGHMEM
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "highmem_is_dirtyable",
                .data           = &vm_highmem_is_dirtyable,
                .maxlen         = sizeof(vm_highmem_is_dirtyable),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
                .extra2         = &one,
        },
  #endif
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "scan_unevictable_pages",
                .data           = &scan_unevictable_pages,
                .maxlen         = sizeof(scan_unevictable_pages),
                .mode           = 0644,
-               .proc_handler   = &scan_unevictable_handler,
+               .proc_handler   = scan_unevictable_handler,
        },
  #ifdef CONFIG_MEMORY_FAILURE
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "memory_failure_early_kill",
                .data           = &sysctl_memory_failure_early_kill,
                .maxlen         = sizeof(sysctl_memory_failure_early_kill),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
                .extra2         = &one,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "memory_failure_recovery",
                .data           = &sysctl_memory_failure_recovery,
                .maxlen         = sizeof(sysctl_memory_failure_recovery),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
                .extra2         = &one,
        },
   * NOTE: do not add new entries to this table unless you have read
   * Documentation/sysctl/ctl_unnumbered.txt
   */
-       { .ctl_name = 0 }
+       { }
  };
  
  #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
  static struct ctl_table binfmt_misc_table[] = {
-       { .ctl_name = 0 }
+       { }
  };
  #endif
  
  static struct ctl_table fs_table[] = {
        {
-               .ctl_name       = FS_NRINODE,
                .procname       = "inode-nr",
                .data           = &inodes_stat,
                .maxlen         = 2*sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = FS_STATINODE,
                .procname       = "inode-state",
                .data           = &inodes_stat,
                .maxlen         = 7*sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
                .procname       = "file-nr",
                .data           = &files_stat,
                .maxlen         = 3*sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_nr_files,
+               .proc_handler   = proc_nr_files,
        },
        {
-               .ctl_name       = FS_MAXFILE,
                .procname       = "file-max",
                .data           = &files_stat.max_files,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "nr_open",
                .data           = &sysctl_nr_open,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &sysctl_nr_open_min,
                .extra2         = &sysctl_nr_open_max,
        },
        {
-               .ctl_name       = FS_DENTRY,
                .procname       = "dentry-state",
                .data           = &dentry_stat,
                .maxlen         = 6*sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = FS_OVERFLOWUID,
                .procname       = "overflowuid",
                .data           = &fs_overflowuid,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &minolduid,
                .extra2         = &maxolduid,
        },
        {
-               .ctl_name       = FS_OVERFLOWGID,
                .procname       = "overflowgid",
                .data           = &fs_overflowgid,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &minolduid,
                .extra2         = &maxolduid,
        },
  #ifdef CONFIG_FILE_LOCKING
        {
-               .ctl_name       = FS_LEASES,
                .procname       = "leases-enable",
                .data           = &leases_enable,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
  #ifdef CONFIG_DNOTIFY
        {
-               .ctl_name       = FS_DIR_NOTIFY,
                .procname       = "dir-notify-enable",
                .data           = &dir_notify_enable,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
  #ifdef CONFIG_MMU
  #ifdef CONFIG_FILE_LOCKING
        {
-               .ctl_name       = FS_LEASE_TIME,
                .procname       = "lease-break-time",
                .data           = &lease_break_time,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
  #endif
  #ifdef CONFIG_AIO
                .data           = &aio_nr,
                .maxlen         = sizeof(aio_nr),
                .mode           = 0444,
-               .proc_handler   = &proc_doulongvec_minmax,
+               .proc_handler   = proc_doulongvec_minmax,
        },
        {
                .procname       = "aio-max-nr",
                .data           = &aio_max_nr,
                .maxlen         = sizeof(aio_max_nr),
                .mode           = 0644,
-               .proc_handler   = &proc_doulongvec_minmax,
+               .proc_handler   = proc_doulongvec_minmax,
        },
  #endif /* CONFIG_AIO */
  #ifdef CONFIG_INOTIFY_USER
        {
-               .ctl_name       = FS_INOTIFY,
                .procname       = "inotify",
                .mode           = 0555,
                .child          = inotify_table,
  #endif
  #endif
        {
-               .ctl_name       = KERN_SETUID_DUMPABLE,
                .procname       = "suid_dumpable",
                .data           = &suid_dumpable,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
                .extra2         = &two,
        },
  #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "binfmt_misc",
                .mode           = 0555,
                .child          = binfmt_misc_table,
   * NOTE: do not add new entries to this table unless you have read
   * Documentation/sysctl/ctl_unnumbered.txt
   */
-       { .ctl_name = 0 }
+       { }
  };
  
  static struct ctl_table debug_table[] = {
  #if defined(CONFIG_X86) || defined(CONFIG_PPC)
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "exception-trace",
                .data           = &show_unhandled_signals,
                .maxlen         = sizeof(int),
                .proc_handler   = proc_dointvec
        },
  #endif
-       { .ctl_name = 0 }
+       { }
  };
  
  static struct ctl_table dev_table[] = {
-       { .ctl_name = 0 }
+       { }
  };
  
  static DEFINE_SPINLOCK(sysctl_lock);
@@@ -1769,122 -1583,6 +1586,6 @@@ void register_sysctl_root(struct ctl_ta
        spin_unlock(&sysctl_lock);
  }
  
- #ifdef CONFIG_SYSCTL_SYSCALL
- /* Perform the actual read/write of a sysctl table entry. */
- static int do_sysctl_strategy(struct ctl_table_root *root,
-                       struct ctl_table *table,
-                       void __user *oldval, size_t __user *oldlenp,
-                       void __user *newval, size_t newlen)
- {
-       int op = 0, rc;
-       if (oldval)
-               op |= MAY_READ;
-       if (newval)
-               op |= MAY_WRITE;
-       if (sysctl_perm(root, table, op))
-               return -EPERM;
-       if (table->strategy) {
-               rc = table->strategy(table, oldval, oldlenp, newval, newlen);
-               if (rc < 0)
-                       return rc;
-               if (rc > 0)
-                       return 0;
-       }
-       /* If there is no strategy routine, or if the strategy returns
-        * zero, proceed with automatic r/w */
-       if (table->data && table->maxlen) {
-               rc = sysctl_data(table, oldval, oldlenp, newval, newlen);
-               if (rc < 0)
-                       return rc;
-       }
-       return 0;
- }
- static int parse_table(int __user *name, int nlen,
-                      void __user *oldval, size_t __user *oldlenp,
-                      void __user *newval, size_t newlen,
-                      struct ctl_table_root *root,
-                      struct ctl_table *table)
- {
-       int n;
- repeat:
-       if (!nlen)
-               return -ENOTDIR;
-       if (get_user(n, name))
-               return -EFAULT;
-       for ( ; table->ctl_name || table->procname; table++) {
-               if (!table->ctl_name)
-                       continue;
-               if (n == table->ctl_name) {
-                       int error;
-                       if (table->child) {
-                               if (sysctl_perm(root, table, MAY_EXEC))
-                                       return -EPERM;
-                               name++;
-                               nlen--;
-                               table = table->child;
-                               goto repeat;
-                       }
-                       error = do_sysctl_strategy(root, table,
-                                                  oldval, oldlenp,
-                                                  newval, newlen);
-                       return error;
-               }
-       }
-       return -ENOTDIR;
- }
- int do_sysctl(int __user *name, int nlen, void __user *oldval, size_t __user *oldlenp,
-              void __user *newval, size_t newlen)
- {
-       struct ctl_table_header *head;
-       int error = -ENOTDIR;
-       if (nlen <= 0 || nlen >= CTL_MAXNAME)
-               return -ENOTDIR;
-       if (oldval) {
-               int old_len;
-               if (!oldlenp || get_user(old_len, oldlenp))
-                       return -EFAULT;
-       }
-       for (head = sysctl_head_next(NULL); head;
-                       head = sysctl_head_next(head)) {
-               error = parse_table(name, nlen, oldval, oldlenp, 
-                                       newval, newlen,
-                                       head->root, head->ctl_table);
-               if (error != -ENOTDIR) {
-                       sysctl_head_finish(head);
-                       break;
-               }
-       }
-       return error;
- }
- SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args)
- {
-       struct __sysctl_args tmp;
-       int error;
-       if (copy_from_user(&tmp, args, sizeof(tmp)))
-               return -EFAULT;
-       error = deprecated_sysctl_warning(&tmp);
-       if (error)
-               goto out;
-       lock_kernel();
-       error = do_sysctl(tmp.name, tmp.nlen, tmp.oldval, tmp.oldlenp,
-                         tmp.newval, tmp.newlen);
-       unlock_kernel();
- out:
-       return error;
- }
- #endif /* CONFIG_SYSCTL_SYSCALL */
  /*
   * sysctl_perm does NOT grant the superuser all rights automatically, because
   * some sysctl variables are readonly even to root.
@@@ -1920,7 -1618,7 +1621,7 @@@ int sysctl_perm(struct ctl_table_root *
  
  static void sysctl_set_parent(struct ctl_table *parent, struct ctl_table *table)
  {
-       for (; table->ctl_name || table->procname; table++) {
+       for (; table->procname; table++) {
                table->parent = parent;
                if (table->child)
                        sysctl_set_parent(table, table->child);
@@@ -1952,11 -1650,11 +1653,11 @@@ static struct ctl_table *is_branch_in(s
                return NULL;
  
        /* ... and nothing else */
-       if (branch[1].procname || branch[1].ctl_name)
+       if (branch[1].procname)
                return NULL;
  
        /* table should contain subdirectory with the same name */
-       for (p = table; p->procname || p->ctl_name; p++) {
+       for (p = table; p->procname; p++) {
                if (!p->child)
                        continue;
                if (p->procname && strcmp(p->procname, s) == 0)
@@@ -2001,9 -1699,6 +1702,6 @@@ static void try_attach(struct ctl_table
   *
   * The members of the &struct ctl_table structure are used as follows:
   *
-  * ctl_name - This is the numeric sysctl value used by sysctl(2). The number
-  *            must be unique within that level of sysctl
-  *
   * procname - the name of the sysctl file under /proc/sys. Set to %NULL to not
   *            enter a sysctl file
   *
   *
   * proc_handler - the text handler routine (described below)
   *
-  * strategy - the strategy routine (described below)
-  *
   * de - for internal use by the sysctl routines
   *
   * extra1, extra2 - extra pointers usable by the proc handler routines
   * struct enable minimal validation of the values being written to be
   * performed, and the mode field allows minimal authentication.
   *
-  * More sophisticated management can be enabled by the provision of a
-  * strategy routine with the table entry.  This will be called before
-  * any automatic read or write of the data is performed.
-  *
-  * The strategy routine may return
-  *
-  * < 0 - Error occurred (error is passed to user process)
-  *
-  * 0   - OK - proceed with automatic read or write.
-  *
-  * > 0 - OK - read or write has been done by the strategy routine, so
-  *       return immediately.
-  *
   * There must be a proc_handler routine for any terminal nodes
   * mirrored under /proc/sys (non-terminals are handled by a built-in
   * directory handler).  Several default handlers are available to
@@@ -2071,13 -1751,13 +1754,13 @@@ struct ctl_table_header *__register_sys
        struct ctl_table_set *set;
  
        /* Count the path components */
-       for (npath = 0; path[npath].ctl_name || path[npath].procname; ++npath)
+       for (npath = 0; path[npath].procname; ++npath)
                ;
  
        /*
         * For each path component, allocate a 2-element ctl_table array.
         * The first array element will be filled with the sysctl entry
-        * for this, the second will be the sentinel (ctl_name == 0).
+        * for this, the second will be the sentinel (procname == 0).
         *
         * We allocate everything in one go so that we don't have to
         * worry about freeing additional memory in unregister_sysctl_table.
        for (n = 0; n < npath; ++n, ++path) {
                /* Copy the procname */
                new->procname = path->procname;
-               new->ctl_name = path->ctl_name;
                new->mode     = 0555;
  
                *prevp = new;
@@@ -2956,286 -2635,6 +2638,6 @@@ int proc_doulongvec_ms_jiffies_minmax(s
  
  #endif /* CONFIG_PROC_FS */
  
- #ifdef CONFIG_SYSCTL_SYSCALL
- /*
-  * General sysctl support routines 
-  */
- /* The generic sysctl data routine (used if no strategy routine supplied) */
- int sysctl_data(struct ctl_table *table,
-               void __user *oldval, size_t __user *oldlenp,
-               void __user *newval, size_t newlen)
- {
-       size_t len;
-       /* Get out of I don't have a variable */
-       if (!table->data || !table->maxlen)
-               return -ENOTDIR;
-       if (oldval && oldlenp) {
-               if (get_user(len, oldlenp))
-                       return -EFAULT;
-               if (len) {
-                       if (len > table->maxlen)
-                               len = table->maxlen;
-                       if (copy_to_user(oldval, table->data, len))
-                               return -EFAULT;
-                       if (put_user(len, oldlenp))
-                               return -EFAULT;
-               }
-       }
-       if (newval && newlen) {
-               if (newlen > table->maxlen)
-                       newlen = table->maxlen;
-               if (copy_from_user(table->data, newval, newlen))
-                       return -EFAULT;
-       }
-       return 1;
- }
- /* The generic string strategy routine: */
- int sysctl_string(struct ctl_table *table,
-                 void __user *oldval, size_t __user *oldlenp,
-                 void __user *newval, size_t newlen)
- {
-       if (!table->data || !table->maxlen) 
-               return -ENOTDIR;
-       
-       if (oldval && oldlenp) {
-               size_t bufsize;
-               if (get_user(bufsize, oldlenp))
-                       return -EFAULT;
-               if (bufsize) {
-                       size_t len = strlen(table->data), copied;
-                       /* This shouldn't trigger for a well-formed sysctl */
-                       if (len > table->maxlen)
-                               len = table->maxlen;
-                       /* Copy up to a max of bufsize-1 bytes of the string */
-                       copied = (len >= bufsize) ? bufsize - 1 : len;
-                       if (copy_to_user(oldval, table->data, copied) ||
-                           put_user(0, (char __user *)(oldval + copied)))
-                               return -EFAULT;
-                       if (put_user(len, oldlenp))
-                               return -EFAULT;
-               }
-       }
-       if (newval && newlen) {
-               size_t len = newlen;
-               if (len > table->maxlen)
-                       len = table->maxlen;
-               if(copy_from_user(table->data, newval, len))
-                       return -EFAULT;
-               if (len == table->maxlen)
-                       len--;
-               ((char *) table->data)[len] = 0;
-       }
-       return 1;
- }
- /*
-  * This function makes sure that all of the integers in the vector
-  * are between the minimum and maximum values given in the arrays
-  * table->extra1 and table->extra2, respectively.
-  */
- int sysctl_intvec(struct ctl_table *table,
-               void __user *oldval, size_t __user *oldlenp,
-               void __user *newval, size_t newlen)
- {
-       if (newval && newlen) {
-               int __user *vec = (int __user *) newval;
-               int *min = (int *) table->extra1;
-               int *max = (int *) table->extra2;
-               size_t length;
-               int i;
-               if (newlen % sizeof(int) != 0)
-                       return -EINVAL;
-               if (!table->extra1 && !table->extra2)
-                       return 0;
-               if (newlen > table->maxlen)
-                       newlen = table->maxlen;
-               length = newlen / sizeof(int);
-               for (i = 0; i < length; i++) {
-                       int value;
-                       if (get_user(value, vec + i))
-                               return -EFAULT;
-                       if (min && value < min[i])
-                               return -EINVAL;
-                       if (max && value > max[i])
-                               return -EINVAL;
-               }
-       }
-       return 0;
- }
- /* Strategy function to convert jiffies to seconds */ 
- int sysctl_jiffies(struct ctl_table *table,
-               void __user *oldval, size_t __user *oldlenp,
-               void __user *newval, size_t newlen)
- {
-       if (oldval && oldlenp) {
-               size_t olen;
-               if (get_user(olen, oldlenp))
-                       return -EFAULT;
-               if (olen) {
-                       int val;
-                       if (olen < sizeof(int))
-                               return -EINVAL;
-                       val = *(int *)(table->data) / HZ;
-                       if (put_user(val, (int __user *)oldval))
-                               return -EFAULT;
-                       if (put_user(sizeof(int), oldlenp))
-                               return -EFAULT;
-               }
-       }
-       if (newval && newlen) { 
-               int new;
-               if (newlen != sizeof(int))
-                       return -EINVAL; 
-               if (get_user(new, (int __user *)newval))
-                       return -EFAULT;
-               *(int *)(table->data) = new*HZ; 
-       }
-       return 1;
- }
- /* Strategy function to convert jiffies to seconds */ 
- int sysctl_ms_jiffies(struct ctl_table *table,
-               void __user *oldval, size_t __user *oldlenp,
-               void __user *newval, size_t newlen)
- {
-       if (oldval && oldlenp) {
-               size_t olen;
-               if (get_user(olen, oldlenp))
-                       return -EFAULT;
-               if (olen) {
-                       int val;
-                       if (olen < sizeof(int))
-                               return -EINVAL;
-                       val = jiffies_to_msecs(*(int *)(table->data));
-                       if (put_user(val, (int __user *)oldval))
-                               return -EFAULT;
-                       if (put_user(sizeof(int), oldlenp))
-                               return -EFAULT;
-               }
-       }
-       if (newval && newlen) { 
-               int new;
-               if (newlen != sizeof(int))
-                       return -EINVAL; 
-               if (get_user(new, (int __user *)newval))
-                       return -EFAULT;
-               *(int *)(table->data) = msecs_to_jiffies(new);
-       }
-       return 1;
- }
- #else /* CONFIG_SYSCTL_SYSCALL */
- SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args)
- {
-       struct __sysctl_args tmp;
-       int error;
-       if (copy_from_user(&tmp, args, sizeof(tmp)))
-               return -EFAULT;
-       error = deprecated_sysctl_warning(&tmp);
-       /* If no error reading the parameters then just -ENOSYS ... */
-       if (!error)
-               error = -ENOSYS;
-       return error;
- }
- int sysctl_data(struct ctl_table *table,
-                 void __user *oldval, size_t __user *oldlenp,
-                 void __user *newval, size_t newlen)
- {
-       return -ENOSYS;
- }
- int sysctl_string(struct ctl_table *table,
-                 void __user *oldval, size_t __user *oldlenp,
-                 void __user *newval, size_t newlen)
- {
-       return -ENOSYS;
- }
- int sysctl_intvec(struct ctl_table *table,
-               void __user *oldval, size_t __user *oldlenp,
-               void __user *newval, size_t newlen)
- {
-       return -ENOSYS;
- }
- int sysctl_jiffies(struct ctl_table *table,
-               void __user *oldval, size_t __user *oldlenp,
-               void __user *newval, size_t newlen)
- {
-       return -ENOSYS;
- }
- int sysctl_ms_jiffies(struct ctl_table *table,
-               void __user *oldval, size_t __user *oldlenp,
-               void __user *newval, size_t newlen)
- {
-       return -ENOSYS;
- }
- #endif /* CONFIG_SYSCTL_SYSCALL */
- static int deprecated_sysctl_warning(struct __sysctl_args *args)
- {
-       static int msg_count;
-       int name[CTL_MAXNAME];
-       int i;
-       /* Check args->nlen. */
-       if (args->nlen < 0 || args->nlen > CTL_MAXNAME)
-               return -ENOTDIR;
-       /* Read in the sysctl name for better debug message logging */
-       for (i = 0; i < args->nlen; i++)
-               if (get_user(name[i], args->name + i))
-                       return -EFAULT;
-       /* Ignore accesses to kernel.version */
-       if ((args->nlen == 2) && (name[0] == CTL_KERN) && (name[1] == KERN_VERSION))
-               return 0;
-       if (msg_count < 5) {
-               msg_count++;
-               printk(KERN_INFO
-                       "warning: process `%s' used the deprecated sysctl "
-                       "system call with ", current->comm);
-               for (i = 0; i < args->nlen; i++)
-                       printk("%d.", name[i]);
-               printk("\n");
-       }
-       return 0;
- }
  /*
   * No sense putting this after each symbol definition, twice,
   * exception granted :-)
@@@ -3250,9 -2649,4 +2652,4 @@@ EXPORT_SYMBOL(proc_doulongvec_minmax)
  EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax);
  EXPORT_SYMBOL(register_sysctl_table);
  EXPORT_SYMBOL(register_sysctl_paths);
- EXPORT_SYMBOL(sysctl_intvec);
- EXPORT_SYMBOL(sysctl_jiffies);
- EXPORT_SYMBOL(sysctl_ms_jiffies);
- EXPORT_SYMBOL(sysctl_string);
- EXPORT_SYMBOL(sysctl_data);
  EXPORT_SYMBOL(unregister_sysctl_table);
diff --combined lib/Kconfig.debug
@@@ -750,7 -750,7 +750,7 @@@ config RCU_TORTURE_TEST_RUNNABL
  config RCU_CPU_STALL_DETECTOR
        bool "Check for stalled CPUs delaying RCU grace periods"
        depends on TREE_RCU || TREE_PREEMPT_RCU
 -      default n
 +      default y
        help
          This option causes RCU to printk information on which
          CPUs are delaying the current grace period, but only when
@@@ -912,7 -912,7 +912,7 @@@ config LATENCYTO
  
  config SYSCTL_SYSCALL_CHECK
        bool "Sysctl checks"
-       depends on SYSCTL_SYSCALL
+       depends on SYSCTL
        ---help---
          sys_sysctl uses binary paths that have been found challenging
          to properly maintain and use. This enables checks that help
  #include <linux/module.h>
  #include <linux/socket.h>
  #include <linux/netdevice.h>
 +#include <linux/ratelimit.h>
  #include <linux/init.h>
 +
  #include <net/ip.h>
  #include <net/sock.h>
  
  static struct ctl_table net_core_table[] = {
  #ifdef CONFIG_NET
        {
-               .ctl_name       = NET_CORE_WMEM_MAX,
                .procname       = "wmem_max",
                .data           = &sysctl_wmem_max,
                .maxlen         = sizeof(int),
@@@ -27,7 -24,6 +26,6 @@@
                .proc_handler   = proc_dointvec
        },
        {
-               .ctl_name       = NET_CORE_RMEM_MAX,
                .procname       = "rmem_max",
                .data           = &sysctl_rmem_max,
                .maxlen         = sizeof(int),
@@@ -35,7 -31,6 +33,6 @@@
                .proc_handler   = proc_dointvec
        },
        {
-               .ctl_name       = NET_CORE_WMEM_DEFAULT,
                .procname       = "wmem_default",
                .data           = &sysctl_wmem_default,
                .maxlen         = sizeof(int),
@@@ -43,7 -38,6 +40,6 @@@
                .proc_handler   = proc_dointvec
        },
        {
-               .ctl_name       = NET_CORE_RMEM_DEFAULT,
                .procname       = "rmem_default",
                .data           = &sysctl_rmem_default,
                .maxlen         = sizeof(int),
@@@ -51,7 -45,6 +47,6 @@@
                .proc_handler   = proc_dointvec
        },
        {
-               .ctl_name       = NET_CORE_DEV_WEIGHT,
                .procname       = "dev_weight",
                .data           = &weight_p,
                .maxlen         = sizeof(int),
@@@ -59,7 -52,6 +54,6 @@@
                .proc_handler   = proc_dointvec
        },
        {
-               .ctl_name       = NET_CORE_MAX_BACKLOG,
                .procname       = "netdev_max_backlog",
                .data           = &netdev_max_backlog,
                .maxlen         = sizeof(int),
                .proc_handler   = proc_dointvec
        },
        {
-               .ctl_name       = NET_CORE_MSG_COST,
                .procname       = "message_cost",
                .data           = &net_ratelimit_state.interval,
                .maxlen         = sizeof(int),
                .mode           = 0644,
                .proc_handler   = proc_dointvec_jiffies,
-               .strategy       = sysctl_jiffies,
        },
        {
-               .ctl_name       = NET_CORE_MSG_BURST,
                .procname       = "message_burst",
                .data           = &net_ratelimit_state.burst,
                .maxlen         = sizeof(int),
@@@ -84,7 -73,6 +75,6 @@@
                .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = NET_CORE_OPTMEM_MAX,
                .procname       = "optmem_max",
                .data           = &sysctl_optmem_max,
                .maxlen         = sizeof(int),
@@@ -93,7 -81,6 +83,6 @@@
        },
  #endif /* CONFIG_NET */
        {
-               .ctl_name       = NET_CORE_BUDGET,
                .procname       = "netdev_budget",
                .data           = &netdev_budget,
                .maxlen         = sizeof(int),
                .proc_handler   = proc_dointvec
        },
        {
-               .ctl_name       = NET_CORE_WARNINGS,
                .procname       = "warnings",
                .data           = &net_msg_warn,
                .maxlen         = sizeof(int),
                .mode           = 0644,
                .proc_handler   = proc_dointvec
        },
-       { .ctl_name = 0 }
+       { }
  };
  
  static struct ctl_table netns_core_table[] = {
        {
-               .ctl_name       = NET_CORE_SOMAXCONN,
                .procname       = "somaxconn",
                .data           = &init_net.core.sysctl_somaxconn,
                .maxlen         = sizeof(int),
                .mode           = 0644,
                .proc_handler   = proc_dointvec
        },
-       { .ctl_name = 0 }
+       { }
  };
  
  __net_initdata struct ctl_path net_core_path[] = {
-       { .procname = "net", .ctl_name = CTL_NET, },
-       { .procname = "core", .ctl_name = NET_CORE, },
+       { .procname = "net", },
+       { .procname = "core", },
        { },
  };
  
diff --combined net/ipv4/ip_fragment.c
@@@ -563,7 -563,7 +563,7 @@@ out_oversize
                printk(KERN_INFO "Oversized IP packet from %pI4.\n",
                        &qp->saddr);
  out_fail:
 -      IP_INC_STATS_BH(dev_net(dev), IPSTATS_MIB_REASMFAILS);
 +      IP_INC_STATS_BH(net, IPSTATS_MIB_REASMFAILS);
        return err;
  }
  
@@@ -603,7 -603,6 +603,6 @@@ static int zero
  
  static struct ctl_table ip4_frags_ns_ctl_table[] = {
        {
-               .ctl_name       = NET_IPV4_IPFRAG_HIGH_THRESH,
                .procname       = "ipfrag_high_thresh",
                .data           = &init_net.ipv4.frags.high_thresh,
                .maxlen         = sizeof(int),
                .proc_handler   = proc_dointvec
        },
        {
-               .ctl_name       = NET_IPV4_IPFRAG_LOW_THRESH,
                .procname       = "ipfrag_low_thresh",
                .data           = &init_net.ipv4.frags.low_thresh,
                .maxlen         = sizeof(int),
                .proc_handler   = proc_dointvec
        },
        {
-               .ctl_name       = NET_IPV4_IPFRAG_TIME,
                .procname       = "ipfrag_time",
                .data           = &init_net.ipv4.frags.timeout,
                .maxlen         = sizeof(int),
                .mode           = 0644,
                .proc_handler   = proc_dointvec_jiffies,
-               .strategy       = sysctl_jiffies
        },
        { }
  };
  
  static struct ctl_table ip4_frags_ctl_table[] = {
        {
-               .ctl_name       = NET_IPV4_IPFRAG_SECRET_INTERVAL,
                .procname       = "ipfrag_secret_interval",
                .data           = &ip4_frags.secret_interval,
                .maxlen         = sizeof(int),
                .mode           = 0644,
                .proc_handler   = proc_dointvec_jiffies,
-               .strategy       = sysctl_jiffies
        },
        {
                .procname       = "ipfrag_max_dist",
diff --combined net/netfilter/nf_log.c
@@@ -128,8 -128,9 +128,8 @@@ EXPORT_SYMBOL(nf_log_packet)
  
  #ifdef CONFIG_PROC_FS
  static void *seq_start(struct seq_file *seq, loff_t *pos)
 -      __acquires(RCU)
  {
 -      rcu_read_lock();
 +      mutex_lock(&nf_log_mutex);
  
        if (*pos >= ARRAY_SIZE(nf_loggers))
                return NULL;
@@@ -148,8 -149,9 +148,8 @@@ static void *seq_next(struct seq_file *
  }
  
  static void seq_stop(struct seq_file *s, void *v)
 -      __releases(RCU)
  {
 -      rcu_read_unlock();
 +      mutex_unlock(&nf_log_mutex);
  }
  
  static int seq_show(struct seq_file *s, void *v)
        struct nf_logger *t;
        int ret;
  
 -      logger = rcu_dereference(nf_loggers[*pos]);
 +      logger = nf_loggers[*pos];
  
        if (!logger)
                ret = seq_printf(s, "%2lld NONE (", *pos);
        if (ret < 0)
                return ret;
  
 -      mutex_lock(&nf_log_mutex);
        list_for_each_entry(t, &nf_loggers_l[*pos], list[*pos]) {
                ret = seq_printf(s, "%s", t->name);
 -              if (ret < 0) {
 -                      mutex_unlock(&nf_log_mutex);
 +              if (ret < 0)
                        return ret;
 -              }
                if (&t->list[*pos] != nf_loggers_l[*pos].prev) {
                        ret = seq_printf(s, ",");
 -                      if (ret < 0) {
 -                              mutex_unlock(&nf_log_mutex);
 +                      if (ret < 0)
                                return ret;
 -                      }
                }
        }
 -      mutex_unlock(&nf_log_mutex);
  
        return seq_printf(s, ")\n");
  }
@@@ -208,9 -216,9 +208,9 @@@ static const struct file_operations nfl
  
  #ifdef CONFIG_SYSCTL
  static struct ctl_path nf_log_sysctl_path[] = {
-       { .procname = "net", .ctl_name = CTL_NET, },
-       { .procname = "netfilter", .ctl_name = NET_NETFILTER, },
-       { .procname = "nf_log", .ctl_name = CTL_UNNUMBERED, },
+       { .procname = "net", },
+       { .procname = "netfilter", },
+       { .procname = "nf_log", },
        { }
  };
  
@@@ -265,7 -273,6 +265,6 @@@ static __init int netfilter_log_sysctl_
  
        for (i = NFPROTO_UNSPEC; i < NFPROTO_NUMPROTO; i++) {
                snprintf(nf_log_sysctl_fnames[i-NFPROTO_UNSPEC], 3, "%d", i);
-               nf_log_sysctl_table[i].ctl_name = CTL_UNNUMBERED;
                nf_log_sysctl_table[i].procname =
                        nf_log_sysctl_fnames[i-NFPROTO_UNSPEC];
                nf_log_sysctl_table[i].data = NULL;
@@@ -13,8 -13,6 +13,8 @@@
  #include <linux/mount.h>
  #include <linux/mnt_namespace.h>
  #include <linux/fs_struct.h>
 +#include <linux/hash.h>
 +
  #include "common.h"
  #include "realpath.h"
  
@@@ -110,6 -108,15 +110,15 @@@ int tomoyo_realpath_from_path2(struct p
                spin_unlock(&dcache_lock);
                path_put(&root);
                path_put(&ns_root);
+               /* Prepend "/proc" prefix if using internal proc vfs mount. */
+               if (!IS_ERR(sp) && (path->mnt->mnt_parent == path->mnt) &&
+                   (strcmp(path->mnt->mnt_sb->s_type->name, "proc") == 0)) {
+                       sp -= 5;
+                       if (sp >= newname)
+                               memcpy(sp, "/proc", 5);
+                       else
+                               sp = ERR_PTR(-ENOMEM);
+               }
        }
        if (IS_ERR(sp))
                error = PTR_ERR(sp);
@@@ -265,8 -272,7 +274,8 @@@ static unsigned int tomoyo_quota_for_sa
   * table. Frequency of appending strings is very low. So we don't need
   * large (e.g. 64k) hash size. 256 will be sufficient.
   */
 -#define TOMOYO_MAX_HASH 256
 +#define TOMOYO_HASH_BITS  8
 +#define TOMOYO_MAX_HASH (1u<<TOMOYO_HASH_BITS)
  
  /*
   * tomoyo_name_entry is a structure which is used for linking
@@@ -318,7 -324,6 +327,7 @@@ const struct tomoyo_path_info *tomoyo_s
        struct tomoyo_free_memory_block_list *fmb;
        int len;
        char *cp;
 +      struct list_head *head;
  
        if (!name)
                return NULL;
                return NULL;
        }
        hash = full_name_hash((const unsigned char *) name, len - 1);
 +      head = &tomoyo_name_list[hash_long(hash, TOMOYO_HASH_BITS)];
 +
        mutex_lock(&lock);
 -      list_for_each_entry(ptr, &tomoyo_name_list[hash % TOMOYO_MAX_HASH],
 -                           list) {
 +      list_for_each_entry(ptr, head, list) {
                if (hash == ptr->entry.hash && !strcmp(name, ptr->entry.name))
                        goto out;
        }
        tomoyo_fill_path_info(&ptr->entry);
        fmb->ptr += len;
        fmb->len -= len;
 -      list_add_tail(&ptr->list, &tomoyo_name_list[hash % TOMOYO_MAX_HASH]);
 +      list_add_tail(&ptr->list, head);
        if (fmb->len == 0) {
                list_del(&fmb->list);
                kfree(fmb);