sched_4bsd.c (177004) | sched_4bsd.c (177085) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1990, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 19 unchanged lines hidden (view full) --- 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 */ 34 35#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1982, 1986, 1990, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 19 unchanged lines hidden (view full) --- 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 */ 34 35#include <sys/cdefs.h> |
36__FBSDID("$FreeBSD: head/sys/kern/sched_4bsd.c 177004 2008-03-10 01:30:35Z jeff $"); | 36__FBSDID("$FreeBSD: head/sys/kern/sched_4bsd.c 177085 2008-03-12 06:31:06Z jeff $"); |
37 38#include "opt_hwpmc_hooks.h" 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/cpuset.h> 43#include <sys/kernel.h> 44#include <sys/ktr.h> --- 749 unchanged lines hidden (view full) --- 794 td->td_flags &= ~TDF_UBORROWING; 795 sched_user_prio(td, base_pri); 796 } else { 797 sched_lend_user_prio(td, prio); 798 } 799} 800 801void | 37 38#include "opt_hwpmc_hooks.h" 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/cpuset.h> 43#include <sys/kernel.h> 44#include <sys/ktr.h> --- 749 unchanged lines hidden (view full) --- 794 td->td_flags &= ~TDF_UBORROWING; 795 sched_user_prio(td, base_pri); 796 } else { 797 sched_lend_user_prio(td, prio); 798 } 799} 800 801void |
802sched_sleep(struct thread *td) | 802sched_sleep(struct thread *td, int pri) |
803{ 804 805 THREAD_LOCK_ASSERT(td, MA_OWNED); 806 td->td_slptick = ticks; 807 td->td_sched->ts_slptime = 0; | 803{ 804 805 THREAD_LOCK_ASSERT(td, MA_OWNED); 806 td->td_slptick = ticks; 807 td->td_sched->ts_slptime = 0; |
808 if (pri) 809 sched_prio(td, pri); 810 if (TD_IS_SUSPENDED(td) || pri <= PSOCK) 811 td->td_flags |= TDF_CANSWAP; |
|
808} 809 810void 811sched_switch(struct thread *td, struct thread *newtd, int flags) 812{ 813 struct td_sched *ts; 814 struct proc *p; 815 --- 101 unchanged lines hidden (view full) --- 917 918void 919sched_wakeup(struct thread *td) 920{ 921 struct td_sched *ts; 922 923 THREAD_LOCK_ASSERT(td, MA_OWNED); 924 ts = td->td_sched; | 812} 813 814void 815sched_switch(struct thread *td, struct thread *newtd, int flags) 816{ 817 struct td_sched *ts; 818 struct proc *p; 819 --- 101 unchanged lines hidden (view full) --- 921 922void 923sched_wakeup(struct thread *td) 924{ 925 struct td_sched *ts; 926 927 THREAD_LOCK_ASSERT(td, MA_OWNED); 928 ts = td->td_sched; |
929 td->td_flags &= ~TDF_CANSWAP; |
|
925 if (ts->ts_slptime > 1) { 926 updatepri(td); 927 resetpriority(td); 928 } 929 td->td_slptick = ticks; 930 ts->ts_slptime = 0; 931 sched_add(td, SRQ_BORING); 932} --- 492 unchanged lines hidden --- | 930 if (ts->ts_slptime > 1) { 931 updatepri(td); 932 resetpriority(td); 933 } 934 td->td_slptick = ticks; 935 ts->ts_slptime = 0; 936 sched_add(td, SRQ_BORING); 937} --- 492 unchanged lines hidden --- |