From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dor Laor Subject: Re: Spawning threads in KVM/QEMU Date: Wed, 14 Nov 2007 11:37:58 +0200 Message-ID: <473AC1F6.7030007@qumranet.com> References: <473A05D6.2040003@us.ibm.com> <473A283B.5040905@qumranet.com> <68676e00711131508l4cb1cafajd559ca804d61b3c3@mail.gmail.com> Reply-To: dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1572481129==" Cc: kvm-devel , Avi Kivity To: Luca Tettamanti Return-path: In-Reply-To: <68676e00711131508l4cb1cafajd559ca804d61b3c3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org This is a multi-part message in MIME format. --===============1572481129== Content-Type: multipart/alternative; boundary="------------060004080407030102030807" This is a multi-part message in MIME format. --------------060004080407030102030807 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Luca Tettamanti wrote: > On Nov 13, 2007 11:42 PM, Dor Laor wrote: > >> Anthony Liguori wrote: >> >>> I've been experimenting with creating IO threads for the PV device >>> drivers. Unfortunately, my experiments haven't gotten very far as QEMU >>> tends to hang up a bit into booting the guest whenever I spawn a thread >>> that does any sort of read/write on a file descriptor. My suspicion is >>> that it has something to do with signals being delivered to the wrong >>> thread but after masking out all the signals for this thread, I still >>> had no luck. >>> >>> >> Maybe you set the mask too late? try setting it before creating the thread: >> sigfillset(&thread_sig_mask); >> sigdelset(&thread_sig_mask,SIGILL); >> sigdelset(&thread_sig_mask,SIGFPE); >> sigdelset(&thread_sig_mask,SIGSEGV); >> > > When using RTC or HPET for timing you also need to mask SIGIO; you may > also need to change F_SETOWN (enable_sigio_timer) with the correct > thread id, i.e.: > > fcntl(fd, F_SETOWN, gettid()); > > Luca > > I do mask SIGIO - first the set is fiilled, then SGILL,SIGFPE,SIGSEGV are back enabled. Regards, Dor --------------060004080407030102030807 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Luca Tettamanti wrote:
On Nov 13, 2007 11:42 PM, Dor Laor <dor.laor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
  
Anthony Liguori wrote:
    
I've been experimenting with creating IO threads for the PV device
drivers.  Unfortunately, my experiments haven't gotten very far as QEMU
tends to hang up a bit into booting the guest whenever I spawn a thread
that does any sort of read/write on a file descriptor.  My suspicion is
that it has something to do with signals being delivered to the wrong
thread but after masking out all the signals for this thread, I still
had no luck.

      
Maybe you set the mask too late? try setting it before creating the thread:
 sigfillset(&thread_sig_mask);
 sigdelset(&thread_sig_mask,SIGILL);
 sigdelset(&thread_sig_mask,SIGFPE);
 sigdelset(&thread_sig_mask,SIGSEGV);
    

When using RTC or HPET for timing you also need to mask SIGIO; you may
also need to change F_SETOWN (enable_sigio_timer) with the correct
thread id, i.e.:

fcntl(fd, F_SETOWN, gettid());

Luca

  
I do mask SIGIO - first the set is fiilled, then SGILL,SIGFPE,SIGSEGV are back enabled.
Regards, Dor
--------------060004080407030102030807-- --===============1572481129== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ --===============1572481129== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --===============1572481129==--