WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH][RFC] consider vcpu-pin weight on Credit Scheduler TA

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH][RFC] consider vcpu-pin weight on Credit Scheduler TAKE2
From: Atsushi SAKAI <sakaia@xxxxxxxxxxxxxx>
Date: Wed, 27 Jun 2007 16:58:06 +0900
Delivery-date: Wed, 27 Jun 2007 00:56:50 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi, Keir

This patch intends 
to consider vcpu-pin weight on credit scheduler TAKE2.
http://lists.xensource.com/archives/html/xen-devel/2007-06/msg00359.html

The difference from previous one is
1) Coding style clean up
2) Skip loop for unused vcpu-pin-count.
3) Remove if pin_count ==1 in multiple loop.
   Then pin_count ==1 is another loop.

Signed-off-by: Atsushi SAKAI <sakaia@xxxxxxxxxxxxxx>

And one question, 
Does this patch need following tune up for reducing multiple loop?

>From following

-  /* sort weight */
-  for(j=0;j<pin_count;j++)
-  {
-      sortflag = 0;
-      for(k=1;k<pin_count;k++)
-      {
-          if ( pcpu_weight[pcpu_id_list[k-1]] > pcpu_weight[pcpu_id_list[k]] 
)
-          {
-              sortflag = 1;
-              pcpu_id_handle  = pcpu_id_list[k-1];
-              pcpu_id_list[k-1] = pcpu_id_list[k];
-              pcpu_id_list[k]   = pcpu_id_handle;
-          }
-      }
-      if( sortflag == 0)break;
-  }

To following

+     /* sort weight */
+     for(k=1;k<pin_count;k++)
+     {
+          if ( pcpu_weight[pcpu_id_list[k-1]] > pcpu_weight[pcpu_id_list[k]] 
)
+          {
+              pcpu_id_handle  = pcpu_id_list[k-1];
+              pcpu_id_list[k-1] = pcpu_id_list[k];
+              pcpu_id_list[k]   = pcpu_id_handle;
+              if (k > 1) k -= 2;  
+           }
+     }


Thanks
Atsushi SAKAI

 

Attachment: vcpupinweight0627.patch
Description: Binary data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel