[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] - Finer-grained asynchronous dispatch in parallax daemon.



ChangeSet 1.1473.1.1, 2005/05/20 15:49:37+01:00, akw27@xxxxxxxxxxxxxxxxxxxxxx

        - Finer-grained asynchronous dispatch in parallax daemon.
        - Cleanups and cull of older code.
        - Fixes to handle changes in block protocol.
        
        Signed-off-by: andrew.warfield@xxxxxxxxxxxx



 b/tools/blktap/Makefile            |   51 --
 b/tools/blktap/blkdump.c           |   12 
 b/tools/blktap/block-async.c       |  404 +++++++++++++++++++++++
 b/tools/blktap/block-async.h       |   69 +++
 b/tools/blktap/blockstore.c        |    7 
 b/tools/blktap/parallax-threaded.c |   34 -
 b/tools/blktap/parallax.c          |  275 ++++++++++-----
 b/tools/blktap/radix.c             |  417 -----------------------
 b/tools/blktap/radix.h             |   10 
 b/tools/blktap/requests-async.c    |  629 +++++++++++++++++++++++++++++++++++
 b/tools/blktap/requests-async.h    |   19 +
 b/tools/blktap/vdi.c               |   25 +
 b/tools/blktap/vdi.h               |   10 
 tools/blktap/blkaio.c              |   19 -
 tools/blktap/blkaiolib.c           |  489 ---------------------------
 tools/blktap/blkaiolib.h           |   16 
 tools/blktap/blkcow.c              |   31 -
 tools/blktap/blkcowgnbd.c          |   24 -
 tools/blktap/blkcowimg.c           |   24 -
 tools/blktap/blkcowlib.c           |  380 ---------------------
 tools/blktap/blkcowlib.h           |   14 
 tools/blktap/blkgnbd.c             |   19 -
 tools/blktap/blkgnbdlib.c          |  471 --------------------------
 tools/blktap/blkgnbdlib.h          |   16 
 tools/blktap/blkimg.c              |   19 -
 tools/blktap/blkimglib.c           |  325 ------------------
 tools/blktap/blkimglib.h           |   16 
 tools/blktap/blockstore-tls.c      |  161 ---------
 tools/blktap/libgnbd/Makefile      |    8 
 tools/blktap/libgnbd/gnbdtest.c    |   90 -----
 tools/blktap/libgnbd/libgnbd.c     |  647 -------------------------------------
 tools/blktap/libgnbd/libgnbd.h     |   25 -
 32 files changed, 1371 insertions(+), 3385 deletions(-)


diff -Nru a/tools/blktap/Makefile b/tools/blktap/Makefile
--- a/tools/blktap/Makefile     2005-05-20 12:02:03 -04:00
+++ b/tools/blktap/Makefile     2005-05-20 12:02:03 -04:00
@@ -22,12 +22,12 @@
 PLX_SRCS += vdi.c 
 PLX_SRCS += radix.c 
 PLX_SRCS += snaplog.c
+PLX_SRCS += blockstore.c 
+PLX_SRCS += block-async.c
 PLXT_SRCS := $(PLX_SRCS)
-#PLXT_SRCS += blockstore-tls.c
-PLXT_SRCS += blockstore.c
 PLXT_SRCS += parallax-threaded.c
-PLX_SRCS += blockstore.c 
 VDI_SRCS := $(PLX_SRCS)
+PLX_SRCS += requests-async.c
 PLX_SRCS += parallax.c
 
 VDI_TOOLS :=
@@ -55,10 +55,11 @@
 DEPS     = .*.d
 
 OBJS     = $(patsubst %.c,%.o,$(SRCS))
+IBINS    = blkdump parallax $(VDI_TOOLS)
 
 LIB      = libblktap.so libblktap.so.$(MAJOR) libblktap.so.$(MAJOR).$(MINOR)
 
-all: mk-symlinks blkdump blkcow blkimg blkcowimg blkgnbd blkcowgnbd 
$(VDI_TOOLS) parallax parallax-threaded blockstored
+all: mk-symlinks blkdump $(VDI_TOOLS) parallax parallax-threaded blockstored
        $(MAKE) $(LIB)
 
 LINUX_ROOT := $(wildcard $(XEN_ROOT)/linux-2.6.*-xen-sparse)
@@ -77,10 +78,10 @@
        $(INSTALL_DIR) -p $(DESTDIR)/usr/include
        $(INSTALL_PROG) $(LIB) $(DESTDIR)/usr/$(LIBDIR)
        $(INSTALL_PROG) blktaplib.h $(DESTDIR)/usr/include
-       $(INSTALL_PROG) blkdump blkcow blkimg blkcowimg blkgnbd blkcowgnbd 
$(DESTDIR)/$(BLKTAP_INSTALL_DIR)
+       $(INSTALL_PROG) $(IBINS) $(DESTDIR)/$(BLKTAP_INSTALL_DIR)
 
 clean:
