Re: VM Tuning

2010-04-20 Thread Sergio Lopez
El Tue, 20 Apr 2010 14:06:18 +0200
Samuel Thibault  escribió:

> Sergio Lopez, le Tue 20 Apr 2010 13:08:32 +0200, a écrit :
> > I think you're in the right direction, but we need a broader
> > approach. Separating external pages (from externally managed memory
> > objects) from anonymous pages in a different pair of
> > active/inactive queues could be a nice start. 
> 
> And in the vm_object_cached_list, probably?
> 

The "can_persist" property from an internal object should always be
FALSE, so they never get into vm_object_cached_list.






Re: VM Tuning

2010-04-20 Thread Samuel Thibault
Sergio Lopez, le Tue 20 Apr 2010 13:08:32 +0200, a écrit :
> I think you're in the right direction, but we need a broader approach.
> Separating external pages (from externally managed memory objects) from
> anonymous pages in a different pair of active/inactive queues could be
> a nice start. 

And in the vm_object_cached_list, probably?

Samuel




Re: VM Tuning

2010-04-20 Thread Sergio Lopez
El Sun, 18 Apr 2010 23:28:52 +0600
Волков Максим  escribió:

> I  noticed that the paging starts only when the number in the free
> queue of pages is less than vm_page_free_min and continues until it
> reaches free_target. Variable vm_page_free_target is set via macro
> VM_PAGE_FREE_TARGET.
> 
> #ifndef VM_PAGE_FREE_MIN
> #define VM_PAGE_FREE_MIN(free)  (10 + (free) / 100)
> #endif  /* VM_PAGE_FREE_MIN */
> 
> # Ifndef VM_PAGE_FREE_TARGET
> # define VM_PAGE_FREE_TARGET (free) (15 + (free) / 80)
> # endif / *
> 
> If we assume that the free 2 GB of memory, then vm_page_free_targe
> about 25 mb. In the linux kernel swapping start to work actively, when
> free memory is 20-25% of total RAM.
> 
> I think that macros VM_PAGE_FREE_TARGET VM_PAGE_FREE_MIN should be
> changed. This patch modifies these macros:
> 

Hi,

Increasing VM_PAGE_FREE_TARGET could be dangerous, as it will raise the
"want_pages" flag prematurely, and GNU Mach will start paging out
anonymous memory.

I think you're in the right direction, but we need a broader approach.
Separating external pages (from externally managed memory objects) from
anonymous pages in a different pair of active/inactive queues could be
a nice start. 

Inactive pages from external memory objects can be safely considered as
cache, so we could play some tricks with them (starting to page them
early, freeing clean pages first, detecting access patterns...).





VM Tuning

2010-04-18 Thread Волков Максим
I  noticed that the paging starts only when the number in the free
queue of pages is less than vm_page_free_min and continues until it
reaches free_target. Variable vm_page_free_target is set via macro
VM_PAGE_FREE_TARGET.

#ifndef VM_PAGE_FREE_MIN
#define VM_PAGE_FREE_MIN(free)  (10 + (free) / 100)
#endif  /* VM_PAGE_FREE_MIN */

# Ifndef VM_PAGE_FREE_TARGET
# define VM_PAGE_FREE_TARGET (free) (15 + (free) / 80)
# endif / *

If we assume that the free 2 GB of memory, then vm_page_free_targe
about 25 mb. In the linux kernel swapping start to work actively, when
free memory is 20-25% of total RAM.

I think that macros VM_PAGE_FREE_TARGET VM_PAGE_FREE_MIN should be
changed. This patch modifies these macros:

diff -u -r gnumach//vm/vm_pageout.c gnumach2//vm/vm_pageout.c
--- gnumach//vm/vm_pageout.c2010-04-18 23:00:18.862962394 +0600
+++ gnumach2//vm/vm_pageout.c   2010-04-18 23:02:16.270982611 +0600
@@ -97,7 +97,7 @@
  */

 #ifndefVM_PAGE_FREE_TARGET
-#defineVM_PAGE_FREE_TARGET(free)   (15 + (free) / 80)
+#defineVM_PAGE_FREE_TARGET(free)   (15 + (free) / 5)
 #endif /* VM_PAGE_FREE_TARGET */

 /*
@@ -106,7 +106,7 @@
  */

 #ifndefVM_PAGE_FREE_MIN
-#defineVM_PAGE_FREE_MIN(free)  (10 + (free) / 100)
+#defineVM_PAGE_FREE_MIN(free)  (10 + (free) / 6)
 #endif /* VM_PAGE_FREE_MIN */

 /*  When vm_page_external_count exceeds vm_page_external_limit,

Now paging will start earlier.