| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: uvm_pdpolicy_clock.c,v 1.29 2020/01/01 01:18:34 mlelstv Exp $ */ | | 1 | /* $NetBSD: uvm_pdpolicy_clock.c,v 1.30 2020/01/01 14:33:48 ad Exp $ */ |
2 | /* NetBSD: uvm_pdaemon.c,v 1.72 2006/01/05 10:47:33 yamt Exp $ */ | | 2 | /* NetBSD: uvm_pdaemon.c,v 1.72 2006/01/05 10:47:33 yamt Exp $ */ |
3 | | | 3 | |
4 | /*- | | 4 | /*- |
5 | * Copyright (c) 2019 The NetBSD Foundation, Inc. | | 5 | * Copyright (c) 2019 The NetBSD Foundation, Inc. |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * This code is derived from software contributed to The NetBSD Foundation | | 8 | * This code is derived from software contributed to The NetBSD Foundation |
9 | * by Andrew Doran. | | 9 | * by Andrew Doran. |
10 | * | | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | | 11 | * Redistribution and use in source and binary forms, with or without |
12 | * modification, are permitted provided that the following conditions | | 12 | * modification, are permitted provided that the following conditions |
13 | * are met: | | 13 | * are met: |
14 | * 1. Redistributions of source code must retain the above copyright | | 14 | * 1. Redistributions of source code must retain the above copyright |
| @@ -88,27 +88,27 @@ | | | @@ -88,27 +88,27 @@ |
88 | * Pittsburgh PA 15213-3890 | | 88 | * Pittsburgh PA 15213-3890 |
89 | * | | 89 | * |
90 | * any improvements or extensions that they make and grant Carnegie the | | 90 | * any improvements or extensions that they make and grant Carnegie the |
91 | * rights to redistribute these changes. | | 91 | * rights to redistribute these changes. |
92 | */ | | 92 | */ |
93 | | | 93 | |
94 | #if defined(PDSIM) | | 94 | #if defined(PDSIM) |
95 | | | 95 | |
96 | #include "pdsim.h" | | 96 | #include "pdsim.h" |
97 | | | 97 | |
98 | #else /* defined(PDSIM) */ | | 98 | #else /* defined(PDSIM) */ |
99 | | | 99 | |
100 | #include <sys/cdefs.h> | | 100 | #include <sys/cdefs.h> |
101 | __KERNEL_RCSID(0, "$NetBSD: uvm_pdpolicy_clock.c,v 1.29 2020/01/01 01:18:34 mlelstv Exp $"); | | 101 | __KERNEL_RCSID(0, "$NetBSD: uvm_pdpolicy_clock.c,v 1.30 2020/01/01 14:33:48 ad Exp $"); |
102 | | | 102 | |
103 | #include <sys/param.h> | | 103 | #include <sys/param.h> |
104 | #include <sys/proc.h> | | 104 | #include <sys/proc.h> |
105 | #include <sys/systm.h> | | 105 | #include <sys/systm.h> |
106 | #include <sys/kernel.h> | | 106 | #include <sys/kernel.h> |
107 | #include <sys/kmem.h> | | 107 | #include <sys/kmem.h> |
108 | #include <sys/atomic.h> | | 108 | #include <sys/atomic.h> |
109 | | | 109 | |
110 | #include <uvm/uvm.h> | | 110 | #include <uvm/uvm.h> |
111 | #include <uvm/uvm_pdpolicy.h> | | 111 | #include <uvm/uvm_pdpolicy.h> |
112 | #include <uvm/uvm_pdpolicy_impl.h> | | 112 | #include <uvm/uvm_pdpolicy_impl.h> |
113 | #include <uvm/uvm_stat.h> | | 113 | #include <uvm/uvm_stat.h> |
114 | | | 114 | |
| @@ -657,28 +657,28 @@ uvmpdpol_needsscan_p(void) | | | @@ -657,28 +657,28 @@ uvmpdpol_needsscan_p(void) |
657 | } | | 657 | } |
658 | | | 658 | |
659 | void | | 659 | void |
660 | uvmpdpol_tune(void) | | 660 | uvmpdpol_tune(void) |
661 | { | | 661 | { |
662 | struct uvmpdpol_globalstate *s = &pdpol_state; | | 662 | struct uvmpdpol_globalstate *s = &pdpol_state; |
663 | | | 663 | |
664 | mutex_enter(&s->lock); | | 664 | mutex_enter(&s->lock); |
665 | clock_tune(); | | 665 | clock_tune(); |
666 | mutex_exit(&s->lock); | | 666 | mutex_exit(&s->lock); |
667 | } | | 667 | } |
668 | | | 668 | |
669 | /* | | 669 | /* |
670 | * uvmpdpol_pagerealize_locked: take the intended state set on an indivdual | | 670 | * uvmpdpol_pagerealize_locked: take the intended state set on a page and |
671 | * page and make it real. return true if any work was done. | | 671 | * make it real. return true if any work was done. |
672 | */ | | 672 | */ |
673 | static bool | | 673 | static bool |
674 | uvmpdpol_pagerealize_locked(struct vm_page *pg) | | 674 | uvmpdpol_pagerealize_locked(struct vm_page *pg) |
675 | { | | 675 | { |
676 | struct uvmpdpol_globalstate *s __diagused = &pdpol_state; | | 676 | struct uvmpdpol_globalstate *s __diagused = &pdpol_state; |
677 | | | 677 | |
678 | KASSERT(mutex_owned(&s->lock)); | | 678 | KASSERT(mutex_owned(&s->lock)); |
679 | KASSERT(mutex_owned(&pg->interlock)); | | 679 | KASSERT(mutex_owned(&pg->interlock)); |
680 | | | 680 | |
681 | switch (pg->pqflags & (PQ_INTENT_MASK | PQ_INTENT_SET)) { | | 681 | switch (pg->pqflags & (PQ_INTENT_MASK | PQ_INTENT_SET)) { |
682 | case PQ_INTENT_A | PQ_INTENT_SET: | | 682 | case PQ_INTENT_A | PQ_INTENT_SET: |
683 | case PQ_INTENT_E | PQ_INTENT_SET: | | 683 | case PQ_INTENT_E | PQ_INTENT_SET: |
684 | uvmpdpol_pageactivate_locked(pg); | | 684 | uvmpdpol_pageactivate_locked(pg); |