Re: Locking a process or thread onto a specific CPU

Alexander S A Kjeldaas (astor@fast.no)
Fri, 19 Feb 1999 14:09:29 +0100 (CET)


On Thu, 18 Feb 1999, Pavel Machek wrote:

> > We ran a 4-CPU SGI machine a while back. It was used by students and
> > obviously they did lots of weird things with it. Once in a while, a
> > student would write a program that essentially forked in a loop where
> > the parent process exited. This kind of process is _hard_ to kill
> > since neither is it visible using 'ps', nor is the PID constant. In
> > IRIX, it is easy to solve this problem by disabling 3 CPUs, and
> > scheduling your shell as a real-time process. Alternatively, you can
> > allocate one CPU to the OS, one for your shell, and disable the other
> > processes. None of this is possible in Linux. In Linux, on a 4-way
> > SMP system, you're stuck.
>
> su (studentname)
> kill -9 -1
>
> is the right way to do this kind of job. Well, all tasks of that
> student are going to die, but I think (s)he deserved it :-).
>

In order to kill it, you have to find it :-). And you won't with ps.
There's a race between ps and the process which the process almost always
wins. So it's hidden. The way you notice this kind of process is that the
load is 1, and top shows no processes using cpu. Then you know something
fishy is going on. You disable some CPUs, schedule your shell as
real-time, and only _then_ can you do a ps to find the offending user.

astor

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