Re: [RFC][PATCH] mm: Fix RLIMIT_MEMLOCK

2013-05-30 Thread Ingo Molnar

* KOSAKI Motohiro kosaki.motoh...@gmail.com wrote:

 Hi
 
 I'm unhappy you guys uses offensive word so much. Please cool down all 
 you guys. :-/ In fact, _BOTH_ the behavior before and after Cristoph's 
 patch doesn't have cleaner semantics.

Erm, this feature _regressed_ after the patch. All other concerns are 
secondary. What's so difficult to understand about that?

 And PeterZ proposed make new cleaner one rather than revert. No need to 
 hassle.

Sorry, that's not how we deal with regressions upstream...

I've been pretty polite in fact, compared to say Linus - someone should 
put a politically correct summary of:

   https://lkml.org/lkml/2013/2/22/456
   https://lkml.org/lkml/2013/3/26/1113

into Documentation/, people keep forgetting about it.

I'm sorry if being direct and to the point offends you [no, not really], 
this discussion got _way_ off the real track it should be on: that this is 
a _regression_.

Thanks,

Ingo
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Segfault in osm_mgrp_delete_port()

2013-05-30 Thread Hal Rosenstock
On 5/28/2013 7:20 AM, Line Holen wrote:
 Segfaults can occur in osm_mgrp_delete_port() if the last
 full member of a MCG is removed while other non-full members
 still exist.
 
 Signed-off-by: Line Holen line.ho...@oracle.com

