Whamcloud - gitweb
- minor debugging fixes
authorbraam <braam>
Mon, 25 Feb 2002 07:43:46 +0000 (07:43 +0000)
committerbraam <braam>
Mon, 25 Feb 2002 07:43:46 +0000 (07:43 +0000)
- write event BEFORE calling callback

lustre/lib/page.c
lustre/mds/handler.c
lustre/obdclass/class_obd.c
lustre/ost/ost_handler.c
lustre/patches/patch-2.4.17
lustre/ptlrpc/rpc.c
lustre/tests/llmount.sh

index ed38895..8d11b58 100644 (file)
@@ -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();
+        }
 
 }
 
index cd83e69..cbb4290 100644 (file)
@@ -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;
index e723a5f..2c3a10f 100644 (file)
@@ -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
index cc41e31..6b8f813 100644 (file)
@@ -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;
 
index 6b2fdad..70728d0 100644 (file)
@@ -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);
index 4742320..f91a9f6 100644 (file)
@@ -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);
 
index 741e029..bc2bf4c 100755 (executable)
@@ -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