[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Domain Crashed when requested a Hugepage


  • To: Xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: ashwin wasani <vasani.ashwin@xxxxxxxxx>
  • Date: Mon, 10 Jan 2011 09:13:13 -0800
  • Cc:
  • Delivery-date: Tue, 11 Jan 2011 03:30:04 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=T5KKLxeas+p3Pr65eOPAij0qM6JgFd7ocdIWw/dZAFKKvZ2/K7bDkrIFBOWb9+qbKS szBeSSTvmAfmxsmczBehkLaJPaAcxxJ2UCdoql+wv9AWF5qC0r/KZmDwXyuvIgPtuJjH Dhf3UTNPXtA3nWdvuTXy9JVMaUuL3KHjLGsgI=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

hi,
I tried to make huge page request in Fedora x86_64 PV DOMU guest using xen 4.1 unstable and it crashed.
I allocated hugepages by specifing boot parameter.
I used following command to check  hugepages
#cat /proc/meminfo | grep Huge
HugePages_Total:      10
HugePages_Free:       10
HugePages_Rsvd:      0
Hugepagesize:     2048kB

It gave me that there are 10 free huge pages available.
 
Then in DOMU,I requested a huge page from C file as below.
#include <stdio.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <stdlib.h>

#define MB_1 (1024*1024)
#define MB_8 (8*MB_1)

char  *a;
int shmid1;

void init_hugetlb_seg()
{
  shmid1 = shmget(2, MB_8, SHM_HUGETLB
         | IPC_CREAT | SHM_R
         | SHM_W);
  if ( shmid1 < 0 ) {
    perror("shmget");
    exit(1);
  }
  printf("HugeTLB shmid: 0x%x\n", shmid1);
  a = shmat(shmid1, 0, 0);
  if (a == (char *)-1) {
    perror("Shared memory attach failure");
    shmctl(shmid1, IPC_RMID, NULL);
    exit(2);
  }
}

void wr_to_array()
{
  int i;
  for( i=0 ; i<MB_8 ; i++) {
    a[i] = 'A';
  }
}

void rd_from_array()
{
  int i, count = 0;
  for( i=0 ; i<MB_8 ; i++)
    if (a[i] == 'A') count++;
  if (count==i)
    printf("HugeTLB read success :-)\n");
  else
    printf("HugeTLB read failed :-(\n");
}

int main(int argc, char *argv[])
{
  init_hugetlb_seg();
  printf("HugeTLB memory segment initialized !\n");
  printf("Press any key to write to memory area\n");
  getchar();
  wr_to_array();
  printf("Press any key to rd from memory area\n");
  getchar();
  rd_from_array();
  shmctl(shmid1, IPC_RMID, NULL);
  return 0;
}
Unfortunatly when hugepage requested from PV-DOMU, it crashed but when
I run the same code on normal linux, it successfuly returned hugepages.
Does it means that hugepages are not supported in PV-DOMU. If not then
me and my team would like to add support of Hugepages in PV-DOMU.
 
P.S: Crash report attached with this mail.
--
With Regards,
Ashwin Vasani
B.E. (Fourth Year)
Computer  Engineering,
Pune Institute of Computer Technology.
+91 9960405802

Attachment: crashreport.txt
Description: Text document

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.