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

Re: [Xen-devel] Hugepage support

To: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Subject: Re: [Xen-devel] Hugepage support
From: Keshav Darak <keshav_darak@xxxxxxxxx>
Date: Mon, 10 Jan 2011 10:12:01 -0800 (PST)
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Ashwin Vasani <vasani.ashwin@xxxxxxxxx>
Delivery-date: Mon, 10 Jan 2011 10:12:51 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1294683122; bh=ZNKWfBq9LpQzAbL08d8Uzmg616E/6jVHu7h9b0b0iz0=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=spLTS6u9eB7ma2A2huiwmTHrLH9hA4B7Ys+vP1PPegLKQ1s2dKRPwizNJRyDLlTpPfwXK8zYdrB/F+kAg9WY3+OXUDbG29iFsGHUNhBNwc0QloKHbLED+uWJ2NVy79oef00A/+DD7WmSbZrGouwGoUtEFXNJMEtImMvaHckdaKs=
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=17rgmA/GhhQMS99QsgNY4FcN4lfydDX8QucBmLvOd02Hvf2trbADha2ZQHopCpkxviEeHM7wI1ZUf+bbtnLatrdxVNhKdSzyFZMESOnsQ6xN7wP1mPKcg74zViTi/H/HoMo33kXlfwsEKdKiLi5zjx7pGx5hYc8rxHSifHt+Pco=;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110110164630.GB27066@xxxxxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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  when I requested hugepage, kernel didnt crashed but terminal got hanged.
Initially this was the status for hugepage
#cat /proc/meminfo | grep Huge
HugePages_Total:         10
HugePages_Free:         10
HugePages_Rsvd:         0
HugePages_Surp:         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
HugePages_Total:         10
HugePages_Free:         9
HugePages_Rsvd:         3
HugePages_Surp:         2048

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 its not present. Please let me know the status or any development related to this project.

C-Code :
#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;
}


--- On Mon, 1/10/11, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> wrote:

From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Subject: Re: [Xen-devel] Hugepage support
To: "Keshav Darak" <keshav_darak@xxxxxxxxx>
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Date: Monday, 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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>