fork.c (13685c4a08fca9dd76bf53bfcbadc044ab2a08cb) | fork.c (b75058614fdd3140074a640b514f6a0b4d485a2d) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * linux/kernel/fork.c 4 * 5 * Copyright (C) 1991, 1992 Linus Torvalds 6 */ 7 8/* --- 1940 unchanged lines hidden (view full) --- 1949 * Clear TID on mm_release()? 1950 */ 1951 p->clear_child_tid = (clone_flags & CLONE_CHILD_CLEARTID) ? args->child_tid : NULL; 1952 1953 ftrace_graph_init_task(p); 1954 1955 rt_mutex_init_task(p); 1956 | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * linux/kernel/fork.c 4 * 5 * Copyright (C) 1991, 1992 Linus Torvalds 6 */ 7 8/* --- 1940 unchanged lines hidden (view full) --- 1949 * Clear TID on mm_release()? 1950 */ 1951 p->clear_child_tid = (clone_flags & CLONE_CHILD_CLEARTID) ? args->child_tid : NULL; 1952 1953 ftrace_graph_init_task(p); 1954 1955 rt_mutex_init_task(p); 1956 |
1957 lockdep_assert_irqs_enabled(); |
|
1957#ifdef CONFIG_PROVE_LOCKING | 1958#ifdef CONFIG_PROVE_LOCKING |
1958 DEBUG_LOCKS_WARN_ON(!p->hardirqs_enabled); | |
1959 DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled); 1960#endif 1961 retval = -EAGAIN; 1962 if (atomic_read(&p->real_cred->user->processes) >= 1963 task_rlimit(p, RLIMIT_NPROC)) { 1964 if (p->real_cred->user != INIT_USER && 1965 !capable(CAP_SYS_RESOURCE) && !capable(CAP_SYS_ADMIN)) 1966 goto bad_fork_free; --- 60 unchanged lines hidden (view full) --- 2027 retval = PTR_ERR(p->mempolicy); 2028 p->mempolicy = NULL; 2029 goto bad_fork_cleanup_threadgroup_lock; 2030 } 2031#endif 2032#ifdef CONFIG_CPUSETS 2033 p->cpuset_mem_spread_rotor = NUMA_NO_NODE; 2034 p->cpuset_slab_spread_rotor = NUMA_NO_NODE; | 1959 DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled); 1960#endif 1961 retval = -EAGAIN; 1962 if (atomic_read(&p->real_cred->user->processes) >= 1963 task_rlimit(p, RLIMIT_NPROC)) { 1964 if (p->real_cred->user != INIT_USER && 1965 !capable(CAP_SYS_RESOURCE) && !capable(CAP_SYS_ADMIN)) 1966 goto bad_fork_free; --- 60 unchanged lines hidden (view full) --- 2027 retval = PTR_ERR(p->mempolicy); 2028 p->mempolicy = NULL; 2029 goto bad_fork_cleanup_threadgroup_lock; 2030 } 2031#endif 2032#ifdef CONFIG_CPUSETS 2033 p->cpuset_mem_spread_rotor = NUMA_NO_NODE; 2034 p->cpuset_slab_spread_rotor = NUMA_NO_NODE; |
2035 seqcount_init(&p->mems_allowed_seq); | 2035 seqcount_spinlock_init(&p->mems_allowed_seq, &p->alloc_lock); |
2036#endif 2037#ifdef CONFIG_TRACE_IRQFLAGS 2038 p->irq_events = 0; | 2036#endif 2037#ifdef CONFIG_TRACE_IRQFLAGS 2038 p->irq_events = 0; |
2039 p->hardirqs_enabled = 0; | |
2040 p->hardirq_enable_ip = 0; 2041 p->hardirq_enable_event = 0; 2042 p->hardirq_disable_ip = _THIS_IP_; 2043 p->hardirq_disable_event = 0; 2044 p->softirqs_enabled = 1; 2045 p->softirq_enable_ip = _THIS_IP_; 2046 p->softirq_enable_event = 0; 2047 p->softirq_disable_ip = 0; 2048 p->softirq_disable_event = 0; | 2039 p->hardirq_enable_ip = 0; 2040 p->hardirq_enable_event = 0; 2041 p->hardirq_disable_ip = _THIS_IP_; 2042 p->hardirq_disable_event = 0; 2043 p->softirqs_enabled = 1; 2044 p->softirq_enable_ip = _THIS_IP_; 2045 p->softirq_enable_event = 0; 2046 p->softirq_disable_ip = 0; 2047 p->softirq_disable_event = 0; |
2049 p->hardirq_context = 0; | |
2050 p->softirq_context = 0; 2051#endif 2052 2053 p->pagefault_disabled = 0; 2054 2055#ifdef CONFIG_LOCKDEP 2056 lockdep_init_task(p); 2057#endif --- 241 unchanged lines hidden (view full) --- 2299 } 2300 total_forks++; 2301 hlist_del_init(&delayed.node); 2302 spin_unlock(¤t->sighand->siglock); 2303 syscall_tracepoint_update(p); 2304 write_unlock_irq(&tasklist_lock); 2305 2306 proc_fork_connector(p); | 2048 p->softirq_context = 0; 2049#endif 2050 2051 p->pagefault_disabled = 0; 2052 2053#ifdef CONFIG_LOCKDEP 2054 lockdep_init_task(p); 2055#endif --- 241 unchanged lines hidden (view full) --- 2297 } 2298 total_forks++; 2299 hlist_del_init(&delayed.node); 2300 spin_unlock(¤t->sighand->siglock); 2301 syscall_tracepoint_update(p); 2302 write_unlock_irq(&tasklist_lock); 2303 2304 proc_fork_connector(p); |
2307 sched_post_fork(p); | |
2308 cgroup_post_fork(p, args); 2309 perf_event_fork(p); 2310 2311 trace_task_newtask(p, clone_flags); 2312 uprobe_copy_process(p, clone_flags); 2313 2314 return p; 2315 --- 785 unchanged lines hidden --- | 2305 cgroup_post_fork(p, args); 2306 perf_event_fork(p); 2307 2308 trace_task_newtask(p, clone_flags); 2309 uprobe_copy_process(p, clone_flags); 2310 2311 return p; 2312 --- 785 unchanged lines hidden --- |