From: Keshav Darak Subject: Re: Hugepage support Date: Mon, 10 Jan 2011 10:12:01 -0800 (PST) Message-ID: <594070.91916.qm@web59606.mail.ac4.yahoo.com> References: <20110110164630.GB27066@dumpdata.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0119422036==" Return-path: In-Reply-To: <20110110164630.GB27066@dumpdata.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Konrad Rzeszutek Wilk Cc: xen-devel@lists.xensource.com, Ashwin Vasani List-Id: xen-devel@lists.xenproject.org --===============0119422036== Content-Type: multipart/alternative; boundary="0-1967796246-1294683121=:91916" --0-1967796246-1294683121=:91916 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable I am using DOM0 as 2.6.32.27 jermey kernel. Fedora x86_64 (2.6.33.3-85.fc13= .x86_64) as PV guest. In DOM0 kernel=A0 when I requested hugepage, kernel didnt crashed but termi= nal got hanged. Initially this was the status for hugepage #cat /proc/meminfo | grep Huge HugePages_Total:=A0=A0=A0=A0=A0=A0 =A0 10 HugePages_Free:=A0=A0=A0=A0=A0=A0 =A0 10 HugePages_Rsvd:=A0=A0=A0=A0=A0=A0=A0=A0 0 HugePages_Surp:=A0=A0=A0=A0=A0=A0=A0=A0 2048 After running C-Code (given at end of this mail),I got following result but= unfortunately terminal got hanged. #cat /proc/meminfo | grep Huge =0AHugePages_Total:=A0=A0=A0=A0=A0=A0 =A0 10 =0AHugePages_Free:=A0=A0=A0=A0=A0=A0 =A0 9 =0AHugePages_Rsvd:=A0=A0=A0=A0=A0=A0=A0=A0 3 =0AHugePages_Surp:=A0=A0=A0=A0=A0=A0=A0=A0 2048 =0A I even checked dmesg but there was no error related to page fault for DOM0. Me and my team would like to enable support of hugepage in PV-DOMU if =0Ait= s not present. Please let me know the status or any development =0Arelated = to this project.=20 C-Code : #include #include #include #include #define MB_1 (1024*1024) #define MB_8 (8*MB_1) char=A0 *a; int shmid1; void init_hugetlb_seg() =0A{ =A0 shmid1 =3D shmget(2, MB_8, SHM_HUGETLB =A0=A0=A0=A0=A0=A0=A0=A0 | IPC_CREAT | SHM_R =A0=A0=A0=A0=A0=A0=A0=A0 | SHM_W); =A0 if ( shmid1 < 0 ) { =A0=A0=A0 perror("shmget"); =A0=A0=A0 exit(1); =A0 } =A0 printf("HugeTLB shmid: 0x%x\n", shmid1); =0A=A0 a =3D shmat(shmid1, 0, 0); =A0 if (a =3D=3D (char *)-1) { =A0=A0=A0 perror("Shared memory attach failure"); =A0=A0=A0 shmctl(shmid1, IPC_RMID, NULL); =A0=A0=A0 exit(2); =A0 } } void wr_to_array() { =A0 int i; =0A=A0 for( i=3D0 ; i wrote: From: Konrad Rzeszutek Wilk Subject: Re: [Xen-devel] Hugepage support To: "Keshav Darak" Cc: xen-devel@lists.xensource.com Date: Monday, January 10, 2011, 4:46 PM On Mon, Jan 10, 2011 at 08:33:41AM -0800, Keshav Darak wrote: > hi, >=20 > I tried to make huge page request in Fedora x86_64 PV guest using xen 4.1= unstable and it crashed(crash info given below) Had you tried this with the supported kernels (which actually is just one right now). That is the 2.6.32 kernels in Jeremy's git tree? _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel =0A=0A=0A --0-1967796246-1294683121=:91916 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
I am using DOM0 as 2.6.32.27 jermey kernel. F= edora x86_64 (2.6.33.3-85.fc13.x86_64) as PV guest.

In DOM0 kernel&n= bsp; when I requested hugepage, kernel didnt crashed but terminal got hange= d.
Initially this was the status for hugepage
#cat /proc/meminfo | gr= ep Huge
HugePages_Total:         10HugePages_Free:         10
HugePage= s_Rsvd:         0
HugePages_Surp= :         2048

After running= C-Code (given at end of this mail),I got following result but unfortunatel= y terminal got hanged.
#cat /proc/meminfo | grep Huge
=0AHugePages_To= tal:         10
=0AHugePages_Free:&nb= sp;        9
=0AHugePages_Rsvd:  = ;       3
=0AHugePages_Surp:  &n= bsp;      2048
=0A
I even checked dmesg but = there was no error related to page fault for DOM0.

Me and my team wo= uld like to enable support of hugepage in PV-DOMU if =0Aits not present. Pl= ease let me know the status or any development =0Arelated to this project. =

C-Code :
#include <stdio.h>
#include <sys/ipc.h><= br>#include <sys/shm.h>
#include <stdlib.h>

#define M= B_1 (1024*1024)
#define MB_8 (8*MB_1)

char  *a;
int shmid= 1;

void init_hugetlb_seg()
=0A{
  shmid1 =3D shmget(2, MB= _8, SHM_HUGETLB
         | IPC_C= REAT | SHM_R
         | SHM_W);<= br>  if ( shmid1 < 0 ) {
    perror("shmget");    exit(1);
  }
  printf("HugeTLB shmid: 0= x%x\n", shmid1);
=0A  a =3D shmat(shmid1, 0, 0);
  if (a = =3D=3D (char *)-1) {
    perror("Shared memory attach fai= lure");
    shmctl(shmid1, IPC_RMID, NULL);
 &nbs= p;  exit(2);
  }
}

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

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

int main(int= argc, char *argv[])
{
  init_hugetlb_seg();
  printf("H= ugeTLB memory segment initialized !\n");
=0A  printf("Press any key= to write to memory area\n");
  getchar();
  wr_to_array();=
  printf("Press any key to rd from memory area\n");
  getc= har();
  rd_from_array();
  shmctl(shmid1, IPC_RMID, NULL);=
=0A  return 0;
}


--- On Mon, 1/10/11, Konrad Rzes= zutek Wilk <konrad.wilk@oracle.com> wrote:

From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>=
Subject: Re: [Xen-devel] Hugepage support
To: "Keshav Darak" <kes= hav_darak@yahoo.com>
Cc: xen-devel@lists.xensource.com
Date: Monda= y, January 10, 2011, 4:46 PM

On Mon, Jan 10= , 2011 at 08:33:41AM -0800, Keshav Darak wrote:
> hi,
>
>= ; I tried to make huge page request in Fedora x86_64 PV guest using xen 4.1= unstable and it crashed(crash info given below)

Had you tried this = with the supported kernels (which actually is just
one right now). That = is the 2.6.32 kernels in Jeremy's git tree?

________________________= _______________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xe= nsource.com/xen-devel

=0A= =0A --0-1967796246-1294683121=:91916-- --===============0119422036== 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 --===============0119422036==--