then the machine stops to respond(no swap activities/no disk access)
except that console switch is ok and keyboard input is still echoed.
If I run this program without swap or with one normal swapfile or
swap partition enabled, It's ok.
Almost all kernel version(2.3.[035] and some 2.2.X, x <= 7) I tried
have similar problem when I swaponed one loop device, and tried to
make a new kernel source tarball. It is very likely reproducable.
BTW, if I start another process which will read disk, for example,
All what this process does is:
for (;;)
{
sleep(30);
system("ps axl");
}
then the machine stops to respond(no swap activities/no disk access)
and SOMETIMES, it will continue to respond after the ps is executed.
p.s.
1. I use only one IDE disk
2. The loop device support is loaded as kernel module.
----- PROGRAM BEGIN HERE -----
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <fcntl.h>
#define DELAY (200000)
#define SIZE (4*1024*1024)
void child(void)
{
char *p;
for (;;)
{
usleep(DELAY);
p = malloc(SIZE);
if (p == NULL)
{
fprintf(stderr, __FUNCTION__ ": malloc(%d) failed\n", SIZE);
exit(1);
}
memset(p, 0, SIZE);
fprintf(stderr, __FUNCTION__ ": malloc(%d) = %p\n", SIZE, p);
fflush(stderr);
}
}
void parent(void)
{
for (;;)
{
sleep(1);
system("ps axl");
fprintf(stderr, "%s", __FUNCTION__);
fflush(stderr);
}
}
void sigchld(int signo)
{
exit(1);
}
int main()
{
signal(SIGCHLD, sigchld);
switch (fork())
{
case -1: perror("fork"); exit(1);
case 0: child();
default: parent();
}
return 0;
}
----- PROGRAM END -----
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/