Date: Sat, 1 Dec 2007 22:50:09 GMT From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 129911 for review Message-ID: <200712012250.lB1Mo91B086561@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=129911 Change 129911 by peter@peter_daintree on 2007/12/01 22:49:37 Initial compile fixes Affected files ... .. //depot/projects/bike_sched/sys/kern/kern_kthread.c#3 edit .. //depot/projects/bike_sched/sys/kern/kern_switch.c#5 edit .. //depot/projects/bike_sched/sys/kern/kern_thr.c#5 edit .. //depot/projects/bike_sched/sys/kern/sched_4bsd.c#9 edit .. //depot/projects/bike_sched/sys/kern/sched_ule.c#7 edit .. //depot/projects/bike_sched/sys/vm/vm_glue.c#4 edit Differences ... ==== //depot/projects/bike_sched/sys/kern/kern_kthread.c#3 (text+ko) ==== @@ -296,7 +296,7 @@ thread_link(newtd, p); thread_lock(oldtd); /* let the scheduler know about these things. */ - sched_fork_thread(oldtd, newtd); + sched_fork(oldtd, newtd); TD_SET_CAN_RUN(newtd); thread_unlock(oldtd); PROC_SUNLOCK(p); ==== //depot/projects/bike_sched/sys/kern/kern_switch.c#5 (text+ko) ==== @@ -585,7 +585,7 @@ * thread is being either created or recycled. * Fix up the per-scheduler resources associated with it. * Called from: - * sched_fork_thread() + * sched_fork() * thread_dtor() (*may go away) * thread_init() (*may go away) */ ==== //depot/projects/bike_sched/sys/kern/kern_thr.c#5 (text+ko) ==== @@ -170,7 +170,7 @@ default: return (EINVAL); } - + } /* Initialize our td */ newtd = thread_alloc(); if (newtd == NULL) ==== //depot/projects/bike_sched/sys/kern/sched_4bsd.c#9 (text+ko) ==== @@ -638,12 +638,6 @@ void sched_fork(struct thread *td, struct thread *childtd) { - sched_fork_thread(td, childtd); -} - -void -sched_fork_thread(struct thread *td, struct thread *childtd) -{ childtd->td_estcpu = td->td_estcpu; childtd->td_lock = &sched_lock; sched_newthread(childtd); ==== //depot/projects/bike_sched/sys/kern/sched_ule.c#7 (text+ko) ==== @@ -1996,24 +1996,6 @@ void sched_fork(struct thread *td, struct thread *child) { - THREAD_LOCK_ASSERT(td, MA_OWNED); - sched_fork_thread(td, child); - /* - * Penalize the parent and child for forking. - */ - sched_interact_fork(child); - sched_priority(child); - td->td_sched->ts_runtime += tickincr; - sched_interact_update(td); - sched_priority(td); -} - -/* - * Fork a new thread, may be within the same process. - */ -void -sched_fork_thread(struct thread *td, struct thread *child) -{ struct td_sched *ts; struct td_sched *ts2; @@ -2041,6 +2023,14 @@ ts2->ts_slptime = ts->ts_slptime; ts2->ts_runtime = ts->ts_runtime; ts2->ts_slice = 1; /* Attempt to quickly learn interactivity. */ + /* + * Penalize the parent and child for forking. + */ + sched_interact_fork(child); + sched_priority(child); + td->td_sched->ts_runtime += tickincr; + sched_interact_update(td); + sched_priority(td); } /* ==== //depot/projects/bike_sched/sys/vm/vm_glue.c#4 (text+ko) ==== @@ -921,6 +921,7 @@ !thread_safetoswapout(td)) { thread_unlock(td); goto nextproc; + } /* * If the system is under memory stress, * or if we are swapping
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712012250.lB1Mo91B086561>