vm_machdep.c (71785) | vm_machdep.c (72200) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986 The Regents of the University of California. 3 * Copyright (c) 1989, 1990 William Jolitz 4 * Copyright (c) 1994 John Dyson 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * the Systems Programming Group of the University of Utah Computer --- 24 unchanged lines hidden (view full) --- 33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 40 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ | 1/*- 2 * Copyright (c) 1982, 1986 The Regents of the University of California. 3 * Copyright (c) 1989, 1990 William Jolitz 4 * Copyright (c) 1994 John Dyson 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * the Systems Programming Group of the University of Utah Computer --- 24 unchanged lines hidden (view full) --- 33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 40 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ |
41 * $FreeBSD: head/sys/amd64/amd64/vm_machdep.c 71785 2001-01-29 09:38:39Z peter $ | 41 * $FreeBSD: head/sys/amd64/amd64/vm_machdep.c 72200 2001-02-09 06:11:45Z bmilekic $ |
42 */ 43 44#include "opt_npx.h" 45#include "opt_user_ldt.h" 46#ifdef PC98 47#include "opt_pc98.h" 48#endif 49#include "opt_reset.h" --- 206 unchanged lines hidden (view full) --- 256#endif 257 if (pcb->pcb_flags & PCB_DBREGS) { 258 /* 259 * disable all hardware breakpoints 260 */ 261 reset_dbregs(); 262 pcb->pcb_flags &= ~PCB_DBREGS; 263 } | 42 */ 43 44#include "opt_npx.h" 45#include "opt_user_ldt.h" 46#ifdef PC98 47#include "opt_pc98.h" 48#endif 49#include "opt_reset.h" --- 206 unchanged lines hidden (view full) --- 256#endif 257 if (pcb->pcb_flags & PCB_DBREGS) { 258 /* 259 * disable all hardware breakpoints 260 */ 261 reset_dbregs(); 262 pcb->pcb_flags &= ~PCB_DBREGS; 263 } |
264 mtx_enter(&sched_lock, MTX_SPIN); 265 mtx_exit(&Giant, MTX_DEF | MTX_NOSWITCH); | 264 mtx_lock_spin(&sched_lock); 265 mtx_unlock_flags(&Giant, MTX_NOSWITCH); |
266 mtx_assert(&Giant, MA_NOTOWNED); 267 268 /* 269 * We have to wait until after releasing all locks before 270 * changing p_stat. If we block on a mutex then we will be 271 * back at SRUN when we resume and our parent will never 272 * harvest us. 273 */ --- 295 unchanged lines hidden (view full) --- 569 * pages because doing so may flush our L1 and L2 caches too much. 570 */ 571 572 if (zero_state && vm_page_zero_count >= ZIDLE_LO(cnt.v_free_count)) 573 return(0); 574 if (vm_page_zero_count >= ZIDLE_HI(cnt.v_free_count)) 575 return(0); 576 | 266 mtx_assert(&Giant, MA_NOTOWNED); 267 268 /* 269 * We have to wait until after releasing all locks before 270 * changing p_stat. If we block on a mutex then we will be 271 * back at SRUN when we resume and our parent will never 272 * harvest us. 273 */ --- 295 unchanged lines hidden (view full) --- 569 * pages because doing so may flush our L1 and L2 caches too much. 570 */ 571 572 if (zero_state && vm_page_zero_count >= ZIDLE_LO(cnt.v_free_count)) 573 return(0); 574 if (vm_page_zero_count >= ZIDLE_HI(cnt.v_free_count)) 575 return(0); 576 |
577 if (mtx_try_enter(&Giant, MTX_DEF)) { | 577 if (mtx_trylock(&Giant)) { |
578 s = splvm(); 579 zero_state = 0; 580 m = vm_page_list_find(PQ_FREE, free_rover, FALSE); 581 if (m != NULL && (m->flags & PG_ZERO) == 0) { 582 vm_page_queues[m->queue].lcnt--; 583 TAILQ_REMOVE(&vm_page_queues[m->queue].pl, m, pageq); 584 m->queue = PQ_NONE; 585 splx(s); --- 6 unchanged lines hidden (view full) --- 592 pageq); 593 ++vm_page_zero_count; 594 ++cnt_prezero; 595 if (vm_page_zero_count >= ZIDLE_HI(cnt.v_free_count)) 596 zero_state = 1; 597 } 598 free_rover = (free_rover + PQ_PRIME2) & PQ_L2_MASK; 599 splx(s); | 578 s = splvm(); 579 zero_state = 0; 580 m = vm_page_list_find(PQ_FREE, free_rover, FALSE); 581 if (m != NULL && (m->flags & PG_ZERO) == 0) { 582 vm_page_queues[m->queue].lcnt--; 583 TAILQ_REMOVE(&vm_page_queues[m->queue].pl, m, pageq); 584 m->queue = PQ_NONE; 585 splx(s); --- 6 unchanged lines hidden (view full) --- 592 pageq); 593 ++vm_page_zero_count; 594 ++cnt_prezero; 595 if (vm_page_zero_count >= ZIDLE_HI(cnt.v_free_count)) 596 zero_state = 1; 597 } 598 free_rover = (free_rover + PQ_PRIME2) & PQ_L2_MASK; 599 splx(s); |
600 mtx_exit(&Giant, MTX_DEF); | 600 mtx_unlock(&Giant); |
601 return (1); 602 } 603 return (0); 604} 605 606/* 607 * Software interrupt handler for queued VM system processing. 608 */ --- 32 unchanged lines hidden --- | 601 return (1); 602 } 603 return (0); 604} 605 606/* 607 * Software interrupt handler for queued VM system processing. 608 */ --- 32 unchanged lines hidden --- |