[knem-commits] master updated

Brice Goglin noreply at users.gforge.inria.fr
Wed Jul 31 17:53:42 CEST 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "KNEM".

The branch, master has been updated
       via  5f247d8a69e079dd4e68a1bf5b3757372cc3e818 (commit)
       via  0c5613fe23e7225aee1fbc5c5e731e6749823cf0 (commit)
      from  00da31c5c767632b44e238562c4c8d165bc99e2a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5f247d8a69e079dd4e68a1bf5b3757372cc3e818
Author: Brice Goglin <Brice.Goglin at inria.fr>
Date:   Wed Jul 31 17:51:31 2013 +0200

    check_kernel_headers.sh: reorder related checks together and slightly improve the output

diff --git a/driver/linux/check_kernel_headers.sh b/driver/linux/check_kernel_headers.sh
index 4478eb1..7aa7c1f 100755
--- a/driver/linux/check_kernel_headers.sh
+++ b/driver/linux/check_kernel_headers.sh
@@ -73,7 +73,7 @@ echo " */" >> ${TMP_CHECKS_NAME}
 echo "" >> ${TMP_CHECKS_NAME}
 
 # vmalloc_user appeared in 2.6.18 but was broken until 2.6.19
-echo -n "  checking (in kernel headers) vmalloc_user availability... "
+echo -n "  checking (in kernel headers) vmalloc_user() availability... "
 if grep "vmalloc_user *(" ${LINUX_HDR}/include/linux/vmalloc.h > /dev/null ; then
   if grep "LINUX_VERSION_CODE 132626" ${LINUX_BUILD}/include/linux/version.h > /dev/null 2>&1 ; then
     echo broken, ignoring
@@ -86,7 +86,7 @@ else
 fi
 
 # remap_vmalloc_range appeared in 2.6.18
-echo -n "  checking (in kernel headers) remap_vmalloc_range availability ... "
+echo -n "  checking (in kernel headers) remap_vmalloc_range() availability ... "
 if grep "remap_vmalloc_range *(" ${LINUX_HDR}/include/linux/vmalloc.h > /dev/null ; then
   echo "#define KNEM_HAVE_REMAP_VMALLOC_RANGE 1" >> ${TMP_CHECKS_NAME}
   echo yes
@@ -94,6 +94,15 @@ else
   echo no
 fi
 
+# get_user_pages_fast added in 2.6.27
+echo -n "  checking (in kernel headers) get_user_pages_fast() availability ... "
+if grep get_user_pages_fast ${LINUX_HDR}/include/linux/mm.h > /dev/null ; then
+  echo "#define KNEM_HAVE_GET_USER_PAGES_FAST 1" >> ${TMP_CHECKS_NAME}
+  echo yes
+else
+  echo no
+fi
+
 # cpumask_scnprintf uses a cpumask pointer starting in 2.6.29
 echo -n "  checking (in kernel headers) whether cpumask_scnprintf takes a cpumask pointer ... "
 if sed -ne '/static inline int cpumask_scnprintf(/,/)/p' ${LINUX_HDR}/include/linux/cpumask.h | grep "const struct cpumask *" > /dev/null ; then
@@ -104,7 +113,7 @@ else
 fi
 
 # cpumask_of_node added in 2.6.29
-echo -n "  checking (in kernel headers) cpumask_of_node availability ... "
+echo -n "  checking (in kernel headers) cpumask_of_node() availability ... "
 if grep cpumask_of_node ${LINUX_HDR}/include/asm-generic/topology.h > /dev/null ; then
   echo "#define KNEM_HAVE_CPUMASK_OF_NODE 1" >> ${TMP_CHECKS_NAME}
   echo yes
@@ -112,31 +121,8 @@ else
   echo no
 fi
 
-# dmaengine API reworked in 2.6.29
-echo -n "  checking (in kernel headers) the dmaengine interface ... "
-if test -e ${LINUX_HDR}/include/linux/dmaengine.h > /dev/null ; then
-  if grep dmaengine_get ${LINUX_HDR}/include/linux/dmaengine.h > /dev/null ; then
-    echo "#define KNEM_HAVE_DMA_ENGINE_API 1" >> ${TMP_CHECKS_NAME}
-    echo yes
-  else
-    echo "#define KNEM_HAVE_OLD_DMA_ENGINE_API 1" >> ${TMP_CHECKS_NAME}
-    echo "yes, the old one"
-  fi
-else
-  echo no
-fi
-
-# get_user_pages_fast added in 2.6.27
-echo -n "  checking (in kernel headers) get_user_pages_fast availability ... "
-if grep get_user_pages_fast ${LINUX_HDR}/include/linux/mm.h > /dev/null ; then
-  echo "#define KNEM_HAVE_GET_USER_PAGES_FAST 1" >> ${TMP_CHECKS_NAME}
-  echo yes
-else
-  echo no
-fi
-
 # cpumask_complement deprecates cpus_complement in 2.6.27, and the latter is removed in 2.6.32
-echo -n "  checking (in kernel headers) cpumask_complement ... "
+echo -n "  checking (in kernel headers) cpumask_complement() availability ... "
 if grep cpumask_complement ${LINUX_HDR}/include/linux/cpumask.h > /dev/null ; then
   echo "#define KNEM_HAVE_CPUMASK_COMPLEMENT 1" >> ${TMP_CHECKS_NAME}
   echo yes
@@ -146,7 +132,7 @@ fi
 
 # set_cpus_allowed_ptr added in 2.6.26, and set_cpus_allowed dropped in 2.6.34
 # set_cpus_allowed_ptr backported in redhat 5 kernels but not exported to modules
-echo -n "  checking (in kernel headers) set_cpus_allowed_ptr ... "
+echo -n "  checking (in kernel headers) set_cpus_allowed_ptr() ... "
 if grep set_cpus_allowed_ptr ${LINUX_HDR}/include/linux/sched.h > /dev/null ; then
   if grep "LINUX_VERSION_CODE 132626" ${LINUX_BUILD}/include/linux/version.h > /dev/null 2>&1 ; then
     echo broken, ignoring
@@ -167,6 +153,15 @@ else
   echo no
 fi
 
+# idr_preload added in 3.9
+echo -n "  checking (in kernel headers) idr_preload() availability ... "
+if grep idr_preload ${LINUX_HDR}/include/linux/idr.h > /dev/null ; then
+  echo "#define KNEM_HAVE_IDR_PRELOAD 1" >> ${TMP_CHECKS_NAME}
+  echo yes
+else
+  echo no
+fi
+
 # ida added in 2.6.23
 echo -n "  checking (in kernel headers) the ida interface ... "
 if grep ida_get_new ${LINUX_HDR}/include/linux/idr.h > /dev/null ; then
@@ -187,7 +182,7 @@ else
 fi
 
 # k[un]map_atomic doesn't want a type since 3.4
-echo -n "  checking (in kernel headers) whether kmap_atomic needs a type ... "
+echo -n "  checking (in kernel headers) whether kmap_atomic() needs a type ... "
 if grep KM_USER1 ${LINUX_HDR}/include/linux/highmem.h > /dev/null ; then
   echo "#define KNEM_HAVE_KMAP_ATOMIC_TYPE 1" >> ${TMP_CHECKS_NAME}
   echo yes
@@ -195,9 +190,23 @@ else
   echo no
 fi
 
+# dmaengine API reworked in 2.6.29
+echo -n "  checking (in kernel headers) the dmaengine interface ... "
+if test -e ${LINUX_HDR}/include/linux/dmaengine.h > /dev/null ; then
+  if grep dmaengine_get ${LINUX_HDR}/include/linux/dmaengine.h > /dev/null ; then
+    echo "#define KNEM_HAVE_DMA_ENGINE_API 1" >> ${TMP_CHECKS_NAME}
+    echo yes
+  else
+    echo "#define KNEM_HAVE_OLD_DMA_ENGINE_API 1" >> ${TMP_CHECKS_NAME}
+    echo "yes, the old one"
+  fi
+else
+  echo no
+fi
+
 # dma_async_memcpy_issue_pending removed in 3.9
 # dma_async_issue_pending added in the meantime
