From owner-freebsd-current@FreeBSD.ORG Wed Sep 12 02:16:39 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59EE016A417 for ; Wed, 12 Sep 2007 02:16:39 +0000 (UTC) (envelope-from freebsd@gm.nunu.org) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.226]) by mx1.freebsd.org (Postfix) with ESMTP id C711C13C428 for ; Wed, 12 Sep 2007 02:16:38 +0000 (UTC) (envelope-from freebsd@gm.nunu.org) Received: by nz-out-0506.google.com with SMTP id l8so38651nzf for ; Tue, 11 Sep 2007 19:16:38 -0700 (PDT) Received: by 10.142.158.17 with SMTP id g17mr350776wfe.1189563397584; Tue, 11 Sep 2007 19:16:37 -0700 (PDT) Received: by 10.142.44.20 with HTTP; Tue, 11 Sep 2007 19:16:37 -0700 (PDT) Message-ID: <626eb4530709111916w55e04bcbp9da576bf6e60d171@mail.gmail.com> Date: Wed, 12 Sep 2007 11:16:37 +0900 From: "Hidetoshi Shimokawa" Sender: freebsd@gm.nunu.org To: gary.jennejohn@freenet.de In-Reply-To: <20070911112419.68e8ec0d@peedub.jennejohn.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3979a4b0707291120v4927a20cm357b845f6d1f3567@mail.gmail.com> <46BE1D6C.6040903@cran.org.uk> <626eb4530708221937h31c8f37fu9527e941ed4000b6@mail.gmail.com> <20070911112419.68e8ec0d@peedub.jennejohn.org> X-Google-Sender-Auth: b2d8f944fc874c01 Cc: attilio@freebsd.org, bruce@cran.org.uk, current@freebsd.org Subject: Re: console hangs after setting hostname X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2007 02:16:39 -0000 On 9/11/07, Gary Jennejohn wrote: > On Thu, 23 Aug 2007 11:37:20 +0900 > "Hidetoshi Shimokawa" wrote: > > > It looks that the low level console is not locked though the high level console > > is locked by Giant. > > > > Could you try the attached patch? > > > > This patch solves the problem and should definitely be committed bfore 7.0. > > -- > Gary Jennejohn > > Yes, it should be committed. I sent a request for approval to re@ last week and waiting for approval. I also have a plan to MFC. Here is a detailed description of the patch. Serialize output routine of terminal emulator (te_puts()) by a lock. - The output routine of low level console is not protected by any lock by default. - Increment and decrement of sc->write_in_progress are not atomic and this may cause console hang. - We also have many other states used by emulator that should be protected by the lock. - This change does not fix interspersed messages which PRINTF_BUFR_SIZE kernel option should fix. MFC after: 1 week -- /\ Hidetoshi Shimokawa \/ simokawa@FreeBSD.ORG