Unix Technical Forum

use a lock for uvm_fpageq 1/4

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 ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > mailing.openbsd.tech

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-18-2008, 09:34 AM
Ted Unangst
 
Posts: n/a
Default use a lock for uvm_fpageq 1/4

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);
}

/*

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:07 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com