From owner-cvs-all@FreeBSD.ORG Tue Sep 19 23:29:10 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 005F416A586; Tue, 19 Sep 2006 23:29:09 +0000 (UTC) (envelope-from mb@imp.ch) Received: from pop.imp.ch (mx2.imp.ch [157.161.9.17]) by mx1.FreeBSD.org (Postfix) with ESMTP id 673B543D93; Tue, 19 Sep 2006 23:29:08 +0000 (GMT) (envelope-from mb@imp.ch) Received: from godot.imp.ch (godot.imp.ch [157.161.4.8]) by pop.imp.ch (8.13.8/8.13.8/Submit_imp) with ESMTP id k8JNT5x9094753; Wed, 20 Sep 2006 01:29:06 +0200 (CEST) (envelope-from mb@imp.ch) Date: Wed, 20 Sep 2006 01:29:05 +0200 (CEST) From: Martin Blapp To: John Baldwin In-Reply-To: <200609191714.46864.jhb@freebsd.org> Message-ID: <20060920012110.P1494@godot.imp.ch> References: <200609191925.k8JJPBaH091145@repoman.freebsd.org> <200609191714.46864.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Scanned-By: MIMEDefang 2.57 on 157.161.9.65 Cc: cvs-src@FreeBSD.org, Martin Blapp , cvs-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/kern kern_proc.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Sep 2006 23:29:10 -0000 Hi, > Will you be able to revert 1.258 of tty.c now and still be safe from panics? I guess so. I don't see another place which could be dangerous for us beside enterpgrp(). I don't understand the code there 100%. sys/kern/kern_proc.c: line 308 if (sess != NULL) { ^^^^^^ Why only if a session already exists ? Could you explain that to me ? Anyway, we may need here Giant too. What do you think ? /* * new session */ mtx_init(&sess->s_mtx, "session", NULL, MTX_DEF); PROC_LOCK(p); p->p_flag &= ~P_CONTROLT; PROC_UNLOCK(p); PGRP_LOCK(pgrp); sess->s_leader = p; sess->s_sid = p->p_pid; sess->s_count = 1; sess->s_ttyvp = NULL; sess->s_ttyp = NULL; But I don't think we should revert v. 1.258 because the locks will be needed later. After NEED_GIANT has gone (from tty code) we will need the same lock at the same place again to avoid races. There are some places more where we need the locks then. I propose to keep rev. 1.258 (maybe not to MFC it) or to add a comment instead. Martin