public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [TEST] page tables filling non-highmem
@ 2002-02-15  4:51 William Lee Irwin III
  2002-02-15  8:59 ` Daniel Phillips
  2002-02-19  0:03 ` William Lee Irwin III
  0 siblings, 2 replies; 15+ messages in thread
From: William Lee Irwin III @ 2002-02-15  4:51 UTC (permalink / raw)
  To: linux-kernel; +Cc: rsf

The following testcase brought down 2.4.17 mainline on an
8-way P-III 700MHz machine with 12GB of RAM. The last thing
logged from it was a LowFree of 2MB with 9GB of highmem free
after something like 6-8 hours of pounding away, at which
time the machine stopped responding (IIRC it was given ~12
hours to echo another character).

This testcase is a blatant attempt to fill the direct-mapped
portion of the kernel virtual address space with process pagetables.
It was suspected such a thing was happening in another failure scenario
which is what motivated me to devise this testcase. I believe a fix
already exists (i.e. aa's ptes in highmem stuff) though I've not yet
verified its correct operation here.

The driver script was this:

#!/bin/sh
for n in `seq 0 1023`
do
	./death &
done

and the C program was the following:

#define __USE_LARGEFILE64
#include <stdio.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#define __USE_LARGEFILE64
#include <fcntl.h>
#include <errno.h>

#define MAPPING_START 0x20000000
#define MAPPING_SIZE  (0x80000000/sizeof(unsigned long))
#define MAPPING_END   (MAPPING_START + MAPPING_SIZE*sizeof(unsigned long))

int main(void)
{
	int fd;
	unsigned long *data = NULL;
	unsigned long try = 64;
	unsigned long k = 0;

	fd = open("/home/wli/bench/mapfile", O_RDWR|O_LARGEFILE);

	if (fd < 0) {
		perror("death");
		printf("could not open mapfile!\n");
		exit(1);
	}

	data = mmap((void *)MAPPING_START,
			MAPPING_SIZE,
			PROT_READ|PROT_WRITE, 
			MAP_FIXED | MAP_SHARED,
			fd,
			0);

	if (!try || data == MAP_FAILED) {
		printf("mmap() failed, tries = %lu!\n", 64 - try + 1);
		exit(1);
	}

	printf("managed to mmap() at %p\n", (void *)data);

	sleep(60);

	try = 0;
	while (1) {
		printf("entered iteration %lu\n", k);
		data[k++] = try++;
		k %= MAPPING_SIZE;
		if (k >= MAPPING_SIZE-1)
			k = 0;
	}
	return 0;
}


Cheers,
Bill

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2002-02-19  0:16 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-15  4:51 [TEST] page tables filling non-highmem William Lee Irwin III
2002-02-15  8:59 ` Daniel Phillips
2002-02-15  8:56   ` William Lee Irwin III
2002-02-18  1:38   ` Andrea Arcangeli
2002-02-18  1:59     ` Daniel Phillips
2002-02-18  3:02       ` Marcelo Tosatti
2002-02-18 12:39       ` Andrea Arcangeli
2002-02-18  3:26     ` William Lee Irwin III
2002-02-18 12:27       ` Andrea Arcangeli
2002-02-18 12:59         ` Daniel Phillips
2002-02-18 13:15           ` Andrea Arcangeli
2002-02-19  0:06             ` Daniel Phillips
2002-02-18  4:25     ` William Lee Irwin III
2002-02-19  0:03 ` William Lee Irwin III
     [not found]   ` <Pine.LNX.4.33.0202181914350.5124-100000@coffee.psychology.mcmaster.ca>
2002-02-19  0:16     ` William Lee Irwin III

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox