Re: [patch] generic-pidhash-2.5.36-D4, BK-curr

From: Ingo Molnar (
Date: Thu Sep 19 2002 - 04:25:11 EST

On Wed, 18 Sep 2002, Linus Torvalds wrote:

> However:
> > read_lock(&tasklist_lock);
> > - for_each_process(p) {
> > - if ((tty->session > 0) && (p->session == tty->session) &&
> > - p->leader) {
> > - send_sig(SIGHUP,p,1);
> > - send_sig(SIGCONT,p,1);

> This looks a bit wrong. In particular, the old code used to set "p->tty"
> to NULL if it matched any process, while the new code only does that for
> processes in the right session. Hmm?

i had this code changed back and forth twice already, because i was unsure
whether it's correct. It's true that it's not an equivalent
transformation, but after some thinking it looked correct to me. Isnt
there a 1:1 relationship between the tty and the session ID in this case?
Ie. the previous code was pessimistic and just scanned for matching
p->tty's outside of the tty->session == p->session space, but it should
not have done so.

i'll add some debugging code to the old code to print out cases when
p->tty == tty but p->session != tty->session and start up X, that should
prove or disprove this theory, right?

(i cant remember any other place where the code transformation was not
identity, but will double-check this again.)

William, you did the original transformation, was this optimization done


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Sep 23 2002 - 22:00:26 EST