[lkml]   [2007]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [patch] rfc: introduce /dev/hugetlb
    On 3/23/07, William Lee Irwin III <> wrote:
    > I like this patch a lot, though I'm not likely to get around to testing
    > it today. If userspace testcode is available that would be great to see
    > posted so I can just boot into things and run that.

    Here is the test code that I used:
    (warning: x86 centric)

    #include <stdlib.h>
    #include <stdio.h>
    #include <fcntl.h>
    #include <sys/mman.h>

    #define SIZE (4*1024*1024UL)

    int main(void)
    int fd;
    long i;
    char *addr;

    fd = open("/dev/hugetlb", O_RDWR);
    if (fd == -1) {
    perror("open failure");

    addr = mmap(0, SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
    if (addr == MAP_FAILED) {
    perror("mmap failure");

    for (i = 0; i < SIZE; i+=4096)
    addr[i] = 1;

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2007-03-23 22:59    [W:0.019 / U:15.464 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site