Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Dec 2006 20:42:48 +0100 (CET)
From:      Martin Blapp <mb@imp.ch>
To:        Attilio Rao <attilio@freebsd.org>
Cc:        cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/kern tty.c
Message-ID:  <20061220202842.E53548@godot.imp.ch>
In-Reply-To: <3bbf2fe10612200816x11c59af3r8b1d2721215267fe@mail.gmail.com>
References:  <200612192234.kBJMYYo0055529@repoman.freebsd.org>  <3bbf2fe10612191850y3a546fcew486575385b1400df@mail.gmail.com>  <20061220040337.H53548@godot.imp.ch> <3bbf2fe10612200816x11c59af3r8b1d2721215267fe@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

Hi,

>Ok, after a quick look at the patch (and this note) it makes more
>sense to me, but then would not be cleaner to do something like:
>
> sx_slock(&proctree_lock);
> if (tp->t_session && tp->t_session->s_leader) { ...
> }
> sx_sunlock(&proctree_lock);
>

You mean to restore rev. 1.258 ?

http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/kern/tty.c.diff?r1=1.257&r2=1.258

The answer is easy, rev. 1.258 costs more in the cases where tp->t_session is
already empty and we don't need to add a proctree lock and can just continue.
We need the proctree lock only if tp->t_session exists. You can call rev. 1.267
less invasive than rev. 1.258 :-)

--
Martin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061220202842.E53548>