Thanks. Applied with one minor change noted below.

 ---
 
 diff --git a/include/opensm/osm_multicast.h b/include/opensm/osm_multicast.h
 index 11d789b..e192a72 100644
 --- a/include/opensm/osm_multicast.h
 +++ b/include/opensm/osm_multicast.h
 @@ -2,6 +2,7 @@
   * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.
   * Copyright (c) 2002-2012 Mellanox Technologies LTD. All rights reserved.
   * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
 + * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
   *
   * This software is available to you under a choice of one of two
   * licenses.  You may choose to be licensed under the terms of the GNU
 @@ -447,7 +448,7 @@ void osm_mgrp_delete_port(IN osm_subn_t * subn, IN 
 osm_log_t * log,
  * SEE ALSO
  */
  
 -void osm_mgrp_remove_port(osm_subn_t * subn, osm_log_t * log, osm_mgrp_t * 
 mgrp,
 +boolean_t osm_mgrp_remove_port(osm_subn_t * subn, osm_log_t * log, 
 osm_mgrp_t * mgrp,
 osm_mcm_alias_guid_t * mcm_alias_guid,
 ib_member_rec_t * mcmr);
  void osm_mgrp_cleanup(osm_subn_t * subn, osm_mgrp_t * mpgr);
 diff --git a/opensm/osm_multicast.c b/opensm/osm_multicast.c
 index c43d58d..eb93c55 100644
 --- a/opensm/osm_multicast.c
 +++ b/opensm/osm_multicast.c
 @@ -2,6 +2,7 @@
   * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.
   * Copyright (c) 2002-2012 Mellanox Technologies LTD. All rights reserved.
   * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
 + * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
   *
   * This software is available to you under a choice of one of two
   * licenses.  You may choose to be licensed under the terms of the GNU
 @@ -338,12 +339,13 @@ osm_mcm_port_t *osm_mgrp_add_port(IN osm_subn_t * subn, 
 osm_log_t * log,
   return mcm_port;
  }
  
 -void osm_mgrp_remove_port(osm_subn_t * subn, osm_log_t * log, osm_mgrp_t * 
 mgrp,
 +boolean_t osm_mgrp_remove_port(osm_subn_t * subn, osm_log_t * log, 
 osm_mgrp_t * mgrp,
 osm_mcm_alias_guid_t * mcm_alias_guid,
 ib_member_rec_t *mcmr)
  {
   uint8_t join_state = mcmr-scope_state  0xf;
   uint8_t port_join_state, new_join_state;
 + boolean_t mgrp_deleted = FALSE;
  
   /*
* according to the same o15-0.1.14 we get the stored
 @@ -406,9 +408,12 @@ void osm_mgrp_remove_port(osm_subn_t * subn, osm_log_t * 
 log, osm_mgrp_t * mgrp,
   --mgrp-full_members == 0) {
   mgrp_send_notice(subn, log, mgrp, 67);
   osm_mgrp_cleanup(subn, mgrp);
 + mgrp_deleted = TRUE;
   }
  
   subn-p_osm-sa.dirty = TRUE;
 +
 + return (mgrp_deleted);
  }
  
  void osm_mgrp_delete_port(osm_subn_t * subn, osm_log_t * log, osm_mgrp_t * 
 mgrp,
 @@ -416,14 +421,16 @@ void osm_mgrp_delete_port(osm_subn_t * subn, osm_log_t 
 * log, osm_mgrp_t * mgrp,
  {
   osm_mcm_alias_guid_t *mcm_alias_guid, *next_mcm_alias_guid;
   ib_member_rec_t mcmrec;
 + boolean_t mgrp_deleted = FALSE;
  
   next_mcm_alias_guid = (osm_mcm_alias_guid_t *) 
 cl_qmap_head(mgrp-mcm_alias_port_tbl);
 - while (next_mcm_alias_guid != (osm_mcm_alias_guid_t *) 
 cl_qmap_end(mgrp-mcm_alias_port_tbl)) {
 + while (next_mcm_alias_guid != (osm_mcm_alias_guid_t *) 
 cl_qmap_end(mgrp-mcm_alias_port_tbl) 
 +   !mgrp_deleted) {
   mcm_alias_guid = next_mcm_alias_guid;
   next_mcm_alias_guid = (osm_mcm_alias_guid_t *) 
 cl_qmap_next(next_mcm_alias_guid-map_item);
   if (mcm_alias_guid-p_base_mcm_port-port == port) {
   mcmrec.scope_state = 0xf;
 - osm_mgrp_remove_port(subn, log, mgrp, mcm_alias_guid,
 + mgrp_deleted = osm_mgrp_remove_port(subn, log, mgrp, 
 mcm_alias_guid,
mcmrec);
   }
   }
 diff --git a/opensm/osm_sa_mcmember_record.c b/opensm/osm_sa_mcmember_record.c
 index 242fcde..4d4070f 100644
 --- a/opensm/osm_sa_mcmember_record.c
 +++ b/opensm/osm_sa_mcmember_record.c
 @@ -3,6 +3,7 @@
   * Copyright (c) 2002-2011 Mellanox Technologies LTD. All rights reserved.
   * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
   * Copyright (c) 2008 Xsigo Systems Inc.  All rights reserved.
 + * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
   *
   * This software is available to you under a choice of one of two
   * licenses.  You may choose to be licensed under the terms of the GNU
 @@ -979,7 +980,7 @@ static void mcmr_rcv_leave_mgrp(IN osm_sa_t * sa, IN 
 osm_madw_t * p_madw)
   }
  
   /* remove port and/or update join state */
 - 

Re: [PATCH] Segfault in osm_mgrp_delete_port()

2013-05-30 Thread Line Holen

On 05/30/13 14:27, Hal Rosenstock wrote:

On 5/28/2013 7:20 AM, Line Holen wrote:

Segfaults can occur in osm_mgrp_delete_port() if the last
full member of a MCG is removed while other non-full members
still exist.

Signed-off-by: Line Holenline.ho...@oracle.com

Thanks. Applied with one minor change noted below.


---

diff --git a/include/opensm/osm_multicast.h b/include/opensm/osm_multicast.h
index 11d789b..e192a72 100644
--- a/include/opensm/osm_multicast.h
+++ b/include/opensm/osm_multicast.h
@@ -2,6 +2,7 @@
   * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.
   * Copyright (c) 2002-2012 Mellanox Technologies LTD. All rights reserved.
   * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
+ * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
   *
   * This software is available to you under a choice of one of two
   * licenses.  You may choose to be licensed under the terms of the GNU
@@ -447,7 +448,7 @@ void osm_mgrp_delete_port(IN osm_subn_t * subn, IN 
osm_log_t * log,
  * SEE ALSO
  */

-void osm_mgrp_remove_port(osm_subn_t * subn, osm_log_t * log, osm_mgrp_t * 
mgrp,
+boolean_t osm_mgrp_remove_port(osm_subn_t * subn, osm_log_t * log, osm_mgrp_t 
* mgrp,
  osm_mcm_alias_guid_t * mcm_alias_guid,
  ib_member_rec_t * mcmr);
  void osm_mgrp_cleanup(osm_subn_t * subn, osm_mgrp_t * mpgr);
diff --git a/opensm/osm_multicast.c b/opensm/osm_multicast.c
index c43d58d..eb93c55 100644
--- a/opensm/osm_multicast.c
+++ b/opensm/osm_multicast.c
@@ -2,6 +2,7 @@
   * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.
   * Copyright (c) 2002-2012 Mellanox Technologies LTD. All rights reserved.
   * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
+ * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
   *
   * This software is available to you under a choice of one of two
   * licenses.  You may choose to be licensed under the terms of the GNU
@@ -338,12 +339,13 @@ osm_mcm_port_t *osm_mgrp_add_port(IN osm_subn_t * subn, 
osm_log_t * log,
return mcm_port;
  }

-void osm_mgrp_remove_port(osm_subn_t * subn, osm_log_t * log, osm_mgrp_t * 
mgrp,
+boolean_t osm_mgrp_remove_port(osm_subn_t * subn, osm_log_t * log, osm_mgrp_t 
* mgrp,
  osm_mcm_alias_guid_t * mcm_alias_guid,
  ib_member_rec_t *mcmr)
  {
uint8_t join_state = mcmr-scope_state  0xf;
uint8_t port_join_state, new_join_state;
+   boolean_t mgrp_deleted = FALSE;

/*
 * according to the same o15-0.1.14 we get the stored
@@ -406,9 +408,12 @@ void osm_mgrp_remove_port(osm_subn_t * subn, osm_log_t * 
log, osm_mgrp_t * mgrp,
--mgrp-full_members == 0) {
mgrp_send_notice(subn, log, mgrp, 67);
osm_mgrp_cleanup(subn, mgrp);
+   mgrp_deleted = TRUE;
}

subn-p_osm-sa.dirty = TRUE;
+
+   return (mgrp_deleted);
  }

  void osm_mgrp_delete_port(osm_subn_t * subn, osm_log_t * log, osm_mgrp_t * 
mgrp,
@@ -416,14 +421,16 @@ void osm_mgrp_delete_port(osm_subn_t * subn, osm_log_t * 
log, osm_mgrp_t * mgrp,
  {
osm_mcm_alias_guid_t *mcm_alias_guid, *next_mcm_alias_guid;
ib_member_rec_t mcmrec;
+   boolean_t mgrp_deleted = FALSE;

next_mcm_alias_guid = (osm_mcm_alias_guid_t *) 
cl_qmap_head(mgrp-mcm_alias_port_tbl);
-   while (next_mcm_alias_guid != (osm_mcm_alias_guid_t *) 
cl_qmap_end(mgrp-mcm_alias_port_tbl)) {
+   while (next_mcm_alias_guid != (osm_mcm_alias_guid_t *) 
cl_qmap_end(mgrp-mcm_alias_port_tbl)
+ !mgrp_deleted) {
mcm_alias_guid = next_mcm_alias_guid;
next_mcm_alias_guid = (osm_mcm_alias_guid_t *) 
cl_qmap_next(next_mcm_alias_guid-map_item);
if (mcm_alias_guid-p_base_mcm_port-port == port) {
mcmrec.scope_state = 0xf;
-   osm_mgrp_remove_port(subn, log, mgrp, mcm_alias_guid,
+   mgrp_deleted = osm_mgrp_remove_port(subn, log, mgrp, 
mcm_alias_guid,
mcmrec);
}
}
diff --git a/opensm/osm_sa_mcmember_record.c b/opensm/osm_sa_mcmember_record.c
index 242fcde..4d4070f 100644
--- a/opensm/osm_sa_mcmember_record.c
+++ b/opensm/osm_sa_mcmember_record.c
@@ -3,6 +3,7 @@
   * Copyright (c) 2002-2011 Mellanox Technologies LTD. All rights reserved.
   * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
   * Copyright (c) 2008 Xsigo Systems Inc.  All rights reserved.
+ * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
   *
   * This software is available to you under a choice of one of two
   * licenses.  You may choose to be licensed under the terms of the GNU
@@ -979,7 +980,7 @@ static void mcmr_rcv_leave_mgrp(IN osm_sa_t * sa, IN 
osm_madw_t * p_madw)
}

/* remove port and/or update join state */
-   

[PATCH v2] Add trap details to notice log message

2013-05-30 Thread Line Holen
Signed-off-by: Line Holen line.ho...@oracle.com

---

diff --git a/include/iba/ib_types.h b/include/iba/ib_types.h
index d5cf287..5c238ae 100644
--- a/include/iba/ib_types.h
+++ b/include/iba/ib_types.h
@@ -3,6 +3,7 @@
  * Copyright (c) 2002-2011 Mellanox Technologies LTD. All rights reserved.
  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
  * Copyright (c) 2009 HNR Consulting. All rights reserved.
+ * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -7619,6 +7620,23 @@ ib_member_set_join_state(IN OUT ib_member_rec_t * 
p_mc_rec,
 #define IB_NOTICE_TYPE_INFO0x04
 #define IB_NOTICE_TYPE_EMPTY   0x7F
 
+#define SM_GID_IN_SERVICE_TRAP 64
+#define SM_GID_OUT_OF_SERVICE_TRAP 65
+#define SM_MGID_CREATED_TRAP   66
+#define SM_MGID_DESTROYED_TRAP 67
+#define SM_UNPATH_TRAP 68
+#define SM_REPATH_TRAP 69
+#define SM_LINK_STATE_CHANGED_TRAP 128
+#define SM_LINK_INTEGRITY_THRESHOLD_TRAP   129
+#define SM_BUFFER_OVERRUN_THRESHOLD_TRAP   130
+#define SM_WATCHDOG_TIMER_EXPIRED_TRAP 131
+#define SM_LOCAL_CHANGES_TRAP  144
+#define SM_SYS_IMG_GUID_CHANGED_TRAP   145
+#define SM_BAD_MKEY_TRAP   256
+#define SM_BAD_PKEY_TRAP   257
+#define SM_BAD_QKEY_TRAP   258
+#define SM_BAD_SWITCH_PKEY_TRAP259
+
 #include complib/cl_packon.h
 typedef struct _ib_mad_notice_attr // Total Size calc  Accumulated
 {
diff --git a/opensm/osm_inform.c b/opensm/osm_inform.c
index f5abbc6..3ccbc12 100644
--- a/opensm/osm_inform.c
+++ b/opensm/osm_inform.c
@@ -3,6 +3,7 @@
  * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved.
  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
  * Copyright (c) 2009 HNR Consulting. All rights reserved.
+ * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -316,7 +317,8 @@ static ib_api_status_t send_report(IN osm_infr_t * 
p_infr_rec,  /* the informinfo
 
if (!p_report_madw) {
OSM_LOG(p_log, OSM_LOG_ERROR, ERR 0203: 
-   osm_mad_pool_get failed\n);
+   Cannot send report to LID %u, osm_mad_pool_get 
failed\n,
+   cl_ntoh16(p_infr_rec-report_addr.dest_lid));
status = IB_ERROR;
goto Exit;
}
@@ -584,6 +586,7 @@ static void log_notice(osm_log_t * log, osm_log_level_t 
level,
 {
char gid_str[INET6_ADDRSTRLEN];
ib_gid_t *gid;
+   ib_gid_t *gid1, *gid2;
 
/* an official Event information log */
if (ib_notice_is_generic(ntc)) {
@@ -594,14 +597,145 @@ static void log_notice(osm_log_t * log, osm_log_level_t 
level,
gid = ntc-data_details.ntc_64_67.gid;
else
gid = ntc-issuer_gid;
-   OSM_LOG(log, level,
-   Reporting Generic Notice type:%u num:%u (%s)
-from LID:%u GID:%s\n,
-   ib_notice_get_type(ntc),
-   cl_ntoh16(ntc-g_or_v.generic.trap_num),
-   ib_get_trap_str(ntc-g_or_v.generic.trap_num),
-   cl_ntoh16(ntc-issuer_lid),
-   inet_ntop(AF_INET6, gid-raw, gid_str, sizeof gid_str));
+
+   switch (cl_ntoh16(ntc-g_or_v.generic.trap_num)) {
+   case SM_GID_IN_SERVICE_TRAP:
+   case SM_GID_OUT_OF_SERVICE_TRAP:
+   OSM_LOG(log, level,
+   Reporting Informational Notice \%s\, 
GID:%s\n,
+   ib_get_trap_str(ntc-g_or_v.generic.trap_num),
+   inet_ntop(AF_INET6, gid-raw, gid_str, sizeof 
gid_str));
+   break;
+   case SM_MGID_CREATED_TRAP:
+   case SM_MGID_DESTROYED_TRAP:
+   OSM_LOG(log, level,
+   Reporting Informational Notice \%s\, 
MGID:%s\n,
+   ib_get_trap_str(ntc-g_or_v.generic.trap_num),
+   inet_ntop(AF_INET6, gid-raw, gid_str, sizeof 
gid_str));
+   break;
+   case SM_UNPATH_TRAP:
+   case SM_REPATH_TRAP:
+   /* TODO: Fill in details once SM starts to use these 
traps */
+   

[PATCH] osm_console_io.c Memory leak when closing console

2013-05-30 Thread Line Holen
Use fclose() rather than close() to avoid memory leaks.
Also lowered the loglevel of a couple of log messages.

Signed-off-by: Line Holen line.ho...@oracle.com

---

diff --git a/opensm/osm_console_io.c b/opensm/osm_console_io.c
index 18bd5ef..dfc903f 100644
--- a/opensm/osm_console_io.c
+++ b/opensm/osm_console_io.c
@@ -1,6 +1,7 @@
 /*
  * Copyright (c) 2005-2009 Voltaire, Inc. All rights reserved.
  * Copyright (c) 2008 HNR Consulting. All rights reserved.
+ * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -107,10 +108,10 @@ int cio_close(osm_console_t * p_oct, osm_log_t * p_log)
 {
int rtnval = -1;
if (p_oct  p_oct-in_fd  0) {
-   OSM_LOG(p_log, OSM_LOG_INFO,
+   OSM_LOG(p_log, OSM_LOG_VERBOSE,
Console connection closed: %s (%s)\n,
p_oct-client_hn, p_oct-client_ip);
-   rtnval = close(p_oct-in_fd);
+   rtnval = fclose(p_oct-in);
p_oct-in_fd = -1;
p_oct-out_fd = -1;
p_oct-in = NULL;
@@ -138,9 +139,10 @@ int cio_open(osm_console_t * p_oct, int new_fd, osm_log_t 
* p_log)
cio_close(p_oct, p_log);
else {
OSM_LOG(p_log, OSM_LOG_INFO,
-   Console connection aborted: %s (%s)\n,
+   Console connection aborted: %s (%s) - 
+   already in use\n,
p_oct-client_hn, p_oct-client_ip);
-   close(new_fd);
+   fclose(file);
free(p_line);
return -1;
}
@@ -151,7 +153,7 @@ int cio_open(osm_console_t * p_oct, int new_fd, osm_log_t * 
p_log)
p_oct-in = fdopen(p_oct-in_fd, w+);
p_oct-out = p_oct-in;
osm_console_prompt(p_oct-out);
-   OSM_LOG(p_log, OSM_LOG_INFO, Console connection accepted: %s (%s)\n,
+   OSM_LOG(p_log, OSM_LOG_VERBOSE, Console connection accepted: %s 
(%s)\n,
p_oct-client_hn, p_oct-client_ip);
 
return (p_oct-in == NULL) ? -1 : 0;
@@ -224,7 +226,7 @@ int osm_console_init(osm_subn_opt_t * opt, osm_console_t * 
p_oct, osm_log_t * p_
}
if (listen(p_oct-socket, 1)  0) {
OSM_LOG(p_log, OSM_LOG_ERROR,
-   ERR 4B03: Failed to listen on socket: %s\n,
+   ERR 4B03: Failed to listen on console socket: 
%s\n,
strerror(errno));
return -1;
}
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Status of ummunot branch?

2013-05-30 Thread Jeff Squyres (jsquyres)
On May 30, 2013, at 1:09 AM, Or Gerlitz ogerl...@mellanox.com wrote:

 Has this been run by the MPI implementor community?
 
 The team that works on this here isn't ready for submission, so community 
 runs were not made yet

If this is a solution to an MPI problem, it would seem like a good idea to run 
the specifics of this proposal to the MPI *implementor* community first (not 
*users*).

I say this because Mellanox also proposed the concept of a shared send queue 
as a solution to MPI RC scalability problems a while ago (around about the time 
XRC first debuted, IIRC?), and the MPI community universally hated it.

-- 
Jeff Squyres
jsquy...@cisco.com
For corporate legal information go to: 
http://www.cisco.com/web/about/doing_business/legal/cri/

--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] uDAPL: common: dapl_os_atomic_inc/dec() not working as expected on ppc64 machines

2013-05-30 Thread Davis, Arlin R

Signed-off-by: Pradeep Satyanarayana prad...@lus.ibm.com
Acked-by: Arlin Davis arlin.r.da...@intel.com
---
 dapl/udapl/linux/dapl_osd.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dapl/udapl/linux/dapl_osd.h b/dapl/udapl/linux/dapl_osd.h
index 7198439..0412461 100644
--- a/dapl/udapl/linux/dapl_osd.h
+++ b/dapl/udapl/linux/dapl_osd.h
@@ -188,7 +188,7 @@ dapl_os_atomic_inc (
stwcx.  %0,0,%2\n\
bne-1b
: =r (tmp), +m (v)
-   : r (v)
+   : b (v)
: cc);
 #else  /* !__ia64__ */
 __asm__ __volatile__ (
@@ -227,7 +227,7 @@ dapl_os_atomic_dec (
stwcx.  %0,0,%2\n\
bne-1b
: =r (tmp), +m (v)
-   : r (v)
+   : b (v)
: cc);
 #else  /* !__ia64__ */
 __asm__ __volatile__ (
-- 
1.7.3




N�r��yb�X��ǧv�^�)޺{.n�+{��ٚ�{ay�ʇڙ�,j��f���h���z��w���
���j:+v���w�j�mzZ+�ݢj��!�i

[PATCH 1/3] uDAPL: dapltest: ppc64 endian issue with exchanged mem handle and address

2013-05-30 Thread Davis, Arlin R

Signed-off-by: Pradeep Satyanarayana prad...@lus.ibm.com
Acked-by: Arlin Davis arlin.r.da...@intel.com
---
 test/dapltest/common/dapl_endian.c |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/test/dapltest/common/dapl_endian.c 
b/test/dapltest/common/dapl_endian.c
index d93fbb9..c77f2f2 100644
--- a/test/dapltest/common/dapl_endian.c
+++ b/test/dapltest/common/dapl_endian.c
@@ -77,8 +77,6 @@ DAT_UINT64 DT_Endian64(DAT_UINT64 val)
 
 DAT_UINT32 DT_EndianMemHandle(DAT_UINT32 val)
 {
-   if (DT_local_is_little_endian)
-   return val;
val = ((val  c1a32)  8) | ((val  c1b32)  8);
val = ((val  c2a32)  16) | ((val  c2b32)  16);
return (val);
@@ -88,8 +86,6 @@ DAT_UINT64 DT_EndianMemAddress(DAT_UINT64 val)
 {
DAT_UINT64 val64;
 
-   if (DT_local_is_little_endian)
-   return val;
val64 = val;
val64 = ((val64  c1a64)  8) | ((val64  c1b64)  8);
val64 = ((val64  c2a64)  16) | ((val64  c2b64)  16);
-- 
1.7.3





[PATCH 3/3] uDAPL common: add support for ia name during dat_ia_query

2013-05-30 Thread Davis, Arlin R
the device name was not being updated during a query. Copy
the hca name into ia_attr-adapter_name for consumers.

Signed-off-by: Arlin Davis arlin.r.da...@intel.com
---
 dapl/openib_common/util.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dapl/openib_common/util.c b/dapl/openib_common/util.c
index 33629b8..8b97263 100644
--- a/dapl/openib_common/util.c
+++ b/dapl/openib_common/util.c
@@ -310,6 +310,9 @@ DAT_RETURN dapls_ib_query_hca(IN DAPL_HCA * hca_ptr,
 
if (ia_attr != NULL) {
(void)dapl_os_memzero(ia_attr, sizeof(*ia_attr));
+   strncpy(ia_attr-adapter_name,
+   ibv_get_device_name(hca_ptr-ib_trans.ib_dev),
+   DAT_NAME_MAX_LENGTH - 1);
ia_attr-adapter_name[DAT_NAME_MAX_LENGTH - 1] = '\0';
ia_attr-vendor_name[DAT_NAME_MAX_LENGTH - 1] = '\0';
ia_attr-ia_address_ptr =
@@ -317,7 +320,7 @@ DAT_RETURN dapls_ib_query_hca(IN DAPL_HCA * hca_ptr,
 
dapl_dbg_log(DAPL_DBG_TYPE_UTIL,
  query_hca: %s %s \n,
-ibv_get_device_name(hca_ptr-ib_trans.ib_dev),
+ia_attr-adapter_name,
 inet_ntoa(((struct sockaddr_in *)
hca_ptr-hca_address)-sin_addr));
 
-- 
1.7.3






[PATCH v3] Add trap details to notice log message

2013-05-30 Thread Line Holen
Signed-off-by: Line Holen line.ho...@oracle.com

---

diff --git a/include/iba/ib_types.h b/include/iba/ib_types.h
index d5cf287..5c238ae 100644
--- a/include/iba/ib_types.h
+++ b/include/iba/ib_types.h
@@ -3,6 +3,7 @@
  * Copyright (c) 2002-2011 Mellanox Technologies LTD. All rights reserved.
  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
  * Copyright (c) 2009 HNR Consulting. All rights reserved.
+ * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -7619,6 +7620,23 @@ ib_member_set_join_state(IN OUT ib_member_rec_t * 
p_mc_rec,
 #define IB_NOTICE_TYPE_INFO0x04
 #define IB_NOTICE_TYPE_EMPTY   0x7F
 
+#define SM_GID_IN_SERVICE_TRAP 64
+#define SM_GID_OUT_OF_SERVICE_TRAP 65
+#define SM_MGID_CREATED_TRAP   66
+#define SM_MGID_DESTROYED_TRAP 67
+#define SM_UNPATH_TRAP 68
+#define SM_REPATH_TRAP 69
+#define SM_LINK_STATE_CHANGED_TRAP 128
+#define SM_LINK_INTEGRITY_THRESHOLD_TRAP   129
+#define SM_BUFFER_OVERRUN_THRESHOLD_TRAP   130
+#define SM_WATCHDOG_TIMER_EXPIRED_TRAP 131
+#define SM_LOCAL_CHANGES_TRAP  144
+#define SM_SYS_IMG_GUID_CHANGED_TRAP   145
+#define SM_BAD_MKEY_TRAP   256
+#define SM_BAD_PKEY_TRAP   257
+#define SM_BAD_QKEY_TRAP   258
+#define SM_BAD_SWITCH_PKEY_TRAP259
+
 #include complib/cl_packon.h
 typedef struct _ib_mad_notice_attr // Total Size calc  Accumulated
 {
diff --git a/opensm/osm_inform.c b/opensm/osm_inform.c
index f5abbc6..845ec7c 100644
--- a/opensm/osm_inform.c
+++ b/opensm/osm_inform.c
@@ -3,6 +3,7 @@
  * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved.
  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
  * Copyright (c) 2009 HNR Consulting. All rights reserved.
+ * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -316,7 +317,8 @@ static ib_api_status_t send_report(IN osm_infr_t * 
p_infr_rec,  /* the informinfo
 
if (!p_report_madw) {
OSM_LOG(p_log, OSM_LOG_ERROR, ERR 0203: 
-   osm_mad_pool_get failed\n);
+   Cannot send report to LID %u, osm_mad_pool_get 
failed\n,
+   cl_ntoh16(p_infr_rec-report_addr.dest_lid));
status = IB_ERROR;
goto Exit;
}
@@ -582,8 +584,9 @@ Exit:
 static void log_notice(osm_log_t * log, osm_log_level_t level,
   ib_mad_notice_attr_t * ntc)
 {
-   char gid_str[INET6_ADDRSTRLEN];
+   char gid_str[INET6_ADDRSTRLEN], gid_str2[INET6_ADDRSTRLEN];
ib_gid_t *gid;
+   ib_gid_t *gid1, *gid2;
 
/* an official Event information log */
if (ib_notice_is_generic(ntc)) {
@@ -594,14 +597,145 @@ static void log_notice(osm_log_t * log, osm_log_level_t 
level,
gid = ntc-data_details.ntc_64_67.gid;
else
gid = ntc-issuer_gid;
-   OSM_LOG(log, level,
-   Reporting Generic Notice type:%u num:%u (%s)
-from LID:%u GID:%s\n,
-   ib_notice_get_type(ntc),
-   cl_ntoh16(ntc-g_or_v.generic.trap_num),
-   ib_get_trap_str(ntc-g_or_v.generic.trap_num),
-   cl_ntoh16(ntc-issuer_lid),
-   inet_ntop(AF_INET6, gid-raw, gid_str, sizeof gid_str));
+
+   switch (cl_ntoh16(ntc-g_or_v.generic.trap_num)) {
+   case SM_GID_IN_SERVICE_TRAP:
+   case SM_GID_OUT_OF_SERVICE_TRAP:
+   OSM_LOG(log, level,
+   Reporting Informational Notice \%s\, 
GID:%s\n,
+   ib_get_trap_str(ntc-g_or_v.generic.trap_num),
+   inet_ntop(AF_INET6, gid-raw, gid_str, sizeof 
gid_str));
+   break;
+   case SM_MGID_CREATED_TRAP:
+   case SM_MGID_DESTROYED_TRAP:
+   OSM_LOG(log, level,
+   Reporting Informational Notice \%s\, 
MGID:%s\n,
+   ib_get_trap_str(ntc-g_or_v.generic.trap_num),
+   inet_ntop(AF_INET6, gid-raw, gid_str, sizeof 
gid_str));
+   break;
+   case SM_UNPATH_TRAP:
+   case 

RE: [PATCH v3] Add trap details to notice log message

2013-05-30 Thread Hefty, Sean
 diff --git a/include/iba/ib_types.h b/include/iba/ib_types.h
 index d5cf287..5c238ae 100644
 --- a/include/iba/ib_types.h
 +++ b/include/iba/ib_types.h
 @@ -3,6 +3,7 @@
   * Copyright (c) 2002-2011 Mellanox Technologies LTD. All rights reserved.
   * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
   * Copyright (c) 2009 HNR Consulting. All rights reserved.
 + * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
   *
   * This software is available to you under a choice of one of two
   * licenses.  You may choose to be licensed under the terms of the GNU
 @@ -7619,6 +7620,23 @@ ib_member_set_join_state(IN OUT ib_member_rec_t *
 p_mc_rec,
  #define IB_NOTICE_TYPE_INFO  0x04
  #define IB_NOTICE_TYPE_EMPTY 0x7F
 
 +#define SM_GID_IN_SERVICE_TRAP   64
 +#define SM_GID_OUT_OF_SERVICE_TRAP   65
 +#define SM_MGID_CREATED_TRAP 66
 +#define SM_MGID_DESTROYED_TRAP   67
 +#define SM_UNPATH_TRAP   68
 +#define SM_REPATH_TRAP   69
 +#define SM_LINK_STATE_CHANGED_TRAP   128
 +#define SM_LINK_INTEGRITY_THRESHOLD_TRAP 129
 +#define SM_BUFFER_OVERRUN_THRESHOLD_TRAP 130
 +#define SM_WATCHDOG_TIMER_EXPIRED_TRAP   131
 +#define SM_LOCAL_CHANGES_TRAP144
 +#define SM_SYS_IMG_GUID_CHANGED_TRAP 145
 +#define SM_BAD_MKEY_TRAP 256
 +#define SM_BAD_PKEY_TRAP 257
 +#define SM_BAD_QKEY_TRAP 258
 +#define SM_BAD_SWITCH_PKEY_TRAP  259

These definitions could go into libubmad/include/infiniband/umad_sm.h.
N�r��yb�X��ǧv�^�)޺{.n�+{��ٚ�{ay�ʇڙ�,j��f���h���z��w���
���j:+v���w�j�mzZ+�ݢj��!�i

Re: [RFC][PATCH] mm: Fix RLIMIT_MEMLOCK

2013-05-30 Thread Peter Zijlstra
On Tue, May 28, 2013 at 04:37:06PM +, Christoph Lameter wrote:
 On Mon, 27 May 2013, Peter Zijlstra wrote:
 
  Before your patch pinned was included in locked and thus RLIMIT_MEMLOCK
  had a single resource counter. After your patch RLIMIT_MEMLOCK is
  applied separately to both -- more or less.
 
 Before the patch the count was doubled since a single page was counted
 twice: Once because it was mlocked (marked with PG_mlock) and then again
 because it was also pinned (the refcount was increased). Two different things.

Before the patch RLIMIT_MEMLOCK was a limit on the sum of both, after it
is no longer. This change was not described in the changelog.

This is a bug plain and simple and you refuse to acknowledge it.

 We have agreed for a long time that mlocked pages are movable. That is not
 true for pinned pages and therefore pinning pages therefore do not fall
 into that category (Hugh? AFAICR you came up with that rule?)

Into what category? RLIMIT_MEMLOCK should be a limit on the amount of
pages that are constrained to memory (can not be paged). How does a
pinned page not qualify for that?

  NO, mlocked pages are pages that do not leave core memory; IOW do not
  cause major faults. Pinning pages is a perfectly spec compliant mlock()
  implementation.
 
 That is not the definition that we have used so far.

There's two statements there; which one do you disagree with?

On the first; that is exactly the mlock() definition you want; excluding
major faults only means faults cannot be subject to IO, IOW pages must
remain in memory. Not excluding minor faults allows you to unmap and
migrate pages.

On the second; excluding any faults; that is what the mlock() specs
intended -- because that is the thing real-time people really want and
mlock is part of the real-time POSIX spec.

[ Hence the need to provide mpin() and munpin() syscalls before we make
  mlock() pages migratable, otherwise RT people are screwed. ]

Since excluding any fault per definition also excludes major faults,
the second is a clear superset of the first. Both ensure pages stay in
memory, thus both should count towards RLIMIT_MEMLOCK.

 But then you refuse to acknowledge the difference and want to conflate
 both.

You're the one that is confused. You're just repeating yourself without
providing argument or reason. 

   Pages can be both pinned and mlocked.
 
  Right, but apart for mlockall() this is a highly unlikely situation to
  actually occur. And if you're using mlockall() you've effectively
  disabled RLIMIT_MEMLOCK and thus nobody cares if the resource counter
  goes funny.
 
 mlockall() would never be used on all processes. You still need the
 RLIMIT_MLOCK to ensure that the box does not lock up.

You're so skilled at missing the point its not funny. 

The resource counter (formerly mm_struct::locked_vm, currently broken)
associated with RLIMIT_MEMLOCK is per process. Therefore when you use
mlockall() you've already done away with the limit, and thus the
resource counter value is irrelevant.

   I think we need to be first clear on what we want to accomplish and what
   these counters actually should count before changing things.
 
  Backward isn't it... _you_ changed it without consideration.
 
 I applied the categorization that we had agreed on before during the
 development of page migratiob. Pinning is not compatible.

I've never agreed to any such thing, you changed my code without cc'ing
me and without describing the actual change.

Please explain how pinned pages are not stuck in memory and can be
paged? Once you've convinced me of that, I'll concede they should not be
counted towards RLIMIT_MEMLOCK.

  The IB code does a big get_user_pages(), which last time I checked
  pins a sequential range of pages. Therefore the VMA approach.
 
 The IB code (and other code) can require the pinning of pages in various
 ways.

You can also mlock()/madvise()/mprotect() in various ways, this is a
non-argument against using VMAs.

Is there anything besides IB and perf that has user controlled page
pinning? If so, it needs fixing.
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC][PATCH] mm: Fix RLIMIT_MEMLOCK

2013-05-30 Thread Pekka Enberg
On Mon, 27 May 2013, Peter Zijlstra wrote:
 Before your patch pinned was included in locked and thus RLIMIT_MEMLOCK
 had a single resource counter. After your patch RLIMIT_MEMLOCK is
 applied separately to both -- more or less.

On Tue, May 28, 2013 at 7:37 PM, Christoph Lameter c...@linux.com wrote:
 Before the patch the count was doubled since a single page was counted
 twice: Once because it was mlocked (marked with PG_mlock) and then again
 because it was also pinned (the refcount was increased). Two different things.

Pinned vs. mlocked counting isn't the problem here. You changed
RLIMIT_MEMLOCK userspace ABI and that needs to be restored. So the
question is how can we preserve the old RLIMIT_MEMLOCK semantics while
avoiding the double accounting issue.

Pekka
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC][PATCH] mm: Fix RLIMIT_MEMLOCK

2013-05-30 Thread KOSAKI Motohiro
 I'm unhappy you guys uses offensive word so much. Please cool down all
 you guys. :-/ In fact, _BOTH_ the behavior before and after Cristoph's
 patch doesn't have cleaner semantics.

 Erm, this feature _regressed_ after the patch. All other concerns are
 secondary. What's so difficult to understand about that?

Because it is not new commit at all. Christoph's patch was introduced
10 releases before.

$ git describe bc3e53f682
v3.1-7235-gbc3e53f

If we just revert it, we may get another and opposite regression
report. I'm worried
about it. Moreover, I don't think discussion better fix is too difficult for us.
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v2] IB/qib: add DCA support

2013-05-30 Thread Marciniszyn, Mike
 Subject: [PATCH v2] IB/qib: add DCA support
 

This version fixes a checkpatch long line and a qib_init() failure unwind issue.

Mike