-echo -n "  checking (in kernel headers) dma_async_issue_pending availability ... "
+echo -n "  checking (in kernel headers) dma_async_issue_pending() availability ... "
 if grep dma_async_issue_pending ${LINUX_HDR}/include/linux/dmaengine.h > /dev/null ; then
   echo "#define KNEM_HAVE_DMA_ASYNC_ISSUE_PENDING 1" >> ${TMP_CHECKS_NAME}
   echo yes
@@ -207,7 +216,7 @@ fi
 
 # dma_async_memcpy_complete removed in 3.9
 # dma_async_is_tx_complete added in the meantime
-echo -n "  checking (in kernel headers) dma_async_is_tx_complete availability ... "
+echo -n "  checking (in kernel headers) dma_async_is_tx_complete() availability ... "
 if grep dma_async_is_tx_complete ${LINUX_HDR}/include/linux/dmaengine.h > /dev/null ; then
   echo "#define KNEM_HAVE_DMA_ASYNC_IS_TX_COMPLETE 1" >> ${TMP_CHECKS_NAME}
   echo yes
@@ -216,7 +225,7 @@ else
 fi
 
 # current_uid() added in 2.6.27
-echo -n "  checking (in kernel headers) current_uid availability ... "
+echo -n "  checking (in kernel headers) current_uid() availability ... "
 if grep current_uid ${LINUX_HDR}/include/linux/cred.h > /dev/null ; then
   echo "#define KNEM_HAVE_CURRENT_UID 1" >> ${TMP_CHECKS_NAME}
   echo yes
@@ -225,7 +234,7 @@ else
 fi
 
 # printk_once() added in TODO
-echo -n "  checking (in kernel headers) printk_once availability ... "
+echo -n "  checking (in kernel headers) printk_once() availability ... "
 if grep printk_once ${LINUX_HDR}/include/linux/kernel.h ${LINUX_HDR}/include/linux/printk.h > /dev/null 2>/dev/null ; then
   echo "#define KNEM_HAVE_PRINTK_ONCE 1" >> ${TMP_CHECKS_NAME}
   echo yes
@@ -233,15 +242,6 @@ else
   echo no
 fi
 
-# idr_preload added in 3.9
-echo -n "  checking (in kernel headers) idr_preload availability ... "
-if grep idr_preload ${LINUX_HDR}/include/linux/idr.h > /dev/null ; then
-  echo "#define KNEM_HAVE_IDR_PRELOAD 1" >> ${TMP_CHECKS_NAME}
-  echo yes
-else
-  echo no
-fi
-
 # add the footer
 echo "" >> ${TMP_CHECKS_NAME}
 echo "#endif /* __knem_checks_h__ */" >> ${TMP_CHECKS_NAME}

commit 0c5613fe23e7225aee1fbc5c5e731e6749823cf0
Author: Brice Goglin <Brice.Goglin at inria.fr>
Date:   Wed Jul 31 17:31:11 2013 +0200

    Warn (once) if we get a DMA channel that is far from the calling CPU
    
    Only enabled when cpumask_of_node() is available (added in 2.6.29).
    
    cpumask_test_cpu() is a core function of the new cpumask API added
    in 2.6.28. It's unlikely that somebody has cpumask_of_node() without
    cpumask_test_cpu(), so we don't check for the latter.
    
    dev_to_node() was added in 2.6.20, we don't check it either because
    it's very unlikely that a CPU has cpumask_of_node() without dev_to_node().

diff --git a/driver/linux/check_kernel_headers.sh b/driver/linux/check_kernel_headers.sh
index 265ebec..4478eb1 100755
--- a/driver/linux/check_kernel_headers.sh
+++ b/driver/linux/check_kernel_headers.sh
@@ -103,6 +103,15 @@ else
   echo no
 fi
 
