kern_kthread.c (4b49587c3dd54aed8eb103d838a89ca79484a9b6) kern_kthread.c (e5818a53dbd212809059bb306775a4b7e0e30c5f)
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 1999 Peter Wemm <peter@FreeBSD.org>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 117 unchanged lines hidden (view full) ---

126 sched_clear_tdname(td);
127#endif
128 TSTHREAD(td, td->td_name);
129
130 /* call the processes' main()... */
131 cpu_fork_kthread_handler(td, func, arg);
132
133 /* Avoid inheriting affinity from a random parent. */
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 1999 Peter Wemm <peter@FreeBSD.org>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 117 unchanged lines hidden (view full) ---

126 sched_clear_tdname(td);
127#endif
128 TSTHREAD(td, td->td_name);
129
130 /* call the processes' main()... */
131 cpu_fork_kthread_handler(td, func, arg);
132
133 /* Avoid inheriting affinity from a random parent. */
134 cpuset_setthread(td->td_tid, cpuset_root);
134 cpuset_kernthread(td);
135 thread_lock(td);
136 TD_SET_CAN_RUN(td);
137 sched_prio(td, PVM);
138 sched_user_prio(td, PUSER);
139
140 /* Delay putting it on the run queue until now. */
141 if (!(flags & RFSTOPPED))
142 sched_add(td, SRQ_BORING);

--- 161 unchanged lines hidden (view full) ---

304 sched_fork_thread(oldtd, newtd);
305 TD_SET_CAN_RUN(newtd);
306 thread_unlock(oldtd);
307 PROC_UNLOCK(p);
308
309 tidhash_add(newtd);
310
311 /* Avoid inheriting affinity from a random parent. */
135 thread_lock(td);
136 TD_SET_CAN_RUN(td);
137 sched_prio(td, PVM);
138 sched_user_prio(td, PUSER);
139
140 /* Delay putting it on the run queue until now. */
141 if (!(flags & RFSTOPPED))
142 sched_add(td, SRQ_BORING);

--- 161 unchanged lines hidden (view full) ---

304 sched_fork_thread(oldtd, newtd);
305 TD_SET_CAN_RUN(newtd);
306 thread_unlock(oldtd);
307 PROC_UNLOCK(p);
308
309 tidhash_add(newtd);
310
311 /* Avoid inheriting affinity from a random parent. */
312 cpuset_setthread(newtd->td_tid, cpuset_root);
312 cpuset_kernthread(newtd);
313
314 /* Delay putting it on the run queue until now. */
315 if (!(flags & RFSTOPPED)) {
316 thread_lock(newtd);
317 sched_add(newtd, SRQ_BORING);
318 thread_unlock(newtd);
319 }
320 if (newtdp)

--- 156 unchanged lines hidden ---
313
314 /* Delay putting it on the run queue until now. */
315 if (!(flags & RFSTOPPED)) {
316 thread_lock(newtd);
317 sched_add(newtd, SRQ_BORING);
318 thread_unlock(newtd);
319 }
320 if (newtdp)

--- 156 unchanged lines hidden ---