From 06572b3dd808c87618ec088115828236043ea618 Mon Sep 17 00:00:00 2001 From: braam Date: Mon, 25 Feb 2002 07:43:46 +0000 Subject: [PATCH] - minor debugging fixes - write event BEFORE calling callback --- lustre/lib/page.c | 5 +++- lustre/mds/handler.c | 3 +- lustre/obdclass/class_obd.c | 8 ++--- lustre/ost/ost_handler.c | 6 ++-- lustre/patches/patch-2.4.17 | 72 +++++++++++++-------------------------------- lustre/ptlrpc/rpc.c | 21 +++++-------- lustre/tests/llmount.sh | 2 +- 7 files changed, 42 insertions(+), 75 deletions(-) diff --git a/lustre/lib/page.c b/lustre/lib/page.c index ed38895..8d11b58 100644 --- a/lustre/lib/page.c +++ b/lustre/lib/page.c @@ -112,8 +112,11 @@ void lustre_prepare_page(unsigned from, unsigned to, struct page *page) lock_page(page); err = page->mapping->a_ops->prepare_write(NULL, page, from, to); - if (err) + if (err) { + CERROR("page index %ld from %d to %d err %d\n", + page->index, from, to, err); BUG(); + } } diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index cd83e69..cbb4290 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -457,7 +457,7 @@ int mds_main(void *arg) wake_up(&mds->mds_done_waitq); interruptible_sleep_on(&mds->mds_waitq); - + barrier(); CDEBUG(D_INODE, "lustre_mds wakes\n"); CDEBUG(D_INODE, "pick up req here and continue\n"); @@ -587,6 +587,7 @@ static int mds_setup(struct obd_device *obddev, obd_count len, if (mds->mds_service == NULL) return -ENOMEM; mds->mds_service->srv_buf_size = 64 * 1024; + //mds->mds_service->srv_buf_size = 1024; mds->mds_service->srv_portal = MDS_REQUEST_PORTAL; memcpy(&mds->mds_service->srv_self, &peer, sizeof(peer)); mds->mds_service->srv_wait_queue = &mds->mds_waitq; diff --git a/lustre/obdclass/class_obd.c b/lustre/obdclass/class_obd.c index e723a5f..2c3a10f 100644 --- a/lustre/obdclass/class_obd.c +++ b/lustre/obdclass/class_obd.c @@ -117,10 +117,10 @@ static struct obd_type *obd_nm_to_type(char *nm) #ifdef CONFIG_KMOD if ( !type ) { if ( !request_module(nm) ) { - CDEBUG(D_PSDEV, "Loaded module '%s'\n", nm); + CDEBUG(D_INFO, "Loaded module '%s'\n", nm); type = obd_search_type(nm); } else { - CDEBUG(D_PSDEV, "Can't load module '%s'\n", nm); + CDEBUG(D_INFO, "Can't load module '%s'\n", nm); } } #endif @@ -652,10 +652,10 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp, #ifdef CONFIG_KMOD if ( !type ) { if ( !request_module(nm) ) { - CDEBUG(D_PSDEV, "Loaded module '%s'\n", nm); + CDEBUG(D_INFO, "Loaded module '%s'\n", nm); type = obd_nm_to_type(nm); } else { - CDEBUG(D_PSDEV, "Can't load module '%s'\n", nm); + CDEBUG(D_INFO, "Can't load module '%s'\n", nm); } } #endif diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index cc41e31..6b8f813 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -499,7 +499,7 @@ int ost_main(void *arg) wake_up(&ost->ost_done_waitq); interruptible_sleep_on(&ost->ost_waitq); - + barrier(); CDEBUG(D_INODE, "lustre_ost wakes\n"); CDEBUG(D_INODE, "pick up req here and continue\n"); @@ -507,13 +507,15 @@ int ost_main(void *arg) if (ost->ost_service != NULL) { ptl_event_t ev; + CDEBUG(D_INODE, "\n"); while (1) { struct ptlrpc_request request; struct ptlrpc_service *service; - + CDEBUG(D_INODE, "\n"); rc = PtlEQGet(ost->ost_service->srv_eq_h, &ev); if (rc != PTL_OK && rc != PTL_EQ_DROPPED) break; + CDEBUG(D_INODE, "\n"); service = (struct ptlrpc_service *)ev.mem_desc.user_ptr; diff --git a/lustre/patches/patch-2.4.17 b/lustre/patches/patch-2.4.17 index 6b2fdad..70728d0 100644 --- a/lustre/patches/patch-2.4.17 +++ b/lustre/patches/patch-2.4.17 @@ -1,58 +1,26 @@ -diff -u -r linux-2.4.17-stock/include/linux/fs.h linux-2.4.17/include/linux/fs.h ---- linux-2.4.17-stock/include/linux/fs.h Fri Dec 21 09:42:03 2001 -+++ linux-2.4.17/include/linux/fs.h Wed Feb 20 13:39:51 2002 -@@ -984,6 +984,7 @@ +--- linux-2.4.17/kernel/ksyms.c.lustre Fri Feb 22 15:26:38 2002 ++++ linux-2.4.17/kernel/ksyms.c Fri Feb 22 15:27:44 2002 +@@ -282,6 +282,12 @@ + EXPORT_SYMBOL(lock_may_write); + EXPORT_SYMBOL(dcache_readdir); + ++/* lustre */ ++EXPORT_SYMBOL(pagecache_lock); ++EXPORT_SYMBOL(do_kern_mount); ++EXPORT_SYMBOL(module_list); ++ ++ + /* for stackable file systems (lofs, wrapfs, cryptfs, etc.) */ + EXPORT_SYMBOL(default_llseek); + EXPORT_SYMBOL(dentry_open); +--- linux-2.4.17/include/linux/fs.h.lustre Fri Feb 22 15:27:53 2002 ++++ linux-2.4.17/include/linux/fs.h Fri Feb 22 15:28:52 2002 +@@ -983,7 +983,7 @@ + extern struct vfsmount *kern_mount(struct file_system_type *); extern int may_umount(struct vfsmount *); extern long do_mount(char *, char *, char *, unsigned long, void *); - +- +struct vfsmount *do_kern_mount(char *type, int flags, char *name, void *data); #define kern_umount mntput extern int vfs_statfs(struct super_block *, struct statfs *); -@@ -1042,6 +1045,6 @@ - return __get_lease(inode, mode); - return 0; - } - - /* fs/open.c */ - ---- linux-2.4.17-stock/kernel/ksyms.c Fri Dec 21 09:42:04 2001 -+++ linux-2.4.17/kernel/ksyms.c Wed Feb 20 12:57:32 2002 -@@ -280,7 +290,11 @@ - EXPORT_SYMBOL(lock_page); - EXPORT_SYMBOL(unlock_page); - -+/* Lustre symbols */ -+EXPORT_SYMBOL(pagecache_lock); -+EXPORT_SYMBOL(do_kern_mount); -+EXPORT_SYMBOL(module_list); - - /* device registration */ - EXPORT_SYMBOL(register_chrdev); - EXPORT_SYMBOL(unregister_chrdev); ---- linux-2.4.17-stock/mm/filemap.c Fri Dec 21 09:42:04 2001 -+++ linux-2.4.17/mm/filemap.c Wed Feb 20 15:18:17 2002 -@@ -2862,8 +2880,10 @@ - if ((ssize_t) count < 0) - return -EINVAL; - -+#if 0 - if (!access_ok(VERIFY_READ, buf, count)) - return -EFAULT; -+#endif - - cached_page = NULL; - -@@ -2987,10 +3007,12 @@ - * same page as we're writing to, without it being marked - * up-to-date. - */ -+#if 0 - { volatile unsigned char dummy; - __get_user(dummy, buf); - __get_user(dummy, buf+bytes-1); - } -+#endif - - status = -ENOMEM; /* we'll assign it later anyway */ - page = __grab_cache_page(mapping, index, &cached_page); diff --git a/lustre/ptlrpc/rpc.c b/lustre/ptlrpc/rpc.c index 4742320..f91a9f6 100644 --- a/lustre/ptlrpc/rpc.c +++ b/lustre/ptlrpc/rpc.c @@ -37,11 +37,12 @@ static ptl_handle_eq_t req_eq, bulk_source_eq, bulk_sink_eq; * 1. Free the request buffer after it has gone out on the wire * 2. Wake up the thread waiting for the reply once it comes in. */ -static int request_callback(ptl_event_t *ev, void *data) +static int client_packet_callback(ptl_event_t *ev, void *data) { struct ptlrpc_request *rpc = ev->mem_desc.user_ptr; ENTRY; + // XXX make sure we understand all events, including ACK's if (ev->type == PTL_EVENT_SENT) { OBD_FREE(ev->mem_desc.start, ev->mem_desc.length); @@ -54,7 +55,7 @@ static int request_callback(ptl_event_t *ev, void *data) return 1; } -static int incoming_callback(ptl_event_t *ev, void *data) +static int server_request_callback(ptl_event_t *ev, void *data) { struct ptlrpc_service *service = data; int rc; @@ -79,13 +80,13 @@ static int incoming_callback(ptl_event_t *ev, void *data) service->srv_ref_count[service->srv_md_active]++; if (ev->offset >= (service->srv_buf_size - 1024)) { - CERROR("Unlinking ME %d\n", service->srv_me_active); + CDEBUG(D_INODE, "Unlinking ME %d\n", service->srv_me_active); rc = PtlMEUnlink(service->srv_me_h[service->srv_me_active]); service->srv_me_h[service->srv_me_active] = 0; if (rc != PTL_OK) { - CERROR("PtlMEUnlink failed: %d\n", rc); + CERROR("PtlMEUnlink failed - DROPPING soon: %d\n", rc); return rc; } @@ -281,15 +282,7 @@ int ptl_received_rpc(struct ptlrpc_service *service) { if ((service->srv_ref_count[index] <= 0) && (service->srv_me_h[index] == 0)) { - rc = PtlMDUnlink(service->srv_md_h[index]); - CDEBUG(D_INFO, "Removing MD at index %d, rc %d\n", index, rc); - - if (rc) - CERROR(": PtlMDUnlink failed: index %d rc %d\n", - index, rc); - /* Replace the unlinked ME and MD */ - rc = PtlMEInsert(service->srv_me_h[service->srv_me_tail], service->srv_id, 0, ~0, PTL_RETAIN, PTL_INS_AFTER, &(service->srv_me_h[index])); @@ -345,7 +338,7 @@ int rpc_register_service(struct ptlrpc_service *service, char *uuid) service->srv_id.gid = PTL_ID_ANY; service->srv_id.rid = PTL_ID_ANY; - rc = PtlEQAlloc(peer.peer_ni, 128, incoming_callback, + rc = PtlEQAlloc(peer.peer_ni, 128, server_request_callback, service, &(service->srv_eq_h)); if (rc != PTL_OK) { @@ -441,7 +434,7 @@ static int req_init_portals(void) } ni = *nip; - rc = PtlEQAlloc(ni, 128, request_callback, NULL, &req_eq); + rc = PtlEQAlloc(ni, 128, client_packet_callback, NULL, &req_eq); if (rc != PTL_OK) CERROR("PtlEQAlloc failed: %d\n", rc); diff --git a/lustre/tests/llmount.sh b/lustre/tests/llmount.sh index 741e029..bc2bf4c 100755 --- a/lustre/tests/llmount.sh +++ b/lustre/tests/llmount.sh @@ -33,7 +33,7 @@ dd if=/dev/zero of=/tmp/ost bs=1024 count=30000 mke2fs -b 4096 -F /tmp/ost losetup ${LOOP}0 /tmp/ost || exit -1 -dd if=/dev/zero of=/tmp/mds bs=1024 count=10000 +dd if=/dev/zero of=/tmp/mds bs=1024 count=100000 mke2fs -b 4096 -F /tmp/mds losetup ${LOOP}1 /tmp/mds || exit -1 -- 1.8.3.1