+# cpumask_of_node added in 2.6.29
+echo -n "  checking (in kernel headers) cpumask_of_node availability ... "
+if grep cpumask_of_node ${LINUX_HDR}/include/asm-generic/topology.h > /dev/null ; then
+  echo "#define KNEM_HAVE_CPUMASK_OF_NODE 1" >> ${TMP_CHECKS_NAME}
+  echo yes
+else
+  echo no
+fi
+
 # dmaengine API reworked in 2.6.29
 echo -n "  checking (in kernel headers) the dmaengine interface ... "
 if test -e ${LINUX_HDR}/include/linux/dmaengine.h > /dev/null ; then
@@ -215,6 +224,15 @@ else
   echo no
 fi
 
+# printk_once() added in TODO
+echo -n "  checking (in kernel headers) printk_once availability ... "
+if grep printk_once ${LINUX_HDR}/include/linux/kernel.h ${LINUX_HDR}/include/linux/printk.h > /dev/null 2>/dev/null ; then
+  echo "#define KNEM_HAVE_PRINTK_ONCE 1" >> ${TMP_CHECKS_NAME}
+  echo yes
+else
+  echo no
+fi
+
 # idr_preload added in 3.9
 echo -n "  checking (in kernel headers) idr_preload availability ... "
 if grep idr_preload ${LINUX_HDR}/include/linux/idr.h > /dev/null ; then
diff --git a/driver/linux/knem_hal.h b/driver/linux/knem_hal.h
index 0e33bda..cfd11f4 100644
--- a/driver/linux/knem_hal.h
+++ b/driver/linux/knem_hal.h
@@ -265,4 +265,18 @@ typedef struct work_struct * knem_work_struct_data_t;
 #define dma_async_is_tx_complete dma_async_memcpy_complete
 #endif
 
+/* printk_once added in 2.6.30 */
+#ifndef KNEM_HAVE_PRINTK_ONCE
+#define knem_printk_once(x...) do {	\
+  static ___once = 0;			\
+  if (!___once) {			\
+    ___once = 1;			\
+    printk(x);				\
+  }					\
+while (0)
+#else
+#define knem_printk_once printk_once
+#endif
+
+
 #endif /* __knem_hal_h__ */
diff --git a/driver/linux/knem_main.c b/driver/linux/knem_main.c
index 9594eae..51ad1e0 100644
--- a/driver/linux/knem_main.c
+++ b/driver/linux/knem_main.c
@@ -2682,6 +2682,15 @@ knem_miscdev_open(struct inode * inode, struct file * file)
 		INIT_LIST_HEAD(&ctx->dmacpy_cleanup_work_list);
 		spin_lock_init(&ctx->dmacpy_cleanup_work_lock);
 		setup_timer(&ctx->dmacpy_cleanup_timer, knem_dmacpy_cleanup_timer_handler, (unsigned long) ctx);
+#if (defined CONFIG_NUMA) && (defined KNEM_HAVE_CPUMASK_OF_NODE)
+		{
+			int node = dev_to_node(ctx->dmacpy_chan->device->dev);
+			int cpu = smp_processor_id();
+			if (node != -1 && !cpumask_test_cpu(smp_processor_id(), cpumask_of_node(node)))
+				knem_printk_once("knem: got remote chan %s (close to node %d) from processor %d\n",
+						 dma_chan_name(ctx->dmacpy_chan), node, cpu);
+		}
+#endif
 	}
 #endif
 

-----------------------------------------------------------------------

Summary of changes:
 driver/linux/check_kernel_headers.sh |   78 +++++++++++++++++++++-------------
 driver/linux/knem_hal.h              |   14 ++++++
 driver/linux/knem_main.c             |    9 ++++
 3 files changed, 71 insertions(+), 30 deletions(-)


hooks/post-receive
-- 
KNEM



More information about the knem-commits mailing list