Whamcloud - gitweb
b=1502
authorpschwan <pschwan>
Sun, 6 Jul 2003 01:16:48 +0000 (01:16 +0000)
committerpschwan <pschwan>
Sun, 6 Jul 2003 01:16:48 +0000 (01:16 +0000)
- Discard incredibly old requests (older than "obd_timeout" seconds) in
  ptlrpc_main without even trying to process them, because the client
  has already given up on us.  See the bug text for more details on why
  this is the right thing to do.
- Clean up deeply-nested ptlrpc_main()
- On Zach's good advice, I also fixed Portals to record when a packet
  arrives in useful microseconds instead of relatively useless cycles

lnet/include/lnet/types.h
lnet/lnet/lib-move.c
lustre/portals/include/portals/types.h
lustre/portals/portals/lib-move.c

index d4038b6..901a717 100644 (file)
@@ -2,14 +2,17 @@
 #define _P30_TYPES_H_
 
 #ifdef __linux__
-#include <asm/types.h>
-#include <asm/timex.h>
+# include <asm/types.h>
+# include <asm/timex.h>
 #else
-#include <sys/types.h>
+# include <sys/types.h>
 typedef u_int32_t __u32;
 typedef u_int64_t __u64;
-typedef unsigned long long cycles_t;
-static inline cycles_t get_cycles(void) { return 0; }
+#endif
+
+#ifndef __KERNEL__
+# include <sys/time.h>
+# define do_gettimeofday(tv) gettimeofday(tv, NULL)
 #endif
 
 typedef __u64 ptl_nid_t;
@@ -31,7 +34,7 @@ typedef ptl_handle_any_t ptl_handle_md_t;
 typedef ptl_handle_any_t ptl_handle_me_t;
 
 #define PTL_HANDLE_NONE \
-((const ptl_handle_any_t){.nal_idx = -1, .cookie = -1})
+    ((const ptl_handle_any_t){.nal_idx = -1, .cookie = -1})
 #define PTL_EQ_NONE PTL_HANDLE_NONE
 
 static inline int PtlHandleEqual (ptl_handle_any_t h1, ptl_handle_any_t h2)
@@ -108,17 +111,15 @@ typedef struct {
         ptl_handle_me_t unlinked_me;
         ptl_md_t mem_desc;
         ptl_hdr_data_t hdr_data;
-        cycles_t  arrival_time;
+        struct timeval arrival_time;
         volatile ptl_seq_t sequence;
 } ptl_event_t;
 
-
 typedef enum {
         PTL_ACK_REQ,
         PTL_NOACK_REQ
 } ptl_ack_req_t;
 
-
 typedef struct {
         volatile ptl_seq_t sequence;
         ptl_size_t size;
@@ -130,7 +131,6 @@ typedef struct {
         ptl_eq_t *eq;
 } ptl_ni_t;
 
-
 typedef struct {
         int max_match_entries;    /* max number of match entries */
         int max_mem_descriptors;  /* max number of memory descriptors */
index fde4f16..02f8b60 100644 (file)
@@ -544,7 +544,7 @@ get_new_msg (nal_cb_t *nal, lib_md_t *md)
         msg->send_ack = 0;
 
         msg->md = md;
-        msg->ev.arrival_time = get_cycles();
+        do_gettimeofday(&msg->ev.arrival_time);
         md->pending++;
         if (md->threshold != PTL_MD_THRESH_INF) {
                 LASSERT (md->threshold > 0);
index d4038b6..901a717 100644 (file)
@@ -2,14 +2,17 @@
 #define _P30_TYPES_H_
 
 #ifdef __linux__
-#include <asm/types.h>
-#include <asm/timex.h>
+# include <asm/types.h>
+# include <asm/timex.h>
 #else
-#include <sys/types.h>
+# include <sys/types.h>
 typedef u_int32_t __u32;
 typedef u_int64_t __u64;
-typedef unsigned long long cycles_t;
-static inline cycles_t get_cycles(void) { return 0; }
+#endif
+
+#ifndef __KERNEL__
+# include <sys/time.h>
+# define do_gettimeofday(tv) gettimeofday(tv, NULL)
 #endif
 
 typedef __u64 ptl_nid_t;
@@ -31,7 +34,7 @@ typedef ptl_handle_any_t ptl_handle_md_t;
 typedef ptl_handle_any_t ptl_handle_me_t;
 
 #define PTL_HANDLE_NONE \
-((const ptl_handle_any_t){.nal_idx = -1, .cookie = -1})
+    ((const ptl_handle_any_t){.nal_idx = -1, .cookie = -1})
 #define PTL_EQ_NONE PTL_HANDLE_NONE
 
 static inline int PtlHandleEqual (ptl_handle_any_t h1, ptl_handle_any_t h2)
@@ -108,17 +111,15 @@ typedef struct {
         ptl_handle_me_t unlinked_me;
         ptl_md_t mem_desc;
         ptl_hdr_data_t hdr_data;
-        cycles_t  arrival_time;
+        struct timeval arrival_time;
         volatile ptl_seq_t sequence;
 } ptl_event_t;
 
-
 typedef enum {
         PTL_ACK_REQ,
         PTL_NOACK_REQ
 } ptl_ack_req_t;
 
-
 typedef struct {
         volatile ptl_seq_t sequence;
         ptl_size_t size;
@@ -130,7 +131,6 @@ typedef struct {
         ptl_eq_t *eq;
 } ptl_ni_t;
 
-
 typedef struct {
         int max_match_entries;    /* max number of match entries */
         int max_mem_descriptors;  /* max number of memory descriptors */
index fde4f16..02f8b60 100644 (file)
@@ -544,7 +544,7 @@ get_new_msg (nal_cb_t *nal, lib_md_t *md)
         msg->send_ack = 0;
 
         msg->md = md;
-        msg->ev.arrival_time = get_cycles();
+        do_gettimeofday(&msg->ev.arrival_time);
         md->pending++;
         if (md->threshold != PTL_MD_THRESH_INF) {
                 LASSERT (md->threshold > 0);