Re: [patch] fix for OOM deadlock in swap_in (2.2.10) [Re: [test

Linus Torvalds (torvalds@transmeta.com)
Sun, 4 Jul 1999 10:11:07 -0700 (PDT)


On Sun, 4 Jul 1999, Rik van Riel wrote:

> On Sat, 3 Jul 1999, Andrea Arcangeli wrote:
>
> > +void oom(void)
> > {
> ...
> > + force_sig(SIGKILL, current);
>
> > I would like to get some feedback about the patch. Thanks :).
>
> I'm curious why you haven't yet included my process
> selection algoritm. I know it can select a blocked
> or otherwise unkillable process the way the code is
> in right now, but a workaround for that can be made
> in about 5 minutes.

Andreas patch has a much more serious problem: it changes accepted UNIX
semantics. Try this before and after the patch:

#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>

#define PAGE_SIZE 4096

int main(int argc, char **argv)
{
int fd;
char * map;

fd = open("/tmp/duh", O_RDWR | O_CREAT, 0666);
if (fd < 0)
exit(1);
ftruncate(fd, PAGE_SIZE);
map = mmap(NULL, PAGE_SIZE*2, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
*(volatile char *)(map+PAGE_SIZE);
return 0;
}

and see the difference..

I have tried to fix this _correctly_ in 2.3.10-pre2. That fix could be
back-ported to 2.2.x, but Andreas patch really is not acceptable.

And Andrea, I told you this once already in private email. I told you why.
Why don't you listen? "Fixing" a bug badly is worse than leaving it as a
known bug.

Linus

-
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/