1. 03 3月, 2017 18 次提交
    • I
      sched/headers: Move the NOHZ APIs from <linux/sched.h> to <linux/sched/nohz.h> · 752b3ca7
      Ingo Molnar 提交于
      There's a number of NOHZ/dyntics related functionality in <linux/sched.h>,
      but only a handful of timer files are making use of them.
      
      Move them into their own header. This better documents these APIs
      and unclutters <linux/sched.h>.
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      752b3ca7
    • I
      sched/headers: Move task statistics APIs from <linux/sched.h> to <linux/sched/stat.h> · 3605df49
      Ingo Molnar 提交于
      There are a number of task statistics related variables and methods exported
      via sched.h - collect them into <linux/sched/stat.h> and include it from
      their usage sites.
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      3605df49
    • I
      sched/headers: Move the memalloc_noio_*() APIs to <linux/sched/mm.h> · 74444eda
      Ingo Molnar 提交于
      In preparation to remove the <linux/gfp.h> include from <linux/sched.h>.
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      74444eda
    • I
      sched/headers: Move signal wakeup & sigpending methods from <linux/sched.h>... · 2a1f062a
      Ingo Molnar 提交于
      sched/headers: Move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h>
      
      This reduces the size of <linux/sched.h>.
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      2a1f062a
    • I
      sched/headers: Move CONFIG_TASK_XACCT bits from <linux/sched.h> to <linux/sched/xacct.h> · 9a070004
      Ingo Molnar 提交于
      The CONFIG_TASK_XACCT=y accounting inline functions are only used by
      fs/read_write.c, so move them into their separate header.
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      9a070004
    • I
      sched/headers: Remove various unrelated headers from <linux/sched.h> · 30a1baab
      Ingo Molnar 提交于
      Remove the following header inclusions from <linux/sched.h>:
      
      	#include <asm/param.h>
      	#include <linux/threads.h>
      	#include <linux/kernel.h>
      	#include <linux/types.h>
      	#include <linux/timex.h>
      	#include <linux/jiffies.h>
      	#include <linux/rbtree.h>
      	#include <linux/thread_info.h>
      	#include <linux/cpumask.h>
      	#include <linux/errno.h>
      	#include <linux/nodemask.h>
      	#include <linux/preempt.h>
      	#include <asm/page.h>
      	#include <linux/smp.h>
      	#include <linux/compiler.h>
      	#include <linux/completion.h>
      	#include <linux/percpu.h>
      	#include <linux/topology.h>
      	#include <linux/rcupdate.h>
      	#include <linux/time.h>
      	#include <linux/timer.h>
      	#include <linux/llist.h>
      	#include <linux/uidgid.h>
      	#include <asm/processor.h>
      
      because they are either not required, or are already included
      naturally as part of the remaining headers.
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      30a1baab
    • I
      sched/headers: Move the JOBCTL_ defines and methods from <linux/sched.h> to <linux/sched/jobctl.h> · c41cfc6c
      Ingo Molnar 提交于
      Only a small fraction of sched.h users actually utilizes these defines,
      and they are not scheduler functionality in any case, so move them
      into their separate header.
      
      (Also make <linux/sched/jobctl.h> a self-contained header.)
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      c41cfc6c
    • I
      sched/headers: Move the NUMA balancing interfaces from <linux/sched.h> to... · 5647028d
      Ingo Molnar 提交于
      sched/headers: Move the NUMA balancing interfaces from <linux/sched.h> to <linux/sched/numa_balancing.h>
      
      Split out the interface between the scheduler and the MM which
      deals with page fault driven NUMA balancing, into the new
      <linux/sched/numa_balancing.h> header.
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      5647028d
    • I
      sched/headers: Move in_vfork() from <linux/sched.h> to <linux/sched/mm.h> · d026ce79
      Ingo Molnar 提交于
      The in_vfork() function deals with task->mm, so it better belongs
      into <linux/sched/mm.h>.
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      d026ce79
    • I
      sched/headers: Move the 'init_mm' declaration from <linux/sched.h> to <linux/mm_types.h> · abe722a1
      Ingo Molnar 提交于
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      abe722a1
    • I
      sched/headers: Move more mm_struct related functionality from <linux/sched.h> to <linux/sched/mm.h> · 4240c8bf
      Ingo Molnar 提交于
      Neither the mmap_layout nor the mm_update_next_owner() methods need to be
      in <linux/sched.h> - move them to the more appropriate <linux/sched/mm.h> header.
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      4240c8bf
    • I
      sched/headers: Move the cpufreq interfaces to <linux/sched/cpufreq.h> · 7284c6d4
      Ingo Molnar 提交于
      No need to have this in the generic <linux/sched.h> header.
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      7284c6d4
    • I
      sched/headers: Move 'struct pacct_struct' and 'struct cpu_itimer' form... · 8d88460e
      Ingo Molnar 提交于
      sched/headers: Move 'struct pacct_struct' and 'struct cpu_itimer' form <linux/sched.h> to <linux/sched/signal.h>
      
      These structures are actually part of 'struct signal', so move them to <linux/sched/signal.h>
      where they belong.
      
      This further decreases the size and complexity of <linux/sched.h>.
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      8d88460e
    • I
      sched/headers: Move softlockup detector watchdog methods to <linux/nmi.h> · d151b27d
      Ingo Molnar 提交于
      These methods don't belong into <linux/sched.h>, they are neither directly
      related to task_struct or are scheduler functionality.
      
      Put them next to the other watchdog methods in <linux/nmi.h>.
      
      ( Arguably that header's name is a misnomer, and this patch makes it
        more so - but it should be renamed in another patch. )
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      d151b27d
    • I
      sched/headers: Move 'struct user_struct' definition and APIs to the new <linux/sched/user.h> header · bcbb6a5b
      Ingo Molnar 提交于
      'struct user_struct' was added to sched.h historically, but it's actually
      entirely independent of task_struct and of scheduler details, so move
      it to its own header.
      
      Fix up .c files using those facilities.
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      bcbb6a5b
    • I
      sched/headers: Move task_struct::signal and task_struct::sighand types and... · c3edc401
      Ingo Molnar 提交于
      sched/headers: Move task_struct::signal and task_struct::sighand types and accessors into <linux/sched/signal.h>
      
      task_struct::signal and task_struct::sighand are pointers, which would normally make it
      straightforward to not define those types in sched.h.
      
      That is not so, because the types are accompanied by a myriad of APIs (macros and inline
      functions) that dereference them.
      
      Split the types and the APIs out of sched.h and move them into a new header, <linux/sched/signal.h>.
      
      With this change sched.h does not know about 'struct signal' and 'struct sighand' anymore,
      trying to put accessors into sched.h as a test fails the following way:
      
        ./include/linux/sched.h: In function ‘test_signal_types’:
        ./include/linux/sched.h:2461:18: error: dereferencing pointer to incomplete type ‘struct signal_struct’
                          ^
      
      This reduces the size and complexity of sched.h significantly.
      
      Update all headers and .c code that relied on getting the signal handling
      functionality from <linux/sched.h> to include <linux/sched/signal.h>.
      
      The list of affected files in the preparatory patch was partly generated by
      grepping for the APIs, and partly by doing coverage build testing, both
      all[yes|mod|def|no]config builds on 64-bit and 32-bit x86, and an array of
      cross-architecture builds.
      
      Nevertheless some (trivial) build breakage is still expected related to rare
      Kconfig combinations and in-flight patches to various kernel code, but most
      of it should be handled by this patch.
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      c3edc401
    • I
      sched/headers: Move task->mm coredumping related defines and methods from... · 11701c67
      Ingo Molnar 提交于
      sched/headers: Move task->mm coredumping related defines and methods from <linux/sched.h> to <linux/sched/coredump.h>
      
      This further reduces the size and complexity of <linux/sched.h>.
      
      These are the definitions and APIs that are moved:
      
        # MMF_*:
        fs/binfmt_elf.c
        fs/binfmt_elf_fdpic.c
        fs/exec.c
        fs/proc/base.c
        include/linux/khugepaged.h
        include/linux/ksm.h
        include/linux/sched/coredump.h
        kernel/events/uprobes.c
        kernel/fork.c
        mm/huge_memory.c
        mm/khugepaged.c
        mm/ksm.c
        mm/memory.c
        mm/oom_kill.c
      
        # SUID_DUMP_*:
        arch/ia64/include/asm/processor.h
        fs/coredump.c
        fs/exec.c
        fs/proc/internal.h
        include/linux/sched/coredump.h
        kernel/ptrace.c
        kernel/sys.c
        kernel/sysctl.c
      
        # get_dumpable():
        arch/ia64/include/asm/processor.h
        fs/coredump.c
        fs/exec.c
        fs/proc/internal.h
        include/linux/sched/coredump.h
        kernel/ptrace.c
        kernel/sys.c
      
        # set_dumpable():
        fs/exec.c
        include/linux/sched/coredump.h
        kernel/cred.c
        kernel/sys.c
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      11701c67
    • I
      sched/headers: Move task->mm handling methods to <linux/sched/mm.h> · 68e21be2
      Ingo Molnar 提交于
      Move the following task->mm helper APIs into a new header file,
      <linux/sched/mm.h>, to further reduce the size and complexity
      of <linux/sched.h>.
      
      Here are how the APIs are used in various kernel files:
      
        # mm_alloc():
        arch/arm/mach-rpc/ecard.c
        fs/exec.c
        include/linux/sched/mm.h
        kernel/fork.c
      
        # __mmdrop():
        arch/arc/include/asm/mmu_context.h
        include/linux/sched/mm.h
        kernel/fork.c
      
        # mmdrop():
        arch/arm/mach-rpc/ecard.c
        arch/m68k/sun3/mmu_emu.c
        arch/x86/mm/tlb.c
        drivers/gpu/drm/amd/amdkfd/kfd_process.c
        drivers/gpu/drm/i915/i915_gem_userptr.c
        drivers/infiniband/hw/hfi1/file_ops.c
        drivers/vfio/vfio_iommu_spapr_tce.c
        fs/exec.c
        fs/proc/base.c
        fs/proc/task_mmu.c
        fs/proc/task_nommu.c
        fs/userfaultfd.c
        include/linux/mmu_notifier.h
        include/linux/sched/mm.h
        kernel/fork.c
        kernel/futex.c
        kernel/sched/core.c
        mm/khugepaged.c
        mm/ksm.c
        mm/mmu_context.c
        mm/mmu_notifier.c
        mm/oom_kill.c
        virt/kvm/kvm_main.c
      
        # mmdrop_async_fn():
        include/linux/sched/mm.h
      
        # mmdrop_async():
        include/linux/sched/mm.h
        kernel/fork.c
      
        # mmget_not_zero():
        fs/userfaultfd.c
        include/linux/sched/mm.h
        mm/oom_kill.c
      
        # mmput():
        arch/arc/include/asm/mmu_context.h
        arch/arc/kernel/troubleshoot.c
        arch/frv/mm/mmu-context.c
        arch/powerpc/platforms/cell/spufs/context.c
        arch/sparc/include/asm/mmu_context_32.h
        drivers/android/binder.c
        drivers/gpu/drm/etnaviv/etnaviv_gem.c
        drivers/gpu/drm/i915/i915_gem_userptr.c
        drivers/infiniband/core/umem.c
        drivers/infiniband/core/umem_odp.c
        drivers/infiniband/core/uverbs_main.c
        drivers/infiniband/hw/mlx4/main.c
        drivers/infiniband/hw/mlx5/main.c
        drivers/infiniband/hw/usnic/usnic_uiom.c
        drivers/iommu/amd_iommu_v2.c
        drivers/iommu/intel-svm.c
        drivers/lguest/lguest_user.c
        drivers/misc/cxl/fault.c
        drivers/misc/mic/scif/scif_rma.c
        drivers/oprofile/buffer_sync.c
        drivers/vfio/vfio_iommu_type1.c
        drivers/vhost/vhost.c
        drivers/xen/gntdev.c
        fs/exec.c
        fs/proc/array.c
        fs/proc/base.c
        fs/proc/task_mmu.c
        fs/proc/task_nommu.c
        fs/userfaultfd.c
        include/linux/sched/mm.h
        kernel/cpuset.c
        kernel/events/core.c
        kernel/events/uprobes.c
        kernel/exit.c
        kernel/fork.c
        kernel/ptrace.c
        kernel/sys.c
        kernel/trace/trace_output.c
        kernel/tsacct.c
        mm/memcontrol.c
        mm/memory.c
        mm/mempolicy.c
        mm/migrate.c
        mm/mmu_notifier.c
        mm/nommu.c
        mm/oom_kill.c
        mm/process_vm_access.c
        mm/rmap.c
        mm/swapfile.c
        mm/util.c
        virt/kvm/async_pf.c
      
        # mmput_async():
        include/linux/sched/mm.h
        kernel/fork.c
        mm/oom_kill.c
      
        # get_task_mm():
        arch/arc/kernel/troubleshoot.c
        arch/powerpc/platforms/cell/spufs/context.c
        drivers/android/binder.c
        drivers/gpu/drm/etnaviv/etnaviv_gem.c
        drivers/infiniband/core/umem.c
        drivers/infiniband/core/umem_odp.c
        drivers/infiniband/hw/mlx4/main.c
        drivers/infiniband/hw/mlx5/main.c
        drivers/infiniband/hw/usnic/usnic_uiom.c
        drivers/iommu/amd_iommu_v2.c
        drivers/iommu/intel-svm.c
        drivers/lguest/lguest_user.c
        drivers/misc/cxl/fault.c
        drivers/misc/mic/scif/scif_rma.c
        drivers/oprofile/buffer_sync.c
        drivers/vfio/vfio_iommu_type1.c
        drivers/vhost/vhost.c
        drivers/xen/gntdev.c
        fs/proc/array.c
        fs/proc/base.c
        fs/proc/task_mmu.c
        include/linux/sched/mm.h
        kernel/cpuset.c
        kernel/events/core.c
        kernel/exit.c
        kernel/fork.c
        kernel/ptrace.c
        kernel/sys.c
        kernel/trace/trace_output.c
        kernel/tsacct.c
        mm/memcontrol.c
        mm/memory.c
        mm/mempolicy.c
        mm/migrate.c
        mm/mmu_notifier.c
        mm/nommu.c
        mm/util.c
      
        # mm_access():
        fs/proc/base.c
        include/linux/sched/mm.h
        kernel/fork.c
        mm/process_vm_access.c
      
        # mm_release():
        arch/arc/include/asm/mmu_context.h
        fs/exec.c
        include/linux/sched/mm.h
        include/uapi/linux/sched.h
        kernel/exit.c
        kernel/fork.c
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      68e21be2
  2. 02 3月, 2017 22 次提交