[Kos-cvs] kos/modules/test vmm_test.c,1.4,1.5

thomas at kos.enix.org thomas at kos.enix.org
Tue Jan 4 23:19:21 CET 2005


Update of /home/kos/cvs/kos/modules/test
In directory the-doors:/tmp/cvs-serv9995/modules/test

Modified Files:
	vmm_test.c 
Log Message:
2005-01-04  Thomas Petazzoni  <thomas at crazy.kos.nx>

	* modules/arch/mm/_pgflt.c (_page_fault): Display some
	informations even if pf_nested_level != 1.

	* modules/test/vmm_test.c (vmm_test): Allow the VMM stress test to
	be run multiple times.

	* modules/scheduler/_synchq.c (synchq_wait_unsafe): After the
	wakeup of the thread the synchq should still be locked. Check
	this.



Index: vmm_test.c
===================================================================
RCS file: /home/kos/cvs/kos/modules/test/vmm_test.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- vmm_test.c	29 Dec 2004 19:28:51 -0000	1.4
+++ vmm_test.c	4 Jan 2005 22:19:19 -0000	1.5
@@ -352,7 +352,7 @@
 static void vmm_stress_test(void *data)
 {
 #define REGION_SIZE (10*PAGE_SIZE)
-#define ITERATIONS 100
+#define ITERATIONS 10
   vaddr_t vaddr1, vaddr2;
   result_t result;
   k_ui32_t flags;
@@ -440,30 +440,38 @@
 result_t vmm_test()
 {
   result_t result;
-  int i;
+  int i, j;
   k_ui32_t flags;
 
-  for (i = 0; i < 2; i++)
+  for (j = 0; j < 1; j++)
     {
-      create_kernel_thread(NULL, vmm_stress_test, (void *) (USER_SPACE_START + i*50*PAGE_SIZE));
 
-      write_spin_lock(vmm_test_lock, flags);
-      thread_count++;
-      write_spin_unlock(vmm_test_lock, flags);
-    }
+      __dbg_printk("START PMM count : %d\n", get_free_memory_pages());
 
-  while(thread_count > 0)
-    {
-      usleep(100000);
-    }
+      for (i = 0; i < 1; i++)
+	{
+	  create_kernel_thread(NULL, vmm_stress_test, (void *) (USER_SPACE_START + (i+j)*50*PAGE_SIZE));
 
-  if(thread_count == 0)
-    {
-      __dbg_printk("SUCCESS !!\n");
-    }
-  else if(thread_count == -1)
-    {
-      __dbg_printk("FAILURE !!\n");
+	  write_spin_lock(vmm_test_lock, flags);
+	  thread_count++;
+	  write_spin_unlock(vmm_test_lock, flags);
+	}
+
+      while(thread_count > 0)
+	{
+	  usleep(100000);
+	}
+
+      if(thread_count == 0)
+	{
+	  __dbg_printk("SUCCESS !!\n");
+	}
+      else if(thread_count == -1)
+	{
+	  __dbg_printk("FAILURE !!\n");
+	}
+
+      __dbg_printk("END PMM count : %d\n", get_free_memory_pages());
     }
 
   return ESUCCESS;



More information about the Kos-cvs mailing list