From 3f0bee2502da5a0ded8a930c5cb74f9f3312b744 Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Tue, 23 Aug 2022 21:09:56 -0700 Subject: [PATCH] LU-15959 kernel: new kernel [SLES15 SP4 5.14.21-150400.24.18.1] This patch makes changes to support new SLES15 SP4 release with kernel 5.14.21-150400.24.18.1 for Lustre client. Test-Parameters: trivial clientdistro=sles15sp4 \ env=SANITY_EXCEPT="27J 244a" testlist=sanity Test-Parameters: trivial clientdistro=sles15sp3 Change-Id: I0bf548835578163767d2f6a2a5e5bd2b33154871 Co-Authored-By: Minh Diep Signed-off-by: Jian Yu Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/47696 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Yang Sheng Reviewed-by: Andreas Dilger --- contrib/lbuild/funcs.sh | 1 + contrib/lbuild/lbuild | 1 + contrib/lbuild/lbuild-sles | 9 +++--- contrib/lbuild/lbuild-sles12 | 1 + contrib/lbuild/lbuild-sles15 | 7 ++++ lustre/ChangeLog | 3 +- lustre/autoconf/lustre-core.m4 | 1 + .../targets/5.14-sles15sp4.target.in | 37 ++++++++++++++++++++++ .../kernel_patches/targets/5.3-sles15sp3.target.in | 1 + lustre/llite/vvp_internal.h | 3 +- lustre/llite/vvp_io.c | 11 +++++++ 11 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 lustre/kernel_patches/targets/5.14-sles15sp4.target.in diff --git a/contrib/lbuild/funcs.sh b/contrib/lbuild/funcs.sh index c33d6ad..f448e03 100644 --- a/contrib/lbuild/funcs.sh +++ b/contrib/lbuild/funcs.sh @@ -203,6 +203,7 @@ autodetect_target() { sles15.1) target="$(uname -r | cut -d . -f 1,2)-sles15sp1";; sles15.2) target="$(uname -r | cut -d . -f 1,2)-sles15sp2";; sles15.3) target="$(uname -r | cut -d . -f 1,2)-sles15sp3";; + sles15.4) target="$(uname -r | cut -d . -f 1,2)-sles15sp4";; fc18) target="3.x-fc18";; *) fatal 1 "I don't know what distro $distro is.\nEither update autodetect_target() or use the --target argument.";; esac diff --git a/contrib/lbuild/lbuild b/contrib/lbuild/lbuild index a95914b..86d0f62 100755 --- a/contrib/lbuild/lbuild +++ b/contrib/lbuild/lbuild @@ -1337,6 +1337,7 @@ EOF if ! $RPMBUILD $BUILD_TYPE \ ${FIND_REQUIRES:+--define "__find_requires $FIND_REQUIRES"} \ ${FIND_KSYMS_REQUIRES:+--define "__required_ksyms_requires $FIND_KSYMS_REQUIRES"} \ + ${MOFED_FLAVOR:+--define "flavors_to_build $MOFED_FLAVOR"} \ --define "_topdir ${TOPDIR}" --target ${TARGET_ARCH} \ --define "KVERSION ${linuxrelease}" \ --define "KMP 1" \ diff --git a/contrib/lbuild/lbuild-sles b/contrib/lbuild/lbuild-sles index f09bb98..3d287e3 100644 --- a/contrib/lbuild/lbuild-sles +++ b/contrib/lbuild/lbuild-sles @@ -7,7 +7,6 @@ BUILD_GEN+=".2" #LU-3337 add missing build files for sles11sp2 server DEVEL_KERNEL_TYPE="default-devel" RPM_HELPERS_DIR="/usr/lib/rpm" RMAC=$HOME/.rpmmacros -SUSE_MACROS=/etc/rpm/macros.kernel-source prepare_and_build_srpm() { @@ -106,10 +105,14 @@ resolve_arch() { find_linux_devel_paths() { local path="$1" local linuxobjpath=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$(resolve_arch $TARGET_ARCH $PATCHLESS)/$RPMSMPTYPE + local linuxmodpath=$path/lib/modules/${lnxmaj}${lnxmin}-${lnxrel}-$RPMSMPTYPE LINUX=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel} LINUXOBJ=$path/usr/src/linux-obj/$(resolve_arch $TARGET_ARCH $PATCHLESS)/$RPMSMPTYPE + # symlink the build and source to the local path instead of system's + ln -sf $linuxobjpath $linuxmodpath/build + ln -sf $LINUX $linuxmodpath/source # symlink the linux-obj to linux-version-obj ln -s $linuxobjpath $LINUXOBJ # We need to copy the headers from the source to the object tree for @@ -119,10 +122,8 @@ find_linux_devel_paths() { fi # We modify %kernel_module_package macro to use the linux obj # that lbuild install, not the OS installed /usr/src - sed -i -e "/^%kernel_module_package/,/^)}$/d" \ - -e "/^# A few cross-distro definitions/d" $RMAC sed -e "s/\/usr\/src/${path//\//\\/}\/usr\/src/" \ - -e "s/\/boot/${path//\//\\/}\/boot/" ${SUSE_MACROS} >> $RMAC + -e "s/\/boot/${path//\//\\/}\/boot/" ${SUSE_MACROS} > $RMAC return 0 } diff --git a/contrib/lbuild/lbuild-sles12 b/contrib/lbuild/lbuild-sles12 index 9233bab..92846de 100644 --- a/contrib/lbuild/lbuild-sles12 +++ b/contrib/lbuild/lbuild-sles12 @@ -8,6 +8,7 @@ BUILD_GEN+=".0" # This distro does not support zfs, so define WITH_ZFS # use words that make the bash log readable. WITH_ZFS="Zfs Not Supported" +SUSE_MACROS=/etc/rpm/macros.kernel-source source ${LBUILD_DIR}/lbuild-sles diff --git a/contrib/lbuild/lbuild-sles15 b/contrib/lbuild/lbuild-sles15 index 8a67932..8d79727 100644 --- a/contrib/lbuild/lbuild-sles15 +++ b/contrib/lbuild/lbuild-sles15 @@ -8,6 +8,7 @@ BUILD_GEN+=".0" # This distro does not support zfs, so define WITH_ZFS # use words that make the bash log readable. WITH_ZFS="Zfs Not Supported" +SUSE_MACROS=/usr/lib/rpm/macros.d/macros.kernel-source source ${LBUILD_DIR}/lbuild-sles @@ -29,6 +30,9 @@ kernel_srpm_location() { ;; esac ;; + 5.14) + kdir=updates-sles15.4-src + ;; esac site="http://mgmt/cobbler/repo_mirror/$kdir" @@ -153,6 +157,9 @@ find_linux_rpm-sles15() { ;; esac ;; + 5.14) + distro=sles15.4 + ;; esac base_dir=updates-basesystem-$distro-x86_64 diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 7d3d9bf..8aa38b1 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -29,7 +29,7 @@ TBD Whamcloud 5.14.0-70.22.1.el9 (RHEL9.0) 4.18.0-372.16.1.el8 (RHEL8.6) 5.4.0-37 (Ubuntu 20.04) - 5.3.18-59.27 (SLES15 SP3) + 5.14.21-150400.24.18 (SLES15 SP4) * Other clients known to build on these kernels at some point (others may also work): 3.10.0-862.14.4.el7 (RHEL7.5) 3.10.0-957.27.2.el7 (RHEL7.6) @@ -50,6 +50,7 @@ TBD Whamcloud 4.12.14-122.116 (SLES12 SP5) 4.12.14-197.75 (SLES15 SP1) 5.3.18-24.96 (SLES15 SP2) + 5.3.18-59.27 (SLES15 SP3) 4.4.0-131 (Ubuntu 16.04) 4.15.0-48 (Ubuntu 18.04) 5.8.0-53 (Ubuntu 20.04.2 HWE) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 0379f74..2353ae9 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -3311,6 +3311,7 @@ lustre/kernel_patches/targets/4.12-sles12sp5.target lustre/kernel_patches/targets/4.12-sles15sp1.target lustre/kernel_patches/targets/5.3-sles15sp2.target lustre/kernel_patches/targets/5.3-sles15sp3.target +lustre/kernel_patches/targets/5.14-sles15sp4.target lustre/kernel_patches/targets/3.x-fc18.target lustre/ldlm/Makefile lustre/ec/autoMakefile diff --git a/lustre/kernel_patches/targets/5.14-sles15sp4.target.in b/lustre/kernel_patches/targets/5.14-sles15sp4.target.in new file mode 100644 index 0000000..29fa0f6 --- /dev/null +++ b/lustre/kernel_patches/targets/5.14-sles15sp4.target.in @@ -0,0 +1,37 @@ +lnxmaj="5.14" +lnxmin=".21" +lnxrel="150400.24.18" +# use this when there is an "RPM fix" which means that the name of the +# (source) RPM has been updated but the version of the kernel inside the +# RPM is not also updated +rpmfix=".1" + +# this is the delimeter that goes before the "smp" at the end of the version +# defaults to empty +FLAVOR_DELIMITER="-" + +KERNEL_SRPM=kernel-source-${lnxmaj}${lnxmin}-${lnxrel}${rpmfix}.src.rpm +SERIES="" +VERSION=$lnxmaj +EXTRA_VERSION="${lnxmin#.}-${lnxrel}_lustre.@VERSION@" +LUSTRE_VERSION=@VERSION@ + +OFED_VERSION=inkernel + +BASE_ARCHS="i686 ppc x86_64 ia64 ppc64" +BIGMEM_ARCHS="" +BOOT_ARCHS="" +JENSEN_ARCHS="" +DEFAULT_ARCHS="i686 x86_64 ia64 ppc64" +BIGSMP_ARCHS="" +PSERIES64_ARCHS="ppc" +UP_ARCHS="" +SRC_ARCHS="" +#RPMSMPTYPE="smp" + +for cc in gcc ; do + if which $cc >/dev/null 2>/dev/null ; then + export CC=$cc + break + fi +done diff --git a/lustre/kernel_patches/targets/5.3-sles15sp3.target.in b/lustre/kernel_patches/targets/5.3-sles15sp3.target.in index 2786125..136f6a7 100644 --- a/lustre/kernel_patches/targets/5.3-sles15sp3.target.in +++ b/lustre/kernel_patches/targets/5.3-sles15sp3.target.in @@ -17,6 +17,7 @@ EXTRA_VERSION="${lnxmin#.}-${lnxrel}_lustre.@VERSION@" LUSTRE_VERSION=@VERSION@ OFED_VERSION=inkernel +MOFED_FLAVOR=default BASE_ARCHS="i686 ppc x86_64 ia64 ppc64" BIGMEM_ARCHS="" diff --git a/lustre/llite/vvp_internal.h b/lustre/llite/vvp_internal.h index f350e3f..76085ce 100644 --- a/lustre/llite/vvp_internal.h +++ b/lustre/llite/vvp_internal.h @@ -297,7 +297,8 @@ struct lu_object *vvp_object_alloc(const struct lu_env *env, int vvp_global_init(void); void vvp_global_fini(void); -#ifndef HAVE_ACCOUNT_PAGE_DIRTIED_EXPORT +#if !defined(HAVE_ACCOUNT_PAGE_DIRTIED_EXPORT) || \ +defined(HAVE_KALLSYMS_LOOKUP_NAME) extern unsigned int (*vvp_account_page_dirtied)(struct page *page, struct address_space *mapping); #endif diff --git a/lustre/llite/vvp_io.c b/lustre/llite/vvp_io.c index baf28af..9ae65ac 100644 --- a/lustre/llite/vvp_io.c +++ b/lustre/llite/vvp_io.c @@ -1021,6 +1021,16 @@ void vvp_set_pagevec_dirty(struct pagevec *pvec) for (i = 0; i < count; i++) __set_page_dirty_nobuffers(pvec->pages[i]); #else + /* + * In kernel 5.14.21, kallsyms_lookup_name is defined but + * account_page_dirtied is not exported. + */ + if (!vvp_account_page_dirtied) { + for (i = 0; i < count; i++) + __set_page_dirty_nobuffers(pvec->pages[i]); + goto end; + } + for (i = 0; i < count; i++) { page = pvec->pages[i]; @@ -1070,6 +1080,7 @@ void vvp_set_pagevec_dirty(struct pagevec *pvec) /* !PageAnon && !swapper_space */ __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); } +end: #endif EXIT; } -- 1.8.3.1