[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/3] Move threadlets infrastructure to qemu-thre
From: |
Arun R Bharadwaj |
Subject: |
Re: [Qemu-devel] [PATCH 2/3] Move threadlets infrastructure to qemu-threadlets.c |
Date: |
Wed, 10 Nov 2010 23:26:20 +0530 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
* Blue Swirl <address@hidden> [2010-11-10 17:29:30]:
> On Wed, Nov 10, 2010 at 1:19 PM, Arun R Bharadwaj
> <address@hidden> wrote:
> > The reason for creating this generic infrastructure is so that other
> > subsystems,
> > such as virtio-9p could make use of it for offloading tasks that could
> > block.
> >
> > Signed-off-by: Arun R Bharadwaj <address@hidden>
> > Signed-off-by: Aneesh Kumar K.V <address@hidden>
> > Signed-off-by: Gautham R Shenoy <address@hidden>
> > Signed-off-by: Sripathi Kodi <address@hidden>
> > ---
> > Makefile.objs | 1
> > docs/async-support.txt | 141 +++++++++++++++++++++++++++++++++++++++
> > posix-aio-compat.c | 173
> > ------------------------------------------------
> > qemu-threadlets.c | 168
> > +++++++++++++++++++++++++++++++++++++++++++++++
> > qemu-threadlets.h | 48 +++++++++++++
> > 5 files changed, 359 insertions(+), 172 deletions(-)
> > create mode 100644 docs/async-support.txt
> > create mode 100644 qemu-threadlets.c
> > create mode 100644 qemu-threadlets.h
> >
> > diff --git a/qemu-threadlets.h b/qemu-threadlets.h
> > new file mode 100644
> > index 0000000..f869304
> > --- /dev/null
> > +++ b/qemu-threadlets.h
> > @@ -0,0 +1,48 @@
> > +/*
> > + * Threadlet support for offloading tasks to be executed asynchronously
> > + *
> > + * Copyright IBM, Corp. 2008
> > + * Copyright IBM, Corp. 2010
> > + *
> > + * Authors:
> > + * Anthony Liguori <address@hidden>
> > + * Aneesh Kumar K.V <address@hidden>
> > + * Gautham R Shenoy <address@hidden>
> > + *
> > + * This work is licensed under the terms of the GNU GPL, version 2. See
> > + * the COPYING file in the top-level directory.
> > + */
> > +
> > +#ifndef QEMU_ASYNC_WORK_H
> > +#define QEMU_ASYNC_WORK_H
> > +
> > +#include "qemu-queue.h"
> > +#include "qemu-common.h"
> > +#include "qemu-thread.h"
> > +
> > +typedef struct ThreadletQueue
> > +{
> > + QemuMutex lock;
> > + QemuCond cond;
> > + int max_threads;
> > + int min_threads;
> > + int cur_threads;
> > + int idle_threads;
> > + QTAILQ_HEAD(, ThreadletWork) request_list;
> > +} ThreadletQueue;
> > +
> > +typedef struct ThreadletWork
> > +{
> > + QTAILQ_ENTRY(ThreadletWork) node;
> > + void (*func)(struct ThreadletWork *work);
> > +} ThreadletWork;
> > +
> > +extern void submit_work_to_queue(ThreadletQueue *queue,
> > + ThreadletWork *work);
> > +extern void submit_work(ThreadletWork *work);
> > +extern int dequeue_work_on_queue(ThreadletQueue *queue,
> > + ThreadletWork *work);
> > +extern int dequeue_work(ThreadletWork *work);
> > +extern void threadlet_queue_init(ThreadletQueue *queue, int max_threads,
> > + int min_threads);
>
> Please remove 'extern' qualifiers, they are useless for function
> declarations. In most cases they are not used in QEMU.
Will change these. Thanks for the review.
-arun
- [Qemu-devel] [PATCH 1/3] Make paio subsystem use threadlets infrastructure, (continued)
[Qemu-devel] [PATCH 2/3] Move threadlets infrastructure to qemu-threadlets.c, Arun R Bharadwaj, 2010/11/10
[Qemu-devel] [PATCH 3/3] Add helper functions to enable virtio-9p make use of the threadlets, Arun R Bharadwaj, 2010/11/10