From: MaoXiaoyun Subject: RE: Rather slow time of Pin in Windows with GPL PV driver Date: Thu, 10 Mar 2011 11:17:45 +0800 Message-ID: References: , , , Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1483620777==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: james.harper@bendigoit.com.au Cc: xen devel List-Id: xen-devel@lists.xenproject.org --===============1483620777== Content-Type: multipart/alternative; boundary="_cab65083-e793-45d4-bb40-6d977a574e56_" --_cab65083-e793-45d4-bb40-6d977a574e56_ Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Hi James: =20 I did some more test, add some log to what the interrupts distribut= ion. In XenNet_RxBufferCheck I log the CPU number by adding line=20 KdPrint((__DRIVER_NAME " pcpu =3D %lu\n", pcpu)); please refer = to below code. =20 Result below show that when KeSetTargetProcessorDpc is commentten, = the interrupts distribute over all VCPUs, could this explain something? =20 Beside, I did some perf test using netperf, no performanc differenc= e observed. =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DResult=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 1) KeSetTargetProcessorDpc(&xi->rx_dpc, 0) is commentted. XnetNet pcpu =3D 1 XnetNet pcpu =3D 3 XnetNet pcpu =3D 2 XnetNet pcpu =3D 3 XnetNet pcpu =3D 7 XnetNet pcpu =3D 0 XnetNet pcpu =3D 5 XnetNet pcpu =3D 3 XnetNet pcpu =3D 0 XnetNet pcpu =3D 3 XnetNet pcpu =3D 7 XnetNet pcpu =3D 4 XnetNet pcpu =3D 5 XnetNet pcpu =3D 2 XnetNet pcpu =3D 4 XnetNet pcpu =3D 5 XnetNet pcpu =3D 6 XnetNet pcpu =3D 0 XnetNet pcpu =3D 6 =20 2) KeSetTargetProcessorDpc(&xi->rx_dpc, 0) is *NOT*commentted. XnetNet pcpu =3D 0 XnetNet pcpu =3D 0 XnetNet pcpu =3D 0 XnetNet pcpu =3D 0 XnetNet pcpu =3D 0 XnetNet pcpu =3D 0 XnetNet pcpu =3D 0 XnetNet pcpu =3D 0 XnetNet pcpu =3D 0 XnetNet pcpu =3D 0 XnetNet pcpu =3D 0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D static VOID XenNet_RxBufferCheck(PKDPC dpc, PVOID context, PVOID arg1, PVOID arg2) { struct xennet_info *xi =3D context; RING_IDX cons, prod; LIST_ENTRY rx_packet_list; PLIST_ENTRY entry; PNDIS_PACKET packets[MAXIMUM_PACKETS_PER_INDICATE]; ULONG packet_count =3D 0; struct netif_rx_response *rxrsp =3D NULL; struct netif_extra_info *ei; USHORT id; int more_to_do =3D FALSE; packet_info_t *pi =3D &xi->rxpi; //NDIS_STATUS status; shared_buffer_t *page_buf; PNDIS_BUFFER buffer; ULONG pcpu =3D KeGetCurrentProcessorNumber() & 0xff; UNREFERENCED_PARAMETER(dpc); UNREFERENCED_PARAMETER(arg1); UNREFERENCED_PARAMETER(arg2); //FUNCTION_ENTER(); KdPrint((__DRIVER_NAME " pcpu =3D %lu\n", pcpu)); =20 if (!xi->connected) =20 > Subject: RE: Rather slow time of Pin in Windows with GPL PV driver > Date: Wed, 9 Mar 2011 22:28:48 +1100 > From: james.harper@bendigoit.com.au > To: tinnycloud@hotmail.com > CC: xen-devel@lists.xensource.com >=20 > > I may try pin later, my host has 4 * 4 core CPU. > >=20 > > Well, I just compare GPL and RHEL PV driver codes, I noticed most of > the net > > driver > > initialization is the same. Only one difference, in GPL code has the > code of > > KeSetTargetProcessorDpc(&xi->rx_dpc, 0); //in xennet_rx.c line 953 > > but the RHEL doesn't > >=20 > > So I simply comments the code, recompile and did the test again. > > The result shows good, all ping time less than < 1ms. > >=20 > > May it be the cause? Is it harmful to comments this line? > > Many thanks. > >=20 >=20 > At a guess I would say it should be harmful to performance, but all the > critical code is protected by spinlocks. >=20 > It could be a leftover from a previous version of GPLPV. In the current > version, the spinlock protected code is probably a little long winded > but is nothing compared to the passing down of packets to Windows that > is done in the DPC but outside the spinlock. >=20 > Can you do some general performance tests with this change? >=20 > Is the RHEL PV driver source publicly available? >=20 > James =20 --_cab65083-e793-45d4-bb40-6d977a574e56_ Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable Hi James:
 
      I did some more test, add some log to what= the interrupts distribution.
      In XenNet_RxBufferCheck I log the CPU= number by adding line
      KdPrint((__DRIVER_NAME "  &= nbsp; pcpu =3D %lu\n", pcpu));  please refer to = below code.
 
      Result below show that when KeSetTargetPro= cessorDpc is commentten, the interrupts
distribute over all VCPUs, could this explain something?
 
      Beside, I did some perf test using netperf= , no performanc difference observed.
 
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DResult=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<= BR>       1) KeSetTargetProcessorDpc(&xi->rx_= dpc, 0) is commentted.
       XnetNet    =    pcpu =3D 1
       XnetNet    =    pcpu =3D 3
       XnetNet    =    pcpu =3D 2
       XnetNet    =    pcpu =3D 3
       XnetNet    =    pcpu =3D 7
       XnetNet    =    pcpu =3D 0
       XnetNet    =    pcpu =3D 5
       XnetNet    =    pcpu =3D 3
       XnetNet    =    pcpu =3D 0
       XnetNet    =    pcpu =3D 3
       XnetNet    =    pcpu =3D 7
       XnetNet    =    pcpu =3D 4
       XnetNet    =    pcpu =3D 5
       XnetNet    =    pcpu =3D 2
       XnetNet    =    pcpu =3D 4
       XnetNet    =    pcpu =3D 5
       XnetNet    =    pcpu =3D 6
       XnetNet    =    pcpu =3D 0
       XnetNet    =    pcpu =3D 6
     
       2) KeSetTargetProcessorDpc(&xi-&= gt;rx_dpc, 0) is *NOT*commentted.
       XnetNet    =    pcpu =3D 0
       XnetNet    =    pcpu =3D 0
       XnetNet    =    pcpu =3D 0
       XnetNet    =    pcpu =3D 0
       XnetNet    =    pcpu =3D 0
       XnetNet    =    pcpu =3D 0
       XnetNet    =    pcpu =3D 0
       XnetNet    =    pcpu =3D 0
       XnetNet    =    pcpu =3D 0
       XnetNet    =    pcpu =3D 0
       XnetNet    =    pcpu =3D 0
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
s= tatic VOID
XenNet_RxBufferCheck(PKDPC dpc, PVOID c= ontext, PVOID arg1, PVOID arg2)
{
  s= truct xennet_info *xi =3D context;
  RIN= G_IDX cons, prod;
  LIST_ENTRY rx_packet_list= ;
  PLIST_ENTRY entry;
  PNDIS_PACKET = ;packets[MAXIMUM_PACKETS_PER_INDICATE];
  ULONG packet_= count =3D 0;
  struct netif_rx_response = *rxrsp =3D NULL;
  struct netif_extra_info&nb= sp;*ei;
  USHORT id;
  int more_to_do=  =3D FALSE;
  packet_info_t *pi =3D = ;&xi->rxpi;
  //NDIS_STATUS status;
 &nb sp;shared_buffer_t *page_buf;
  PNDIS_BUFFER buff= er;
  ULONG pcpu =3D KeGetCurrentProcessorNum= ber() & 0xff;

  UNREFERENCED_PARAMETER(dpc= );
  UNREFERENCED_PARAMETER(arg1);
  UNREFERENC= ED_PARAMETER(arg2);

  //FUNCTION_ENTER();

 &= nbsp;KdPrint((__DRIVER_NAME "    pcpu =3D&n= bsp;%lu\n", pcpu));    

  if&nb= sp;(!xi->connected)

 
> Subject: RE: Rather slow time of Pin in Windows with GPL PV driver> Date: Wed, 9 Mar 2011 22:28:48 +1100
> From: james.harper@be= ndigoit.com.au
> To: tinnycloud@hotmail.com
> CC: xen-devel@l= ists.xensource.com
>
> > I may try pin later, my host has= 4 * 4 core CPU.
> >
> > Well, I just compare GPL and = RHEL PV driver codes, I noticed most of
> the net
> > driv= er
> > initialization is the same. Only one difference, in GPL c= ode has the
> code of
> > KeSetTargetProcessorDpc(&xi-= >rx_dpc, 0); //in xennet_rx.c line 953
> > but the RHEL doesn= 't
> >
> > So I simply comments the code, recompile an= d did the test again.
> > The result shows good, all ping time l= ess than < 1ms.
> >
> > May it be the cause? Is it = harmful to comments this line?
> > Many thanks.
> > >
> At a guess I would say it=20 should be harmful to performance, but all the
> critical code is p= rotected by spinlocks.
>
> It could be a leftover from a pre= vious version of GPLPV. In the current
> version, the spinlock prot= ected code is probably a little long winded
> but is nothing compar= ed to the passing down of packets to Windows that
> is done in the = DPC but outside the spinlock.
>
> Can you do some general pe= rformance tests with this change?
>
> Is the RHEL PV driver = source publicly available?
>
> James
--_cab65083-e793-45d4-bb40-6d977a574e56_-- --===============1483620777== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1483620777==--