Re: [RFC, PATCH] cond_resched() added to close_files()

From: Eric Dumazet
Date: Fri May 12 2006 - 08:23:51 EST


Ingo Molnar a écrit :
* Andrew Morton <akpm@xxxxxxxx> wrote:

Makes my machine hang early during the startup of init.

The last process to pass through close_file() is `hostname', presuably parented by init. `hostname' exits then everything stops. init is left sleeping in select().

All very strange.

weird. This really shouldnt cause a hang - i think there must be a bug hiding elsewhere, this cond_resched() ought to be fine.

Ingo

Maybe a process is now awaken because of a closed pipe, instead of a SIGCHLD

Process A, father/parent of process B. They share a pipe (A reads the pipe, B writes to)

Before

Process B exits, "atomically close all of its files and sending a SIGCLD to its parent"
Process A catch the SIGCLD.

After :
Process B exits "close its files (and the pipe), reschedule before final SIGCLD"
Process A gets the POLLIN/POLLHUP indication on the pipe -> Another code path is run and may trigger a user side bug ?


Eric




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/