Re: Linux-2.2.2-pre2..

Linus Torvalds (torvalds@transmeta.com)
Sun, 7 Feb 1999 11:01:33 -0800 (PST)


On Sun, 7 Feb 1999, Andrea Arcangeli wrote:
>
> It still seems that do_tty_hangup() is racing with the other CPU due
> lock_kernel() that does nothing,

No, do_tty_hangup() will never be called asynchronously: it will always be
called from a synchronous kernel context (either from within the scheduler
or from processes that do a run_task_queue() on their own).

If the caller already held the kernel lock, lock_kernel() is indeed a
no-op, but that's how it's designed: it doesn't need to do anything at
that point.

Basically, the problem is not the kernel lock itself - everything we do
runs with the kernel lock held (either gotten by do_tty_hangup(), or by
the entity that called it). The problem is that we cache a "tty" pointer
in between lock domains - so even though everything holds the kernel lock,
there is nothing that validates that the pointer is not stale.

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/