sched_ule.c (148856) | sched_ule.c (149278) |
---|---|
1/*- 2 * Copyright (c) 2002-2005, Jeffrey Roberson <jeff@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002-2005, Jeffrey Roberson <jeff@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/kern/sched_ule.c 148856 2005-08-08 14:20:10Z davidxu $"); | 28__FBSDID("$FreeBSD: head/sys/kern/sched_ule.c 149278 2005-08-19 11:51:41Z davidxu $"); |
29 30#include "opt_hwpmc_hooks.h" 31#include "opt_sched.h" 32 33#define kse td_sched 34 35#include <sys/param.h> 36#include <sys/systm.h> --- 1736 unchanged lines hidden (view full) --- 1773 ke->ke_flags &= ~KEF_INTERNAL; 1774#ifdef SMP 1775 if (ke->ke_flags & KEF_ASSIGNED) { 1776 if (ke->ke_flags & KEF_REMOVED) 1777 ke->ke_flags &= ~KEF_REMOVED; 1778 return; 1779 } 1780 canmigrate = KSE_CAN_MIGRATE(ke); | 29 30#include "opt_hwpmc_hooks.h" 31#include "opt_sched.h" 32 33#define kse td_sched 34 35#include <sys/param.h> 36#include <sys/systm.h> --- 1736 unchanged lines hidden (view full) --- 1773 ke->ke_flags &= ~KEF_INTERNAL; 1774#ifdef SMP 1775 if (ke->ke_flags & KEF_ASSIGNED) { 1776 if (ke->ke_flags & KEF_REMOVED) 1777 ke->ke_flags &= ~KEF_REMOVED; 1778 return; 1779 } 1780 canmigrate = KSE_CAN_MIGRATE(ke); |
1781 /* 1782 * Don't migrate running threads here. Force the long term balancer 1783 * to do it. 1784 */ 1785 if (ke->ke_flags & KEF_HOLD) { 1786 ke->ke_flags &= ~KEF_HOLD; 1787 canmigrate = 0; 1788 } |
|
1781#endif 1782 KASSERT(ke->ke_state != KES_ONRUNQ, 1783 ("sched_add: kse %p (%s) already in run queue", ke, 1784 ke->ke_proc->p_comm)); 1785 KASSERT(ke->ke_proc->p_sflag & PS_INMEM, 1786 ("sched_add: process swapped out")); 1787 KASSERT(ke->ke_runq == NULL, 1788 ("sched_add: KSE %p is still assigned to a run queue", ke)); --- 24 unchanged lines hidden (view full) --- 1813 ke->ke_slice = SCHED_SLICE_MIN; 1814 break; 1815 default: 1816 panic("Unknown pri class."); 1817 break; 1818 } 1819#ifdef SMP 1820 /* | 1789#endif 1790 KASSERT(ke->ke_state != KES_ONRUNQ, 1791 ("sched_add: kse %p (%s) already in run queue", ke, 1792 ke->ke_proc->p_comm)); 1793 KASSERT(ke->ke_proc->p_sflag & PS_INMEM, 1794 ("sched_add: process swapped out")); 1795 KASSERT(ke->ke_runq == NULL, 1796 ("sched_add: KSE %p is still assigned to a run queue", ke)); --- 24 unchanged lines hidden (view full) --- 1821 ke->ke_slice = SCHED_SLICE_MIN; 1822 break; 1823 default: 1824 panic("Unknown pri class."); 1825 break; 1826 } 1827#ifdef SMP 1828 /* |
1821 * Don't migrate running threads here. Force the long term balancer 1822 * to do it. 1823 */ 1824 if (ke->ke_flags & KEF_HOLD) { 1825 ke->ke_flags &= ~KEF_HOLD; 1826 canmigrate = 0; 1827 } 1828 /* | |
1829 * If this thread is pinned or bound, notify the target cpu. 1830 */ 1831 if (!canmigrate && ke->ke_cpu != PCPU_GET(cpuid) ) { 1832 ke->ke_runq = NULL; 1833 kseq_notify(ke, ke->ke_cpu); 1834 return; 1835 } 1836 /* --- 161 unchanged lines hidden --- | 1829 * If this thread is pinned or bound, notify the target cpu. 1830 */ 1831 if (!canmigrate && ke->ke_cpu != PCPU_GET(cpuid) ) { 1832 ke->ke_runq = NULL; 1833 kseq_notify(ke, ke->ke_cpu); 1834 return; 1835 } 1836 /* --- 161 unchanged lines hidden --- |