-       rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen TAGS blkdump blkcow 
blkimg blkcowimg blkgnbd blkcowgnbd blkaio $(VDI_TOOLS) parallax
+       rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen TAGS blkdump 
$(VDI_TOOLS) parallax parallax-threaded
 
 rpm: all
        rm -rf staging
@@ -101,32 +102,11 @@
 blkdump: $(LIB)
        $(CC) $(CFLAGS) -o blkdump -L$(XEN_LIBXC) -L$(XEN_LIBXUTIL) -L. -l 
blktap blkdump.c
 
-blkcowimg: $(LIB) blkcowimg.c blkcowlib.c blkimglib.c 
-       $(CC) $(CFLAGS) -o blkcowimg -ldb -L$(XEN_LIBXC) -L$(XEN_LIBXUTIL) -L. 
-l blktap blkcowimg.c blkimglib.c blkcowlib.c
-
-blkcow: $(LIB) blkcow.c blkcowlib.c
-       $(CC) $(CFLAGS) -o blkcow -ldb -L$(XEN_LIBXC) -L$(XEN_LIBXUTIL) -L. -l 
blktap blkcow.c blkcowlib.c
-
-blkimg: $(LIB) blkimg.c blkimglib.c
-       $(CC) $(CFLAGS) -o blkimg  -L$(XEN_LIBXC) -L$(XEN_LIBXUTIL) -L. -l 
blktap blkimg.c blkimglib.c
-
-blkgnbd: $(LIB) blkgnbd.c blkgnbdlib.c
-       $(CC) $(CFLAGS) -o blkgnbd -L$(XEN_LIBXC) -L$(XEN_LIBXUTIL) -L. 
-lblktap blkgnbd.c blkgnbdlib.c libgnbd/libgnbd.a
-
-blkcowgnbd: $(LIB) blkgnbd.c blkcowlib.c blkgnbdlib.c
-       $(CC) $(CFLAGS) -o blkcowgnbd -ldb -L$(XEN_LIBXC) -L$(XEN_LIBXUTIL) -L. 
-lblktap blkcowgnbd.c blkgnbdlib.c blkcowlib.c libgnbd/libgnbd.a
-
-blkaio: $(LIB) blkaio.c blkaiolib.c
-       $(CC) $(CFLAGS) -o blkaio -L$(XEN_LIBXC) -L$(XEN_LIBXUTIL) -L. -lblktap 
blkaio.c blkaiolib.c -laio -lpthread
-
 parallax: $(LIB) $(PLX_SRCS)
-       $(CC) $(CFLAGS) -o parallax -L$(XEN_LIBXC) -L$(XEN_LIBXUTIL) -L. 
-lblktap -lpthread $(PLX_SRCS) libgnbd/libgnbd.a
+       $(CC) $(CFLAGS) -o parallax -L$(XEN_LIBXC) -L$(XEN_LIBXUTIL) -L. 
-lblktap -lpthread $(PLX_SRCS) 
 
 parallax-threaded: $(LIB) $(PLXT_SRCS)
-       $(CC) $(CFLAGS) -o parallax-threaded -L$(XEN_LIBXC) -L$(XEN_LIBXUTIL) 
-L. -lpthread -lblktap $(PLXT_SRCS) libgnbd/libgnbd.a
-
-vdi_test: $(LIB) $(VDI_SRCS)
-       $(CC) $(CFLAGS) -g3 -o vdi_test -DVDI_STANDALONE -lpthread $(VDI_SRCS)
+       $(CC) $(CFLAGS) -o parallax-threaded -L$(XEN_LIBXC) -L$(XEN_LIBXUTIL) 
-L. -lpthread -lblktap $(PLXT_SRCS)
 
 vdi_list: $(LIB) vdi_list.c $(VDI_SRCS)
        $(CC) $(CFLAGS) -g3 -o vdi_list vdi_list.c -lpthread $(VDI_SRCS)
@@ -163,16 +143,3 @@
 
 -include $(DEPS)
 
