diff options
author | alc <alc@FreeBSD.org> | 2002-12-14 07:06:27 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2002-12-14 07:06:27 +0000 |
commit | 766e48456088359c365ab659a0a92186ab8e4801 (patch) | |
tree | 3cd77d2553470fdc1627d11a6337c9884fdaefbc /sys/amd64 | |
parent | a0e044d15dd0305bf8cd296974c9b5e4710a54db (diff) | |
download | FreeBSD-src-766e48456088359c365ab659a0a92186ab8e4801.zip FreeBSD-src-766e48456088359c365ab659a0a92186ab8e4801.tar.gz |
Add page locking to pmap_mincore().
Submitted (in part) by: tjr@
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/pmap.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 8ee5886..2218d58 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -3323,23 +3323,31 @@ pmap_mincore(pmap, addr) */ if (pte & PG_M) val |= MINCORE_MODIFIED|MINCORE_MODIFIED_OTHER; - /* - * Modified by someone - */ - else if (m->dirty || pmap_is_modified(m)) - val |= MINCORE_MODIFIED_OTHER; + else { + /* + * Modified by someone else + */ + vm_page_lock_queues(); + if (m->dirty || pmap_is_modified(m)) + val |= MINCORE_MODIFIED_OTHER; + vm_page_unlock_queues(); + } /* * Referenced by us */ if (pte & PG_A) val |= MINCORE_REFERENCED|MINCORE_REFERENCED_OTHER; - - /* - * Referenced by someone - */ - else if ((m->flags & PG_REFERENCED) || pmap_ts_referenced(m)) { - val |= MINCORE_REFERENCED_OTHER; - vm_page_flag_set(m, PG_REFERENCED); + else { + /* + * Referenced by someone else + */ + vm_page_lock_queues(); + if ((m->flags & PG_REFERENCED) || + pmap_ts_referenced(m)) { + val |= MINCORE_REFERENCED_OTHER; + vm_page_flag_set(m, PG_REFERENCED); + } + vm_page_unlock_queues(); } } return val; |