/* * linux/kernel/fork.c * * Copyright (C) 1991, 1992 Linus Torvalds *//* * 'fork.c' contains the help-routines for the 'fork' system call * (see also entry.S and others). * Fork is rather simple, once you get the hang of it, but the memory * management can be a bitch. See 'mm/memory.c': 'copy_page_range()' */#include <linux/config.h>#include <linux/slab.h>#include <linux/init.h>#include <linux/unistd.h>#include <linux/smp_lock.h>#include <linux/module.h>#include <linux/vmalloc.h>#include <linux/completion.h>#include <linux/namespace.h>#include <linux/personality.h>#include <linux/mempolicy.h>#include <linux/sem.h>#include <linux/file.h>#include <linux/key.h>#include <linux/binfmts.h>#include <linux/mman.h>#include <linux/fs.h>#include <linux/capability.h>#include <linux/cpu.h>#include <linux/cpuset.h>#include <linux/security.h>#include <linux/swap.h>#include <linux/syscalls.h>#include <linux/jiffies.h>#include <linux/futex.h>#include <linux/rcupdate.h>#include <linux/ptrace.h>#include <linux/mount.h>#include <linux/audit.h>#include <linux/profile.h>#include <linux/rmap.h>#include <linux/acct.h>#include <linux/cn_proc.h>#include <asm/pgtable.h>#include <asm/pgalloc.h>#include <asm/uaccess.h>#include <asm/mmu_context.h>#include <asm/cacheflush.h>#include <asm/tlbflush.h>/* * Protected counters by write_lock_irq(&tasklist_lock) */unsigned long total_forks;/* Handle normal Linux uptimes. */int nr_threads;/* The idle threads do not count.. */int max_threads;/* tunable limit on nr_threads */DEFINE_PER_CPU(unsigned long