* Spawning threads in KVM/QEMU
@ 2007-11-13 20:15 Anthony Liguori
[not found] ` <473A05D6.2040003-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Anthony Liguori @ 2007-11-13 20:15 UTC (permalink / raw)
To: kvm-devel; +Cc: Avi Kivity
Hi,
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.
Any clues to what may be going on?
Regards,
Anthony Liguori
-------------------------------------------------------------------------
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/
^ permalink raw reply [flat|nested] 5+ messages in thread[parent not found: <473A05D6.2040003-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>]
* Re: Spawning threads in KVM/QEMU [not found] ` <473A05D6.2040003-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> @ 2007-11-13 22:42 ` Dor Laor [not found] ` <473A283B.5040905-atKUWr5tajBWk0Htik3J/w@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Dor Laor @ 2007-11-13 22:42 UTC (permalink / raw) To: Anthony Liguori; +Cc: kvm-devel, Avi Kivity Anthony Liguori wrote: > Hi, > > 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); pthread_sigmask(SIG_SETMASK, &thread_sig_mask, &curr_sig_mask); if ((r = pthread_create(&thread_tid, NULL, thread_func, &init_data))) { .... } pthread_sigmask(SIG_SETMASK, &curr_sig_mask, NULL); > Any clues to what may be going on? > > Regards, > > Anthony Liguori > > ------------------------------------------------------------------------- > 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/ > _______________________________________________ > kvm-devel mailing list > kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org > https://lists.sourceforge.net/lists/listinfo/kvm-devel > > ------------------------------------------------------------------------- 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/ ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <473A283B.5040905-atKUWr5tajBWk0Htik3J/w@public.gmane.org>]
* Re: Spawning threads in KVM/QEMU [not found] ` <473A283B.5040905-atKUWr5tajBWk0Htik3J/w@public.gmane.org> @ 2007-11-13 23:08 ` Luca Tettamanti [not found] ` <68676e00711131508l4cb1cafajd559ca804d61b3c3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2007-11-14 9:43 ` Avi Kivity 1 sibling, 1 reply; 5+ messages in thread From: Luca Tettamanti @ 2007-11-13 23:08 UTC (permalink / raw) To: Anthony Liguori; +Cc: kvm-devel, Avi Kivity 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 ------------------------------------------------------------------------- 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/ ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <68676e00711131508l4cb1cafajd559ca804d61b3c3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: Spawning threads in KVM/QEMU [not found] ` <68676e00711131508l4cb1cafajd559ca804d61b3c3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2007-11-14 9:37 ` Dor Laor 0 siblings, 0 replies; 5+ messages in thread From: Dor Laor @ 2007-11-14 9:37 UTC (permalink / raw) To: Luca Tettamanti; +Cc: kvm-devel, Avi Kivity [-- Attachment #1.1: Type: text/plain, Size: 1194 bytes --] 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 [-- Attachment #1.2: Type: text/html, Size: 1801 bytes --] [-- Attachment #2: Type: text/plain, Size: 314 bytes --] ------------------------------------------------------------------------- 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/ [-- Attachment #3: Type: text/plain, Size: 186 bytes --] _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Spawning threads in KVM/QEMU [not found] ` <473A283B.5040905-atKUWr5tajBWk0Htik3J/w@public.gmane.org> 2007-11-13 23:08 ` Luca Tettamanti @ 2007-11-14 9:43 ` Avi Kivity 1 sibling, 0 replies; 5+ messages in thread From: Avi Kivity @ 2007-11-14 9:43 UTC (permalink / raw) To: dor.laor-atKUWr5tajBWk0Htik3J/w; +Cc: kvm-devel Dor Laor wrote: > Anthony Liguori wrote: > >> Hi, >> >> 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); > pthread_sigmask(SIG_SETMASK, &thread_sig_mask, &curr_sig_mask); > if ((r = pthread_create(&thread_tid, NULL, thread_func, &init_data))) { > .... > } > pthread_sigmask(SIG_SETMASK, &curr_sig_mask, NULL); > Actually when running with kvm, most signals are blocked while running in userspace. They're only enabled when the guest is running. So no special action should be necessary. For pure qemu, it is necessary of course. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- 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/ ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-11-14 9:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-13 20:15 Spawning threads in KVM/QEMU Anthony Liguori
[not found] ` <473A05D6.2040003-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-11-13 22:42 ` Dor Laor
[not found] ` <473A283B.5040905-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-13 23:08 ` Luca Tettamanti
[not found] ` <68676e00711131508l4cb1cafajd559ca804d61b3c3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-11-14 9:37 ` Dor Laor
2007-11-14 9:43 ` Avi Kivity
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox