From owner-p4-projects@FreeBSD.ORG Fri Aug 4 22:32:52 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8A76D16A4E2; Fri, 4 Aug 2006 22:32:52 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 67EC316A4DA for ; Fri, 4 Aug 2006 22:32:52 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CED9043D45 for ; Fri, 4 Aug 2006 22:32:51 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k74MWpkx059842 for ; Fri, 4 Aug 2006 22:32:51 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k74MWp09059839 for perforce@freebsd.org; Fri, 4 Aug 2006 22:32:51 GMT (envelope-from jb@freebsd.org) Date: Fri, 4 Aug 2006 22:32:51 GMT Message-Id: <200608042232.k74MWp09059839@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 103206 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Aug 2006 22:32:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=103206 Change 103206 by jb@jb_freebsd2 on 2006/08/04 22:32:24 Merge KSE support back in, but only if the KSE kernel option is defined. Affected files ... .. //depot/projects/dtrace/src/sys/vm/vm_glue.c#4 edit Differences ... ==== //depot/projects/dtrace/src/sys/vm/vm_glue.c#4 (text+ko) ==== @@ -682,8 +682,12 @@ ppri = INT_MIN; sx_slock(&allproc_lock); FOREACH_PROC_IN_SYSTEM(p) { - if (p->p_sflag & (PS_INMEM | PS_SWAPPINGOUT | PS_SWAPPINGIN)) +#ifdef KSE + struct ksegrp *kg; +#endif + if (p->p_sflag & (PS_INMEM | PS_SWAPPINGOUT | PS_SWAPPINGIN)) { continue; + } mtx_lock_spin(&sched_lock); FOREACH_THREAD_IN_PROC(p, td) { /* @@ -692,13 +696,18 @@ * */ if (td->td_inhibitors == TDI_SWAPPED) { +#ifdef KSE + kg = td->td_ksegrp; + pri = p->p_swtime + kg->kg_slptime; +#else pri = p->p_swtime + td->td_slptime; +#endif if ((p->p_sflag & PS_SWAPINREQ) == 0) { pri -= p->p_nice * 8; } /* - * if this thread is higher priority + * if this ksegrp/thread is higher priority * and there is enough space, then select * this process instead of the previous * selection. @@ -807,6 +816,9 @@ { struct proc *p; struct thread *td; +#ifdef KSE + struct ksegrp *kg; +#endif int didswap = 0; retry: @@ -880,15 +892,24 @@ * do not swapout a realtime process * Check all the thread groups.. */ +#ifdef KSE + FOREACH_KSEGRP_IN_PROC(p, kg) { + if (PRI_IS_REALTIME(kg->kg_pri_class)) +#else FOREACH_THREAD_IN_PROC(p, td) { if (PRI_IS_REALTIME(td->td_pri_class)) +#endif goto nextproc; /* * Guarantee swap_idle_threshold1 * time in memory. */ +#ifdef KSE + if (kg->kg_slptime < swap_idle_threshold1) +#else if (td->td_slptime < swap_idle_threshold1) +#endif goto nextproc; /* @@ -900,8 +921,16 @@ * This could be refined to support * swapping out a thread. */ +#ifdef KSE + FOREACH_THREAD_IN_GROUP(kg, td) { + if ((td->td_priority) < PSOCK || + !thread_safetoswapout(td)) + goto nextproc; + } +#else if ((td->td_priority) < PSOCK || !thread_safetoswapout(td)) goto nextproc; +#endif /* * If the system is under memory stress, * or if we are swapping @@ -910,11 +939,20 @@ */ if (((action & VM_SWAP_NORMAL) == 0) && (((action & VM_SWAP_IDLE) == 0) || +#ifdef KSE + (kg->kg_slptime < swap_idle_threshold2))) +#else (td->td_slptime < swap_idle_threshold2))) +#endif goto nextproc; +#ifdef KSE + if (minslptime > kg->kg_slptime) + minslptime = kg->kg_slptime; +#else if (minslptime > td->td_slptime) minslptime = td->td_slptime; +#endif } /*