From: Stefan Hajnoczi <stefanha@gmail.com>
To: "Venkateswararao Jujjuri (JV)" <jvrao@linux.vnet.ibm.com>
Cc: Arun R Bharadwaj <arun@linux.vnet.ibm.com>,
Harsh Prateek Bora <harsh@linux.vnet.ibm.com>,
qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com,
aliguori@us.ibm.com
Subject: Re: [Qemu-devel] [PATCH 01/25] [virtio-9p] Add infrastructure to support glib threads and coroutines.
Date: Fri, 13 May 2011 06:48:21 +0100 [thread overview]
Message-ID: <BANLkTik8y5S9hBor2HqcfAUG+q=Hmf=LTQ@mail.gmail.com> (raw)
In-Reply-To: <1305233867-4367-2-git-send-email-jvrao@linux.vnet.ibm.com>
On Thu, May 12, 2011 at 9:57 PM, Venkateswararao Jujjuri (JV)
<jvrao@linux.vnet.ibm.com> wrote:
> +/* v9fs glib thread pool */
> +V9fsThPool v9fs_pool;
This should be static and an init function in this file could perform
initialization. Right now the initialization is inlined in
virtio-9p-device.c.
> +void v9fs_qemu_submit_request(V9fsRequest *req)
> +{
> + V9fsThPool *p = &v9fs_pool;
> +
> + req->done = 0;
> + p->requests = g_list_append(p->requests, req);
> + g_thread_pool_push(v9fs_pool.pool, req, NULL);
> +}
> +
> +void v9fs_qemu_process_req_done(void *arg)
> +{
> + struct V9fsThPool *p = &v9fs_pool;
> + char byte;
> + ssize_t len;
> + GList *cur_req, *next_req;
> +
> + do {
> + len = read(p->rfd, &byte, sizeof(byte));
> + } while (len == -1 && errno == EINTR);
> +
> + for (cur_req = p->requests; cur_req != NULL; cur_req = next_req) {
> + V9fsRequest *req = cur_req->data;
> + next_req = g_list_next(cur_req);
> +
> + if (!req->done) {
> + continue;
> + }
The requests list is only used for completion, why not enqueue only
completed requests and get rid of the done field. Then this function
doesn't have to skip over in-flight requests.
> + Coroutine *entry = req->coroutine;
> + qemu_coroutine_enter(entry, NULL);
> +
> + p->requests = g_list_delete_link(p->requests, cur_req);
Does this actually free the req?
> +static int notifier_fds[2];
Why global?
> + if (!g_thread_supported()) {
> + g_thread_init(NULL);
> + }
The logic looks inverted. But if GThread isn't supported where in big
trouble so we should probably exit?
Stefan
next prev parent reply other threads:[~2011-05-13 5:48 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-12 20:57 [Qemu-devel] [0/25] Async threading for VirtFS using glib threads & coroutines Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 01/25] [virtio-9p] Add infrastructure to support glib threads and coroutines Venkateswararao Jujjuri (JV)
2011-05-13 5:48 ` Stefan Hajnoczi [this message]
2011-05-13 15:47 ` Venkateswararao Jujjuri
2011-05-13 15:49 ` Stefan Hajnoczi
2011-05-12 20:57 ` [Qemu-devel] [PATCH 02/25] [virtio-9p] Change all pdu handlers to coroutines Venkateswararao Jujjuri (JV)
2011-05-13 6:19 ` Stefan Hajnoczi
2011-05-12 20:57 ` [Qemu-devel] [PATCH 03/25] [virtio-9p] Remove post functions for v9fs_readlink Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 04/25] [virtio-9p] clean up v9fs_readlink Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 05/25] [virtio-9p] Move errno into v9fs_do_readlink Venkateswararao Jujjuri (JV)
2011-05-13 8:56 ` Stefan Hajnoczi
2011-05-12 20:57 ` [Qemu-devel] [PATCH 06/25] [virtio-9p] coroutines for readlink Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 07/25] [virtio-9p] Remove post functions for v9fs_mkdir Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 08/25] [virtio-9p] clean up v9fs_mkdir Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 09/25] hw/9pfs: Add yield support for readdir related coroutines Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 10/25] hw/9pfs: Update v9fs_readdir to use coroutines Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 11/25] hw/9pfs: Add yield support to statfs coroutine Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 12/25] hw/9pfs: Update v9fs_statfs to use coroutines Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 13/25] hw/9pfs: Add yield support to lstat coroutine Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 14/25] hw/9pfs: Update v9fs_getattr to use coroutines Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 15/25] hw/9pfs: Add yield support to setattr related coroutines Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 16/25] hw/9pfs: Update v9fs_setattr to use coroutines Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 17/25] hw/9pfs: Add yield support to xattr related coroutine Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 18/25] hw/9pfs: Update v9fs_xattrwalk to coroutines Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 19/25] hw/9pfs: Update v9fs_xattrcreate to use coroutines Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 20/25] hw/9pfs: Add yield support to mknod coroutine Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 21/25] hw/9pfs: Update v9fs_mknod to use coroutines Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 22/25] [virtio-9p] coroutine and threading for mkdir Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 23/25] [virtio-9p] Remove post functions for v9fs_remove Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 24/25] [virtio-9p] clean up v9fs_remove Venkateswararao Jujjuri (JV)
2011-05-12 20:57 ` [Qemu-devel] [PATCH 25/25] [virtio-9p] coroutine and threading for remove/unlink Venkateswararao Jujjuri (JV)
2011-05-13 8:55 ` [Qemu-devel] [0/25] Async threading for VirtFS using glib threads & coroutines Stefan Hajnoczi
2011-05-13 16:52 ` Anthony Liguori
2011-05-13 19:26 ` Aneesh Kumar K.V
2011-05-14 0:18 ` Venkateswararao Jujjuri
2011-05-14 1:29 ` Venkateswararao Jujjuri
2011-05-14 6:33 ` Stefan Hajnoczi
2011-05-24 21:00 ` Jamie Lokier
2011-05-25 7:16 ` Stefan Hajnoczi
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='BANLkTik8y5S9hBor2HqcfAUG+q=Hmf=LTQ@mail.gmail.com' \
--to=stefanha@gmail.com \
--cc=aliguori@us.ibm.com \
--cc=arun@linux.vnet.ibm.com \
--cc=harsh@linux.vnet.ibm.com \
--cc=jvrao@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@linux.vnet.ibm.com \
/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).