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

Linus Torvalds (torvalds@transmeta.com)
Wed, 18 Sep 2002 23:10:32 -0700 (PDT)


On Thu, 19 Sep 2002, Ingo Molnar wrote:
>
> the attached patch is a significantly cleaned up version of the generic
> pidhash patch, against BK-curr.

Hmm.. I think I like it. One big improvement is just the renaming of
"struct idtag" to "struct pid", which makes it look a lot less abstract to
me. Maybe that's just me.

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);
> + if (tty->session > 0)
> + for_each_task_pid(tty->session, PIDTYPE_SID, p, l, pid) {
> + if (p->tty == tty)
> + p->tty = NULL;
> + if (!p->leader)
> + continue;
> + send_sig(SIGHUP, p, 1);
> + send_sig(SIGCONT, p, 1);
> if (tty->pgrp > 0)
> p->tty_old_pgrp = tty->pgrp;
> }
> - if (p->tty == tty)
> - p->tty = NULL;
> - }

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?

Can you double-check some of these things?

Linus

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