linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* New Memory Test Suite v0.0.1
@ 2000-04-26 23:31 Juan J. Quintela
  2000-04-27 17:57 ` Christoph Rohland
  0 siblings, 1 reply; 2+ messages in thread
From: Juan J. Quintela @ 2000-04-26 23:31 UTC (permalink / raw)
  To: linux-mm, linux-kernel

Hi
        I have just released a collection of programs for testing
(stressing) the memory system.  Just now the suite is very small, but
if you send your tests, we can obtain a very good testing suite for
the Linux kernel memory system.  I have attached the announcement of
the memory test suite.

Later, Juan.


Memory test suite v0.0.1
------------------------

This is the first version.

This intends to be a set of programs to test the memory management
system.  I am releasing this version with the idea of gather more
programs for the suite.  If you have some program to test the system,
please send it to me (quintela@fi.udc.es).

If you found values/combinations of tests for what the system
crash/Oops/whatever please report it to me.  Then I can include it in
the tests and the people who tune the MM system can test it next time.

Any comments/suggestions/code are welcome.

Thanks for your time,
        Juan Quintela
        quintela@fi.udc.es

The home of this package is:

http://carpanta.dc.fi.udc.es/~quintela/mtest/mtest-0.0.1.tar.gz

-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

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

* Re: New Memory Test Suite v0.0.1
  2000-04-26 23:31 New Memory Test Suite v0.0.1 Juan J. Quintela
@ 2000-04-27 17:57 ` Christoph Rohland
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Rohland @ 2000-04-27 17:57 UTC (permalink / raw)
  To: Juan J. Quintela; +Cc: linux-mm

[-- Attachment #1: Type: text/plain, Size: 149 bytes --]

"Juan J. Quintela" <quintela@fi.udc.es> writes:
> Any comments/suggestions/code are welcome.

Here comes my shm test proggy.

Greetings
		Christoph


[-- Attachment #2: ipctst.c --]
[-- Type: text/plain, Size: 1915 bytes --]

#include <stdlib.h>
#include <stdio.h>

#include <errno.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>

int main (int ac, char **av) {
	int segs, size, proc, rmpr;
	unsigned long long iter;
	struct shmid_ds buf;
	pid_t pid;

	if (ac < 6) {
		printf ("usage: shmtst segs size proc iter rm%%\n");
		exit (1);
	}
	segs = atoi (av[1]);
	size = atoi (av[2]);
	proc = atoi (av[3]);
	iter = atoi (av[4]);
	rmpr = atoi (av[5]);

	iter = 1 << iter;
	printf ("using %d segs of size %d (%llu iterations)\n", 
		segs, size, iter);
	while (-- proc) {
		if ((pid = fork()) > 0) {
			printf ("started process %d\n", (int) pid);
		} else {
			break;
		}
	}
	srandom (getpid());
	while (iter--) {
		key_t key;
		int seg, i, rm;
		unsigned char c, *ptr;
		volatile unsigned char *p;

		key = random() % segs +1;
		if ((seg = shmget (key, size, IPC_CREAT| 0600)) == -1) {
			perror("shmget");
			if (errno != EIDRM && errno != ENOSPC)
				exit (1);
			continue;
		}
		if (1) sched_yield();
		if ((ptr = shmat (seg, 0, 0)) == (unsigned char *) -1) {
			perror ("shmat");
			continue;
		}
		if (random () % 100 < rmpr) {
			if (random() % 1)
				rm = 1;
			else
				rm = -1;
		} else {
			rm = 0;
		}

		if (rm < 0 &&
		    shmctl (seg, IPC_RMID, NULL) == -1) 
			perror("pre: shmctl IPC_RMID");
		for (p = ptr; p < ptr + size; p += 4097)
			*p = (unsigned char) (p - ptr);
		for (p = ptr; p < ptr + size; p += 4097) {
			c = *p;
			if (c == (unsigned char)(p-ptr)) 
				continue;
			shmctl (seg, IPC_STAT, &buf);
			printf ("n=%i, m = %i: %i != %i", (int) buf.shm_nattch,
				(int)buf.shm_perm.mode,
				(int)(unsigned char)(p-ptr), (int) c);
			for (i = 0 ; i < 5; i++) {
				printf (", %i", (int)*p);
				sched_yield();
			}
			printf ("\n");
		}

		if (shmdt (ptr) != 0) {
			perror("shmdt");
			exit (1);
		}

		if (rm > 0 &&
		    shmctl (seg, IPC_RMID, NULL) == -1) 
			perror("post shmctl IPC_RMID");
	}
}	

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

end of thread, other threads:[~2000-04-27 17:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-26 23:31 New Memory Test Suite v0.0.1 Juan J. Quintela
2000-04-27 17:57 ` Christoph Rohland

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