From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id E6BE3B7B5F for ; Thu, 27 Aug 2009 19:27:57 +1000 (EST) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 50D4FDDD04 for ; Thu, 27 Aug 2009 19:27:56 +1000 (EST) Subject: Re: Extending virtio_console to support multiple ports From: Benjamin Herrenschmidt To: Alan Cox In-Reply-To: <20090827100809.5f0aa0a7@linux.intel.com> References: <1251181044-3696-1-git-send-email-amit.shah@redhat.com> <20090826112718.GA11117@amit-x200.redhat.com> <20090826154552.GA31910@amit-x200.redhat.com> <1251346023.20467.21.camel@pasglop> <20090827100809.5f0aa0a7@linux.intel.com> Content-Type: text/plain Date: Thu, 27 Aug 2009 19:27:23 +1000 Message-Id: <1251365243.20467.47.camel@pasglop> Mime-Version: 1.0 Cc: kvm@vger.kernel.org, linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org, miltonm@bga.com, qemu-devel@nongnu.org, borntraeger@de.ibm.com, brueckner@linux.vnet.ibm.com, Amit Shah , virtualization@lists.linux-foundation.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Thu, 2009-08-27 at 10:08 +0100, Alan Cox wrote: > > - Then, are we certain that there's no case where the tty layer will > > call us with some lock held or in an atomic context ? To be honest, > > I've totally lost track of the locking rules in tty land lately so it > > might well be ok, but something to verify. > > Some of the less well behaved line disciplines do this and always have > done. That was also my understanding but heh, I though that maybe you may have fixed all of that already :-) So at this stage, I think the reasonably thing to do is to stick to the spinlock, but we can try to make it a bit smarter, and we can definitely attempt to fix the case Amit pointed out where we call resize without a lock while it seems to expect it (though we also need to be careful about re-entrancy I believe). Cheers, Ben. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752120AbZH0J2L (ORCPT ); Thu, 27 Aug 2009 05:28:11 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751946AbZH0J2K (ORCPT ); Thu, 27 Aug 2009 05:28:10 -0400 Received: from gate.crashing.org ([63.228.1.57]:52578 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751898AbZH0J2J (ORCPT ); Thu, 27 Aug 2009 05:28:09 -0400 Subject: Re: Extending virtio_console to support multiple ports From: Benjamin Herrenschmidt To: Alan Cox Cc: Amit Shah , qemu-devel@nongnu.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, borntraeger@de.ibm.com, linux-kernel@vger.kernel.org, miltonm@bga.com, linuxppc-dev@ozlabs.org, brueckner@linux.vnet.ibm.com In-Reply-To: <20090827100809.5f0aa0a7@linux.intel.com> References: <1251181044-3696-1-git-send-email-amit.shah@redhat.com> <20090826112718.GA11117@amit-x200.redhat.com> <20090826154552.GA31910@amit-x200.redhat.com> <1251346023.20467.21.camel@pasglop> <20090827100809.5f0aa0a7@linux.intel.com> Content-Type: text/plain Date: Thu, 27 Aug 2009 19:27:23 +1000 Message-Id: <1251365243.20467.47.camel@pasglop> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2009-08-27 at 10:08 +0100, Alan Cox wrote: > > - Then, are we certain that there's no case where the tty layer will > > call us with some lock held or in an atomic context ? To be honest, > > I've totally lost track of the locking rules in tty land lately so it > > might well be ok, but something to verify. > > Some of the less well behaved line disciplines do this and always have > done. That was also my understanding but heh, I though that maybe you may have fixed all of that already :-) So at this stage, I think the reasonably thing to do is to stick to the spinlock, but we can try to make it a bit smarter, and we can definitely attempt to fix the case Amit pointed out where we call resize without a lock while it seems to expect it (though we also need to be careful about re-entrancy I believe). Cheers, Ben. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MgbGw-0002HG-IX for qemu-devel@nongnu.org; Thu, 27 Aug 2009 05:27:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MgbGr-00027c-Se for qemu-devel@nongnu.org; Thu, 27 Aug 2009 05:27:57 -0400 Received: from [199.232.76.173] (port=50607 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgbGr-00027H-HA for qemu-devel@nongnu.org; Thu, 27 Aug 2009 05:27:53 -0400 Received: from gate.crashing.org ([63.228.1.57]:37017) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MgbGq-0004zi-C7 for qemu-devel@nongnu.org; Thu, 27 Aug 2009 05:27:53 -0400 From: Benjamin Herrenschmidt In-Reply-To: <20090827100809.5f0aa0a7@linux.intel.com> References: <1251181044-3696-1-git-send-email-amit.shah@redhat.com> <20090826112718.GA11117@amit-x200.redhat.com> <20090826154552.GA31910@amit-x200.redhat.com> <1251346023.20467.21.camel@pasglop> <20090827100809.5f0aa0a7@linux.intel.com> Content-Type: text/plain Date: Thu, 27 Aug 2009 19:27:23 +1000 Message-Id: <1251365243.20467.47.camel@pasglop> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: Extending virtio_console to support multiple ports List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alan Cox Cc: kvm@vger.kernel.org, linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org, miltonm@bga.com, qemu-devel@nongnu.org, borntraeger@de.ibm.com, brueckner@linux.vnet.ibm.com, Amit Shah , virtualization@lists.linux-foundation.org On Thu, 2009-08-27 at 10:08 +0100, Alan Cox wrote: > > - Then, are we certain that there's no case where the tty layer will > > call us with some lock held or in an atomic context ? To be honest, > > I've totally lost track of the locking rules in tty land lately so it > > might well be ok, but something to verify. > > Some of the less well behaved line disciplines do this and always have > done. That was also my understanding but heh, I though that maybe you may have fixed all of that already :-) So at this stage, I think the reasonably thing to do is to stick to the spinlock, but we can try to make it a bit smarter, and we can definitely attempt to fix the case Amit pointed out where we call resize without a lock while it seems to expect it (though we also need to be careful about re-entrancy I believe). Cheers, Ben.