qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: "Venkateswararao Jujjuri (JV)" <jvrao@linux.vnet.ibm.com>
Cc: kwolf@redhat.com, arun@linux.vnet.ibm.com, qemu-devel@nongnu.org,
	aneesh.kumar@linux.vnet.ibm.com, aliguori@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH 08/12] Threadlet: Add aio_signal_handler threadlet API
Date: Wed, 19 Jan 2011 07:54:34 +0000	[thread overview]
Message-ID: <AANLkTim5Vm+MQOHa6HeVnxzgp+LnCurBncOdKB6foH6b@mail.gmail.com> (raw)
In-Reply-To: <4D35D790.5020708@linux.vnet.ibm.com>

On Tue, Jan 18, 2011 at 6:10 PM, Venkateswararao Jujjuri (JV)
<jvrao@linux.vnet.ibm.com> wrote:
> On 1/17/2011 11:14 PM, Stefan Hajnoczi wrote:
>> On Tue, Jan 18, 2011 at 6:46 AM, Arun R Bharadwaj
>> <arun@linux.vnet.ibm.com> wrote:
>>> * Stefan Hajnoczi <stefanha@gmail.com> [2011-01-18 06:31:34]:
>>>
>>>> On Tue, Jan 18, 2011 at 4:43 AM, Arun R Bharadwaj
>>>> <arun@linux.vnet.ibm.com> wrote:
>>>>> * Stefan Hajnoczi <stefanha@gmail.com> [2011-01-17 09:56:58]:
>>>>>
>>>>>> On Thu, Jan 13, 2011 at 12:14 PM, Arun R Bharadwaj
>>>>>> <arun@linux.vnet.ibm.com> wrote:
>>>>>>> +static void threadlet_io_completion_signal_handler(int signum)
>>>>>>> +{
>>>>>>> +    qemu_service_io();
>>>>>>> +}
>>>>>>> +
>>>>>>> +static void threadlet_register_signal_handler(void)
>>>>>>> +{
>>>>>>> +    struct sigaction act;
>>>>>>> +    sigfillset(&act.sa_mask);
>>>>>>> +    act.sa_flags = 0; /* do not restart syscalls to interrupt select() */
>>>>>>> +    act.sa_handler = threadlet_io_completion_signal_handler;
>>>>>>> +    sigaction(SIGUSR2, &act, NULL);
>>>>>>> +}
>>>>>>> +
>>>>>>> +void threadlet_init(void)
>>>>>>> +{
>>>>>>> +    threadlet_register_signal_handler();
>>>>>>> +}
>>>>>>
>>>>>> This would be the right place to create qemu-threadlet.c, instead of
>>>>>> adding the thread_init() prototype to qemu-thread.h and then including
>>>>>> that in vl.c.
>>>>>>
>>>>>> Stefan
>>>>>
>>>>> I did not follow your comment here. How can we avoid including
>>>>> threadler_init() in vl.c?
>>>>
>>>> Instead of adding threadlet_init() and related functions to
>>>> posix-aio-compat.c and adding the prototype to qemu-thread.h, why not
>>>> just create qemu-threadlet.c/qemu-threadlet.h and put these functions
>>>> there instead?
>>>>
>>>> Stefan
>>>
>>> Got it. So you mean I merge patch 8 and patch 10 into a single patch.
>>> But wouldn't this mean we are moving code and adding new API in the
>>> same patch? Anthony did not want this from what I recall. But I can do
>>> it if you feel it makes things simple.
>>
>> I don't think you need to merge the patches.  It's odd to add
>> functions to posix-aio-compat.c but put the prototype in qemu-thread.h
>> (and then include and call from vl.c).  So for these three functions
>> (threadlet_init, threadlet_register_signal_handler, and
>> threadlet_io_completion_signal_handler) only I think it makes sense to
>> move them to qemu-threadlet.[ch] straight away.
>
> So basically create the new file qemu-threadlet.[ch] with only these functions
> and move the rest of the code in patch 10(as we do now).

Exactly.

Stefan

  reply	other threads:[~2011-01-19  7:54 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-13 12:14 [Qemu-devel] [PATCH 00/12] Threadlets Infrastructure Arun R Bharadwaj
2011-01-13 12:14 ` [Qemu-devel] [PATCH 01/12] Add aiocb_mutex and aiocb_completion Arun R Bharadwaj
2011-01-13 12:14 ` [Qemu-devel] [PATCH 02/12] Introduce work concept in posix-aio-compat.c Arun R Bharadwaj
2011-01-13 12:14 ` [Qemu-devel] [PATCH 03/12] Add callback function to ThreadletWork structure Arun R Bharadwaj
2011-01-13 12:14 ` [Qemu-devel] [PATCH 04/12] Add ThreadletQueue Arun R Bharadwaj
2011-01-13 12:14 ` [Qemu-devel] [PATCH 05/12] Threadlet: Add submit_work threadlet API Arun R Bharadwaj
2011-01-13 12:14 ` [Qemu-devel] [PATCH 06/12] Threadlet: Add dequeue_work threadlet API and remove active field Arun R Bharadwaj
2011-01-13 12:14 ` [Qemu-devel] [PATCH 07/12] Remove thread_create routine Arun R Bharadwaj
2011-01-13 12:14 ` [Qemu-devel] [PATCH 08/12] Threadlet: Add aio_signal_handler threadlet API Arun R Bharadwaj
2011-01-17  9:56   ` Stefan Hajnoczi
2011-01-17 15:54     ` [Qemu-devel] " Paolo Bonzini
2011-01-17 17:38       ` Stefan Hajnoczi
2011-01-18  4:43     ` [Qemu-devel] " Arun R Bharadwaj
2011-01-18  6:31       ` Stefan Hajnoczi
2011-01-18  6:46         ` Arun R Bharadwaj
2011-01-18  7:14           ` Stefan Hajnoczi
2011-01-18 18:10             ` Venkateswararao Jujjuri (JV)
2011-01-19  7:54               ` Stefan Hajnoczi [this message]
2011-01-13 12:15 ` [Qemu-devel] [PATCH 09/12] Remove all instances of CONFIG_THREAD Arun R Bharadwaj
2011-01-13 12:15 ` [Qemu-devel] [PATCH 10/12] Move threadlet code to qemu-threadlets.c Arun R Bharadwaj
2011-01-17  9:57   ` Stefan Hajnoczi
2011-01-18  4:37     ` Arun R Bharadwaj
2011-01-13 12:15 ` [Qemu-devel] [PATCH 11/12] Threadlets: Add functionality to create private queues Arun R Bharadwaj
2011-01-13 12:15 ` [Qemu-devel] [PATCH 12/12] Threadlets: Add documentation Arun R Bharadwaj
2011-01-17 10:32 ` [Qemu-devel] [PATCH 00/12] Threadlets Infrastructure Stefan Hajnoczi
2011-01-18  4:38   ` Arun R Bharadwaj
  -- strict thread matches above, loose matches on Subject: below --
2011-01-20 12:33 [Qemu-devel] [PATCH 00/12] Threadlet Infrastructure Arun R Bharadwaj
2011-01-20 12:34 ` [Qemu-devel] [PATCH 08/12] Threadlet: Add aio_signal_handler threadlet API Arun R Bharadwaj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTim5Vm+MQOHa6HeVnxzgp+LnCurBncOdKB6foH6b@mail.gmail.com \
    --to=stefanha@gmail.com \
    --cc=aliguori@linux.vnet.ibm.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=arun@linux.vnet.ibm.com \
    --cc=jvrao@linux.vnet.ibm.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).