-#Random testing targets.  To be removed eventually.
-
-rdx_cmp: $(LIB) rdx_cmp.c $(VDI_SRCS)
-       $(CC) $(CFLAGS) -g3 -o rdx_cmp rdx_cmp.c $(VDI_SRCS)
-
-bb-tls: $(LIB) blockstore-benchmark.c
-       $(CC) $(CFLAGS) -o bb-tls blockstore-benchmark.c blockstore-tls.c 
-lpthread
-
-bb-trans: $(LIB) blockstore-benchmark.c
-       $(CC) $(CFLAGS) -o bb-trans blockstore-benchmark.c blockstore.c 
-lpthread
-
-radix-test: $(LIB) radix.c blockstore.c
-       $(CC) $(CFLAGS) -g3 -D RADIX_STANDALONE -o radix-test radix.c 
blockstore-threaded-trans.c
diff -Nru a/tools/blktap/blkaio.c b/tools/blktap/blkaio.c
--- a/tools/blktap/blkaio.c     2005-05-20 12:02:03 -04:00
+++ /dev/null   Wed Dec 31 16:00:00 196900
@@ -1,19 +0,0 @@
-/* blkaio.c
- *
- * libaio-backed disk.
- */
-
-#include "blktaplib.h"
-#include "blkaiolib.h"
-
-
-int main(int argc, char *argv[])
-{
-    aio_init();
-    
-    blktap_register_ctrl_hook("aio_control", aio_control);
-    blktap_register_request_hook("aio_request", aio_request);
-    blktap_listen();
-    
-    return 0;
-}
diff -Nru a/tools/blktap/blkaiolib.c b/tools/blktap/blkaiolib.c
--- a/tools/blktap/blkaiolib.c  2005-05-20 12:02:03 -04:00
+++ /dev/null   Wed Dec 31 16:00:00 196900
@@ -1,489 +0,0 @@
-/* blkaiolib.c
- *
- * file/device image-backed block device -- using linux libaio.
- * 
- * (c) 2004 Andrew Warfield.
- *
- * Xend has been modified to use an amorfs:[fsid] disk tag.
- * This will show up as device type (maj:240,min:0) = 61440.
- *
- * The fsid is placed in the sec_start field of the disk extent.
- *
- * NOTE: This doesn't work.  Grrr.
- */
-
-#define _GNU_SOURCE
-#define __USE_LARGEFILE64
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <string.h>
-#include <db.h>       
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/poll.h>
-#include <unistd.h>
-#include <errno.h>
-#include <libaio.h>
-#include <pthread.h>
-#include <time.h>
-#include "blktaplib.h"
-
-//#define TMP_IMAGE_FILE_NAME "/dev/sda1"
-#define TMP_IMAGE_FILE_NAME "fc3.image"
-
-#define MAX_DOMS              1024
-#define MAX_IMGNAME_LEN        255
-#define AMORFS_DEV           61440
-#define MAX_REQUESTS            64 /* must be synced with the blkif drivers. */
-#define MAX_SEGMENTS_PER_REQ    11
-#define SECTOR_SHIFT             9
-#define MAX_AIO_REQS   (MAX_REQUESTS * MAX_SEGMENTS_PER_REQ)
-                                                                               
 
-#if 1
-#define DPRINTF(_f, _a...) printf ( _f , ## _a )
-#else
-#define DPRINTF(_f, _a...) ((void)0)
-#endif
-           
-#if 1                                                                        
-#define ASSERT(_p) \
-    if ( !(_p) ) { printf("Assertion '%s' failed, line %d, file %s", #_p , \
-    __LINE__, __FILE__); *(int*)0=0; }
-#else
-#define ASSERT(_p) ((void)0)
-#endif                                                                     
-
-char dbg_page[4096];
-
-typedef struct {
-    /* These need to turn into an array/rbtree for multi-disk support. */
-    int  fd;
-    u64  fsid;
-    char imgname[MAX_IMGNAME_LEN];
-    blkif_vdev_t   vdevice;
-} image_t;
-
-/* Note on pending_reqs: I assume all reqs are queued before they start to 
- * get filled.  so count of 0 is an unused record.
- */
-typedef struct {
-    blkif_request_t  req;
-    int              count;
-} pending_req_t;
-
-static pending_req_t    pending_list[MAX_REQUESTS];
-image_t                *images[MAX_DOMS];
-
-static io_context_t  ctx;
-static struct iocb  *iocb_free[MAX_AIO_REQS];
-static int           iocb_free_count;
-
-/* ---[ Notification mecahnism ]--------------------------------------- */
-
-enum { 
-    READ   = 0,
-    WRITE  = 1
-};
-
-static int aio_notify[2];
-static volatile int aio_listening = 0;
-
-static struct io_event aio_events[MAX_AIO_REQS];
-static int             aio_event_count = 0;
-
-/* this is commented out in libaio.h for some reason. */
-extern int io_queue_wait(io_context_t ctx, struct timespec *timeout);
-
-static void *notifier_thread(void *arg)
-{
-    int ret; 
-    int msg = 0x00feeb00;
-    
-    printf("Notifier thread started.\n");
-    for (;;) {
-        //if ((aio_listening) && ((ret = io_queue_wait(ctx, 0)) == 0)) {
-        if ((aio_listening) && 
-           ((ret = io_getevents(ctx, 1, MAX_AIO_REQS, aio_events, 0)) > 0)) {
-            aio_event_count = ret;
-            printf("[Notifying! (%d)]\n", aio_event_count);
-            aio_listening = 0;
-            write(aio_notify[WRITE], &msg, sizeof(msg));
-            fsync(aio_notify[WRITE]);
-        } else {
-            if (aio_listening)
-                printf("[io_queue_wait error! %d]\n", errno);
-            usleep(1000); /* Not ready to read. */
-        }
-    }
-}
-
-/* -------------------------------------------------------------------- */
-
-int aio_control(control_msg_t *msg)
-{
-    domid_t  domid;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.