Hi Marc,

Thanks for the fixes!  I've made some comments inline.

On Apr 27, 2007, at 9:01 AM, Marc Aurele La France wrote:

Hi,

I recently finished an exercise of building PVFS2 from source for a few
different kernels.  The following are changes I ended up with.  A copy
of this note is included as a compressed attachment should it be
mangled in transit.

==

1) Recent kernels store UTS_RELEASE in <linux/utsrelease.h>, not
   <linux/version.h>.  The following works for both cases.


diff -aNpru pvfs-2.6.3/Makefile.in devel/Makefile.in
--- pvfs-2.6.3/Makefile.in      2007-04-09 08:54:37.000000000 -0600
+++ devel/Makefile.in   2007-04-26 07:36:24.000000000 -0600
@@ -873,9 +873,9 @@ endif

 ifneq (,$(LINUX_KERNEL_SRC))

-NUM_UTS_LINES := $(shell grep -c UTS_RELEASE $(LINUX_KERNEL_SRC)/ include/linux/version.h)
-ifeq ($(NUM_UTS_LINES),1)
- KERNEL_VERS := $(shell grep UTS_RELEASE $(LINUX_KERNEL_SRC)/ include/linux/version.h | cut -d\" -f2) +UTS_LINE := $(shell grep UTS_RELEASE $(LINUX_KERNEL_SRC)/include/ linux/*.h | grep define)
+ifneq (,$(UTS_LINE))
+ KERNEL_VERS := $(shell grep UTS_RELEASE $(LINUX_KERNEL_SRC)/ include/linux/*.h | grep define | cut -d\" -f2)
 else
     KERNEL_VERS := $(shell uname -r)
 endif

==

2) As currently coded, the check for whether or not the kernel declares a
   struct kmem_cache, can never fail.  This replaces that check with
   one that works for older kernels that don't declare a struct
   kmem_cache.


diff -aNpru pvfs-2.6.3/maint/config/kernel.m4 devel/maint/config/ kernel.m4 --- pvfs-2.6.3/maint/config/kernel.m4 2007-04-09 08:54:37.000000000 -0600
+++ devel/maint/config/kernel.m4        2007-04-26 08:30:29.000000000 -0600
@@ -114,15 +114,12 @@ AC_DEFUN([AX_KERNEL_FEATURES],

        dnl 2.6.20 deprecated kmem_cache_t
        AC_MSG_CHECKING(for struct kmem_cache in kernel)
-       AC_TRY_COMPILE([
-               #define __KERNEL__
-               #include <linux/slab.h>
-               static struct kmem_cache;
-       ], [],
+ if test "`grep 'struct kmem_cache ' $lk_src/include/linux/ slab.h`"; then
                AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_STRUCT_KMEM_CACHE, 1, Define if struct kmem_cache is defined in kernel), + AC_DEFINE(HAVE_STRUCT_KMEM_CACHE, 1, Define if struct kmem_cache is defined in kernel)
+       else
                AC_MSG_RESULT(no)
-       )
+       fi

I'd prefer to fix the check for kmem_cache in TRY_COMPILE, rather than grep. We should be able to add some bits to the second parameter to TRY_COMPILE. Probably something like:

AC_TRY_COMPILE([
                #define __KERNEL__
                #include <linux/slab.h>
                static struct kmem_cache;
        ],
        [
                struct kmem_cache *c;
                c = kmem_cache_create(NULL, 0, 0, 0, NULL, NULL);
        ],
        ...



        dnl 2.6.20 removed SLAB_KERNEL.  Need to use GFP_KERNEL instead
        AC_MSG_CHECKING(for SLAB_KERNEL flag in kernel)

==

3) statecomp should unlink its output file before attempting to
   overwrite it.  This allows for building PVFS2 in a shadow tree and
   leave the base tree it points to untouched.


Seems fine. I do out of tree builds all the time though, so I'm curious how this broke for you. Are you creating symlinks of the pvfs tree or something?

Thanks again!

-sam


diff -aNpru pvfs-2.6.3/src/common/statecomp/statecomp.c devel/src/ common/statecomp/statecomp.c --- pvfs-2.6.3/src/common/statecomp/statecomp.c 2007-04-09 08:54:37.000000000 -0600 +++ devel/src/common/statecomp/statecomp.c 2007-04-26 08:20:08.000000000 -0600
@@ -139,6 +139,7 @@ static void parse_args(int argc, char **
        strcpy (file_name, argv[optind]);
        file_name[file_name_size-3] = 'c';
        file_name[file_name_size-2] = 0;
+       unlink(file_name);
        /* open output file */
        if (!(out_file = fopen(file_name, "w")))
        {
@@ -149,6 +150,7 @@ static void parse_args(int argc, char **
        free(file_name);
     }
     else {
+       unlink(argv[optind+1]);
        if (!(out_file = fopen(argv[optind+1], "w")))
        {
            /* error opening output file */

==

Thanks.

Marc.

+---------------------------------- +----------------------------------+ | Marc Aurele La France | work: 1-780-492-9310 | | Academic Information and | fax: 1-780-492-1729 | | Communications Technologies | email: [EMAIL PROTECTED] | | 352 General Services Building +----------------------------------+ | University of Alberta | | | Edmonton, Alberta | Standard disclaimers apply | | T6G 2H1 | | | CANADA | | +---------------------------------- +----------------------------------+
XFree86 developer and VP.  ATI driver and X server internals.
<pvfs-2.6.3.udiff.gz>
_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers

_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers

Reply via email to