Re: Linux-2.2.2-pre2..

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


On Sun, 7 Feb 1999, Andrea Arcangeli wrote:

> >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.
>
> >From schedule():
>
> ...
> release_kernel_lock(prev, this_cpu);
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

So?

The thing will _re-aquire_ the kernel lock when it comes through this
path. And then the lock_kernel() thing won't be a no-op like you said.

Sometimes it comes through other paths, and then lock_kernel _will_ be a
no-op, but then we will have the kernel lock anyway, so it doesn't matter.

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/