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] Re: Domain Crashed when requested a Hugepage

To: Xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Re: Domain Crashed when requested a Hugepage
From: ashwin wasani <vasani.ashwin@xxxxxxxxx>
Date: Mon, 10 Jan 2011 23:44:16 +0530
Cc:
Delivery-date: Tue, 11 Jan 2011 03:31:10 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=SAcOH1eJZDb8GCgmBvpvB+/pE5CKLmGjG25U2SwXbIE=; b=gZL4VkN0h7ZTBtM1Ai6Vr80GU4HlG3L75hRmOOFuDZHSnqSsMuCo89Me+U1CuOL1kt r59yHGYP6JFjAZuD86N5NLgkkVA27NimdRCsDIAkSieyMjDbbqBxcZdnpwVvVJGsgEEH 7doM1V5Wmf6GoxP84IgZlXvKdGzRIT5uqm1qI=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=phCWGsNcdW48JyymAYSgxaYgjREo+miIGbZo26LPYTMYlpl0onIiFmRFl5vF8R37m2 TuDZqH2M+h7wVSL5+akrue3VsA8pZvzMMVl2aNbJzu+YxxjJ4PwgdLpDbd6ajt2HxIQV b4kqPoTFkKbeYeGnWtdqLtL7p8jDXQ7+mL5bo=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AANLkTik6TUHwUj=T1_Uyk1Tk3uwXisFBvxwQSzSzm6ra@xxxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <AANLkTik6TUHwUj=T1_Uyk1Tk3uwXisFBvxwQSzSzm6ra@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Sorry for starting this thread.
Please do not reply on this and also follow this thread
http://lists.xensource.com/archives/html/xen-devel/2011-01/msg00542.html

On Mon, Jan 10, 2011 at 10:43 PM, ashwin wasani <vasani.ashwin@xxxxxxxxx> wrote:
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



--
With Regards,
Ashwin Vasani
B.E. (Fourth Year)
Computer  Engineering,
Pune Institute of Computer Technology.
+91 9960405802
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>