avoid deadlock by disk intr acking interrupt first, then processing ring

This commit is contained in:
Robert Morris 2020-10-04 09:21:03 -04:00 committed by Frans Kaashoek
parent 3c70be9070
commit aeaf610c67
2 changed files with 37 additions and 21 deletions

View file

@ -1734,6 +1734,7 @@ void
manywrites(char *s)
{
int nchildren = 4;
int howmany = 30; // increase to look for deadlock
for(int ci = 0; ci < nchildren; ci++){
int pid = fork();
@ -1749,7 +1750,7 @@ manywrites(char *s)
name[2] = '\0';
unlink(name);
for(int iters = 0; iters < 500000; iters++){
for(int iters = 0; iters < howmany; iters++){
for(int i = 0; i < ci+1; i++){
int fd = open(name, O_CREATE | O_RDWR);
if(fd < 0){
@ -1765,8 +1766,6 @@ manywrites(char *s)
close(fd);
}
unlink(name);
if((iters % 50) == ci)
write(1, ".", 1);
}
unlink(name);
@ -2737,7 +2736,7 @@ main(int argc, char *argv[])
void (*f)(char *);
char *s;
} tests[] = {
// {manywrites, "manywrites"},
{manywrites, "manywrites"},
{execout, "execout"},
{copyin, "copyin"},
{copyout, "copyout"},