This is a discussion on use a lock for uvm_fpageq 1/4 within the mailing.openbsd.tech forums, part of the OpenBSD category; --> allow the free page list to be shared by cpus. Index: uvm/uvm.h ================================================== ================= RCS file: /home/tedu/cvs/src/sys/uvm/uvm.h,v retrieving revision ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| allow the free page list to be shared by cpus. Index: uvm/uvm.h ================================================== ================= RCS file: /home/tedu/cvs/src/sys/uvm/uvm.h,v retrieving revision 1.21 diff -u -u -r1.21 uvm.h --- uvm/uvm.h 18 Jun 2007 21:51:15 -0000 1.21 +++ uvm/uvm.h 26 Nov 2007 17:54:08 -0000 @@ -81,7 +81,7 @@ struct pglist page_inactive_swp;/* pages inactive (reclaim or free) */ struct pglist page_inactive_obj;/* pages inactive (reclaim or free) */ simple_lock_data_t pageqlock; /* lock for active/inactive page q */ - simple_lock_data_t fpageqlock; /* lock for free page q */ + struct mutex fpageqlock; /* lock for free page q */ boolean_t page_init_done; /* TRUE if uvm_page_init() finished */ boolean_t page_idle_zero; /* TRUE if we should try to zero pages in the idle loop */ Index: uvm/uvm_page.c ================================================== ================= RCS file: /home/tedu/cvs/src/sys/uvm/uvm_page.c,v retrieving revision 1.61 diff -u -u -r1.61 uvm_page.c --- uvm/uvm_page.c 18 Jun 2007 21:51:15 -0000 1.61 +++ uvm/uvm_page.c 26 Nov 2007 17:55:10 -0000 @@ -241,7 +241,7 @@ TAILQ_INIT(&uvm.page_inactive_swp); TAILQ_INIT(&uvm.page_inactive_obj); simple_lock_init(&uvm.pageqlock); - simple_lock_init(&uvm.fpageqlock); + mtx_init(&uvm.fpageqlock, IPL_VM); /* * init the <obj,offset> => <page> hash table. for now Index: uvm/uvm_page_i.h ================================================== ================= RCS file: /home/tedu/cvs/src/sys/uvm/uvm_page_i.h,v retrieving revision 1.17 diff -u -u -r1.17 uvm_page_i.h --- uvm/uvm_page_i.h 13 Apr 2007 18:57:49 -0000 1.17 +++ uvm/uvm_page_i.h 26 Nov 2007 17:53:39 -0000 @@ -91,11 +91,8 @@ PAGE_INLINE int uvm_lock_fpageq(void) { - int s; - - s = splvm(); - simple_lock(&uvm.fpageqlock); - return (s); + mtx_enter(&uvm.fpageqlock); + return (0); } /* @@ -109,8 +106,7 @@ uvm_unlock_fpageq(int s) { - simple_unlock(&uvm.fpageqlock); - splx(s); + mtx_leave(&uvm.fpageqlock); } /* |