From owner-cvs-all@FreeBSD.ORG Wed Sep 20 15:43:15 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 A3D6B16A403; Wed, 20 Sep 2006 15:43:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id E1B0143D68; Wed, 20 Sep 2006 15:43:14 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (zion.baldwin.cx [192.168.0.7]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k8KFhAXW095295; Wed, 20 Sep 2006 11:43:12 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Martin Blapp Date: Wed, 20 Sep 2006 11:09:12 -0400 User-Agent: KMail/1.9.1 References: <200609191925.k8JJPBaH091145@repoman.freebsd.org> <200609191714.46864.jhb@freebsd.org> <20060920012110.P1494@godot.imp.ch> In-Reply-To: <20060920012110.P1494@godot.imp.ch> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200609201109.13271.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [192.168.0.1]); Wed, 20 Sep 2006 11:43:12 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/1909/Tue Sep 19 22:58:44 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: cvs-src@freebsd.org, Martin Blapp , src-committers@freebsd.org, cvs-all@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: Wed, 20 Sep 2006 15:43:15 -0000 On Tuesday 19 September 2006 19:29, Martin Blapp wrote: > > 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 ? This is because the callers pre-allocate session and process group objects and then enterpgrp() initializes them and glues them together IIRC. > /* > * 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. Well, I'd rather use whatever lock we end up using for t_session instead of assuming it's going to be proctree_lock, so I'd like to leave t_session only under Giant for now until we really know what we are doing. -- John Baldwin