From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Daniel P. Berrange" Subject: Re: [Qemu-devel] Re: [PATCH] Fix freezing bug in curses console Date: Sun, 1 Mar 2009 11:36:35 +0000 Message-ID: <20090301113635.GA10538@redhat.com> References: <49A843CA.2050500@us.ibm.com> <49A85541.7040805@codemonkey.ws> <20090228212116.GL20640@shareable.org> Reply-To: "Daniel P. Berrange" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Matthew Bloch , kvm@vger.kernel.org To: qemu-devel@nongnu.org Return-path: Received: from mx1.redhat.com ([66.187.233.31]:47313 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752499AbZCALgm (ORCPT ); Sun, 1 Mar 2009 06:36:42 -0500 Content-Disposition: inline In-Reply-To: <20090228212116.GL20640@shareable.org> Sender: kvm-owner@vger.kernel.org List-ID: On Sat, Feb 28, 2009 at 09:21:16PM +0000, Jamie Lokier wrote: > Anthony Liguori wrote: > > >>It's racy with select(). A better fix would be to create a pipe and write > > >>to that pipe in the SIGWINCH handler. You should then register an io > > >> > > > > > >Maybe a bottom half would work? The scheduling of a bh shouldn't > > >constitute "real work". > > > > I think it still suffers from the same race condition so today it > > wouldn't work. You could fix the bottom half scheduling though so that > > you could safely schedule a bottom half from a signal handler (using > > roughly the same trick). > > Fwiw, it's perfectly sensible to have a single pipe which is shared by > all signal handlers, just used to say "check for work flags set". And if you need the main loop to be able to distinguish signals coming out of the pipe, then just write the signum into the pipe as a byte, instead of a single dummy byte. Or even write the whole 'siginfo_t' struct passed to the signal handler, and read it out in sizeof(siginfo_t) sized chunks for processing. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|