lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b040c32a0703231456u298186c6o1ec7199bfdbe7f65@mail.gmail.com>
Date:	Fri, 23 Mar 2007 14:56:07 -0700
From:	"Ken Chen" <kenchen@...gle.com>
To:	"William Lee Irwin III" <wli@...omorphy.com>
Cc:	"Adam Litke" <agl@...ibm.com>,
	"Andrew Morton" <akpm@...ux-foundation.org>,
	"Arjan van de Ven" <arjan@...radead.org>,
	"Christoph Hellwig" <hch@...radead.org>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: [patch] rfc: introduce /dev/hugetlb

On 3/23/07, William Lee Irwin III <wli@...omorphy.com> 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");
		exit(1);
	}

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

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

	printf("success!\n");
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