* Clear the given bits from the specified page's dirty field. */
| 5087 | * Clear the given bits from the specified page's dirty field. |
| 5088 | */ |
| 5089 | static __inline void |
| 5090 | vm_page_clear_dirty_mask(vm_page_t m, vm_page_bits_t pagebits) |
| 5091 | { |
| 5092 | |
| 5093 | vm_page_assert_busied(m); |
| 5094 | |
| 5095 | /* |
| 5096 | * If the page is xbusied and not write mapped we are the |
| 5097 | * only thread that can modify dirty bits. Otherwise, The pmap |
| 5098 | * layer can call vm_page_dirty() without holding a distinguished |
| 5099 | * lock. The combination of page busy and atomic operations |
| 5100 | * suffice to guarantee consistency of the page dirty field. |
| 5101 | */ |
| 5102 | if (vm_page_xbusied(m) && !pmap_page_is_write_mapped(m)) |
| 5103 | m->dirty &= ~pagebits; |
| 5104 | else |
| 5105 | vm_page_bits_clear(m, &m->dirty, pagebits); |
| 5106 | } |
| 5107 | |
| 5108 | /* |
| 5109 | * vm_page_set_validclean: |
no test coverage detected