Whamcloud - gitweb
LU-16976 ldiskfs: add support for openEuler 22.03 SP2 53/51753/6
authorXinliang Liu <xinliang.liu@linaro.org>
Tue, 18 Jul 2023 03:42:19 +0000 (03:42 +0000)
committerOleg Drokin <green@whamcloud.com>
Tue, 26 Sep 2023 14:34:19 +0000 (14:34 +0000)
Add ldiskfs server support for oe2203sp2.
Sync with ldiskfs-5.14-rhel9.2.series adding missing patches.
Also refine openEuler lbuild scripts.

Change-Id: I91841a7140a9f8f3182a4a329b9f04639a85e94d
Test-Parameters: trivial
Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51753
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
13 files changed:
config/lustre-build-ldiskfs.m4
contrib/lbuild/funcs.sh
contrib/lbuild/lbuild
contrib/lbuild/lbuild-oe2203 [changed from file to symlink]
contrib/lbuild/lbuild-oe2203sp1 [deleted file]
contrib/lbuild/lbuild-openeuler [new file with mode: 0644]
ldiskfs/kernel_patches/patches/oe2203/ext4-add-periodic-superblock-update.patch [new file with mode: 0644]
ldiskfs/kernel_patches/patches/oe2203/ext4-dquot-commit-speedup.patch [new file with mode: 0644]
ldiskfs/kernel_patches/series/ldiskfs-5.10.0-oe2203.series
ldiskfs/kernel_patches/series/ldiskfs-5.10.0-oe2203sp1.series
lustre/ChangeLog
lustre/autoconf/lustre-core.m4
lustre/kernel_patches/targets/5.10-oe2203sp2.target.in [new file with mode: 0644]

index f71ee0d..0b1cde8 100644 (file)
@@ -156,7 +156,7 @@ AS_IF([test x$RHEL_KERNEL = xyes], [
 ], [test x$OPENEULER_KERNEL = xyes], [
        case $OPENEULER_VERSION_NO in
        2203.0) LDISKFS_SERIES="5.10.0-oe2203.series" ;;
-       2203.1) LDISKFS_SERIES="5.10.0-oe2203sp1.series" ;;
+       2203.*) LDISKFS_SERIES="5.10.0-oe2203sp1.series" ;;
        esac
 ])
 ])
index 8db9532..78389a5 100644 (file)
@@ -165,7 +165,7 @@ autodetect_distro() {
                if [[ "$lts_sp" != "n/a" ]]; then
                        lts_sp=${lts_sp##*-}
                        lts_sp=${lts_sp,,}
-                       version="${version}${lts_sp}"
+                       version="${version}.${lts_sp}"
                fi
                ;;
             *)
@@ -222,7 +222,8 @@ autodetect_target() {
        sles15.4) target="$(uname -r | cut -d . -f 1,2)-sles15sp4";;
           fc18)   target="3.x-fc18";;
          oe2203) target="5.10-oe2203";;
-       oe2203sp1) target="5.10-oe2203sp1";;
+       oe2203.sp1) target="5.10-oe2203sp1";;
+       oe2203.sp2) target="5.10-oe2203sp2";;
              *)   fatal 1 "I don't know what distro $distro is.\nEither update autodetect_target() or use the --target argument.";;
     esac
 
index 70ef15b..49303f3 100755 (executable)
@@ -329,12 +329,9 @@ check_options() {
                3.0-sles11)
                        CANONICAL_TARGET="sles11"
                        ;;
-               5.10-oe2203)
+               5.10-oe2203*)
                        CANONICAL_TARGET="oe2203"
                        ;;
-               5.10-oe2203sp1)
-                       CANONICAL_TARGET="oe2203sp1"
-                       ;;
        esac
 
     local timestampnodig=$(echo $TIMESTAMP | sed -e s/[0-9]*//g)
deleted file mode 100644 (file)
index 1f4dc54947c70f89173ffed7e60740888e7d6541..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1,39 +0,0 @@
-source ${LBUILD_DIR}/lbuild-rhel
-
-# increment this if you have made a change that should force a new kernel
-# to build built
-BUILD_GEN+=".0"
-
-SPEC_NAME="kernel.spec"
-DEVEL_PATH_ARCH_DELIMETER="."
-USE_KABI=false
-RPM_HELPERS_DIR="/usr/lib/rpm/openEuler"
-# Pkg which contains ext4 source code
-KERNEL_DEBUGINFO="kernel-debugsource-${lnxmaj}-${lnxrel}.${TARGET_ARCH}.rpm"
-
-# force local definition of %dist into ~/.rpmmacros
-# to avoid verbose extended strings like ".el9.centos"
-# in kernel version and rpm names
-#
-RMAC=$HOME/.rpmmacros
-grep '^%dist' $RMAC &> /dev/null || echo '%dist .oe2203' >> $RMAC
-
-unpack_linux_devel_rpm-oe2203() {
-       local callers_rpm="$1"
-
-       unpack_linux_devel_rpm-rhel "$callers_rpm"
-}
-
-find_linux_rpm-oe2203() {
-       local prefix="$1"
-       local wanted_kernel="$2"
-       local pathtorpms=${3:-"$KERNELRPMSBASE/$lnxmaj/$DISTROMAJ/$TARGET_ARCH"}
-
-       find_linux_rpm-rhel "$prefix" "$wanted_kernel" "$pathtorpms"
-}
-
-kernel_debuginfo_location() {
-       local base_os="https://repo.openeuler.org/openEuler-22.03-LTS"
-
-       echo "$base_os/update/$TARGET_ARCH/Packages/"
-}
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..4f83bd2f913e0b051d10c45ed32b33bc26071cb7
--- /dev/null
@@ -0,0 +1 @@
+lbuild-openeuler
\ No newline at end of file
diff --git a/contrib/lbuild/lbuild-oe2203sp1 b/contrib/lbuild/lbuild-oe2203sp1
deleted file mode 100644 (file)
index b115a34..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-source ${LBUILD_DIR}/lbuild-rhel
-
-# increment this if you have made a change that should force a new kernel
-# to build built
-BUILD_GEN+=".0"
-
-SPEC_NAME="kernel.spec"
-DEVEL_PATH_ARCH_DELIMETER="."
-USE_KABI=false
-RPM_HELPERS_DIR="/usr/lib/rpm/openEuler"
-# Pkg which contains ext4 source code
-KERNEL_DEBUGINFO="kernel-debugsource-${lnxmaj}-${lnxrel}.${TARGET_ARCH}.rpm"
-DISTRO_REPO_MIRROR=${DISTRO_REPO_MIRROR:-"https://repo.openeuler.org"}
-
-# force local definition of %dist into ~/.rpmmacros
-# to avoid verbose extended strings like ".el9.centos"
-# in kernel version and rpm names
-#
-RMAC=$HOME/.rpmmacros
-grep '^%dist' $RMAC &> /dev/null || echo '%dist .oe2203sp1' >> $RMAC
-
-unpack_linux_devel_rpm-oe2203sp1() {
-       local callers_rpm="$1"
-
-       unpack_linux_devel_rpm-rhel "$callers_rpm"
-}
-
-find_linux_rpm-oe2203sp1() {
-       local prefix="$1"
-       local wanted_kernel="$2"
-       local pathtorpms=${3:-"$KERNELRPMSBASE/$lnxmaj/$DISTROMAJ/$TARGET_ARCH"}
-
-       find_linux_rpm-rhel "$prefix" "$wanted_kernel" "$pathtorpms"
-}
-
-kernel_debuginfo_location() {
-       local base_os="$DISTRO_REPO_MIRROR/openEuler-22.03-LTS-SP1"
-
-       echo "$base_os/update/$TARGET_ARCH/Packages/"
-}
diff --git a/contrib/lbuild/lbuild-openeuler b/contrib/lbuild/lbuild-openeuler
new file mode 100644 (file)
index 0000000..35845f3
--- /dev/null
@@ -0,0 +1,42 @@
+# vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4:
+source ${LBUILD_DIR}/lbuild-rhel
+
+DEVEL_PATH_ARCH_DELIMETER="."
+RPM_HELPERS_DIR="/usr/lib/rpm/openEuler"
+# Pkg which contains ext4 source code
+KERNEL_DEBUGINFO="kernel-debugsource-${lnxmaj}-${lnxrel}.${TARGET_ARCH}.rpm"
+
+# force local definition of %dist into ~/.rpmmacros
+# to avoid verbose extended strings like ".el9.centos"
+# in kernel version and rpm names
+RMAC=$HOME/.rpmmacros
+grep '^%dist' $RMAC &> /dev/null || echo "%dist .${DISTRO/./}" >> $RMAC
+
+kernel_debuginfo_location() {
+       local base_url="https://repo.openeuler.org"
+       local distro=${DISTRO^^}
+    # convert OEYYMM.SPx to openEuler-YY.MM-LTS-SPx
+    distro=$(echo $distro | sed -E -e 's/OE/openEuler-/' \
+                -e 's/([0-9]{2})([0-9]{2})/\1.\2-/' \
+                -e 's/.(SP[0-9]+)/LTS-\1/')
+
+       echo "${base_url}/${distro}/update/$TARGET_ARCH/Packages"
+}
+
+
+eval "$(cat <<EOF
+unpack_linux_devel_rpm-${DISTROMAJ}() {
+    local callers_rpm="\$1"
+
+    unpack_linux_devel_rpm-rhel "\$callers_rpm"
+}
+
+find_linux_rpm-${DISTROMAJ}() {
+       local prefix="\$1"
+       local wanted_kernel="\$2"
+       local pathtorpms=\${3:-"\$KERNELRPMSBASE/\$lnxmaj/\$DISTROMAJ/\$TARGET_ARCH"}
+
+       find_linux_rpm-rhel "\$prefix" "\$wanted_kernel" "\$pathtorpms"
+}
+EOF
+)"
diff --git a/ldiskfs/kernel_patches/patches/oe2203/ext4-add-periodic-superblock-update.patch b/ldiskfs/kernel_patches/patches/oe2203/ext4-add-periodic-superblock-update.patch
new file mode 100644 (file)
index 0000000..53bbb95
--- /dev/null
@@ -0,0 +1,93 @@
+From 0f2ea2fa4bdbfff08778626aed8879bbe7a73d26 Mon Sep 17 00:00:00 2001
+From: Xinliang Liu <xinliang.liu@linaro.org>
+Date: Fri, 1 Sep 2023 08:30:38 +0000
+Subject: [PATCH] ext4: Add periodic superblock update check
+
+This patch introduces a mechanism to periodically check and update
+the superblock within the ext4 file system. The main purpose of this
+patch is to keep the disk superblock up to date. The update will be
+performed if more than one hour has passed since the last update, and
+if more than 16MB of data have been written to disk.
+
+This check and update is performed within the ext4_journal_commit_callback
+function, ensuring that the superblock is written while the disk is
+active, rather than based on a timer that may trigger during disk idle
+periods.
+
+Signed-off-by: Vitaliy Kuznetsov <vk.en.mail@gmail.com>
+Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
+---
+ fs/ext4/super.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 50 insertions(+)
+
+diff --git a/fs/ext4/super.c b/fs/ext4/super.c
+index af00b96..23d9158 100644
+--- a/fs/ext4/super.c
++++ b/fs/ext4/super.c
+@@ -439,6 +439,55 @@ static int block_device_ejected(struct super_block *sb)
+       return bdi->dev == NULL;
+ }
++#define EXT4_SB_REFRESH_INTERVAL_SEC (3600) /* seconds (1 hour) */
++#define EXT4_SB_REFRESH_INTERVAL_KB (16384) /* kilobytes (16MB) */
++
++/*
++ * The ext4_maybe_update_superblock() function checks and updates the
++ * superblock if needed.
++ *
++ * This function is designed to update the on-disk superblock only under
++ * certain conditions to prevent excessive disk writes and unnecessary
++ * waking of the disk from sleep. The superblock will be updated if:
++ * 1. More than an hour has passed since the last superblock update, and
++ * 2. More than 16MB have been written since the last superblock update.
++ *
++ * @sb: The superblock
++ */
++static void ext4_maybe_update_superblock(struct super_block *sb)
++{
++      struct ext4_sb_info *sbi = EXT4_SB(sb);
++      struct ext4_super_block *es = sbi->s_es;
++      time64_t now;
++      __u64 last_update;
++      __u64 lifetime_write_kbytes;
++      __u64 diff_size;
++
++      if (sb_rdonly(sb))
++              return;
++
++      now = ktime_get_real_seconds();
++      last_update = ext4_get_tstamp(es, s_wtime);
++
++      if (likely(now - last_update < EXT4_SB_REFRESH_INTERVAL_SEC))
++              return;
++
++      lifetime_write_kbytes = sbi->s_kbytes_written +
++              ((part_stat_read(sb->s_bdev->bd_part, sectors[STAT_WRITE]) -
++                sbi->s_sectors_written_start) >> 1);
++
++      /* Get the number of kilobytes not written to disk to account
++       * for statistics and compare with a multiple of 16 MB. This
++       * is used to determine when the next superblock commit should
++       * occur (i.e. not more often than once per 16MB if there was
++       * less written in an hour).
++       */
++      diff_size = lifetime_write_kbytes - le64_to_cpu(es->s_kbytes_written);
++
++      if (diff_size > EXT4_SB_REFRESH_INTERVAL_KB)
++              schedule_work(&EXT4_SB(sb)->s_error_work);
++}
++
+ static void ext4_journal_commit_callback(journal_t *journal, transaction_t *txn)
+ {
+       struct super_block              *sb = journal->j_private;
+@@ -449,6 +498,7 @@ static void ext4_journal_commit_callback(journal_t *journal, transaction_t *txn)
+       BUG_ON(txn->t_state == T_FINISHED);
+       ext4_process_freed_data(sb, txn->t_tid);
++      ext4_maybe_update_superblock(sb);
+       spin_lock(&sbi->s_md_lock);
+       while (!list_empty(&txn->t_private_list)) {
+-- 
+2.33.0
+
diff --git a/ldiskfs/kernel_patches/patches/oe2203/ext4-dquot-commit-speedup.patch b/ldiskfs/kernel_patches/patches/oe2203/ext4-dquot-commit-speedup.patch
new file mode 100644 (file)
index 0000000..7c843c7
--- /dev/null
@@ -0,0 +1,26 @@
+From 2f0c38b500b76273f2674276b3af721702210d9a Mon Sep 17 00:00:00 2001
+From: Xinliang Liu <xinliang.liu@linaro.org>
+Date: Fri, 1 Sep 2023 04:40:23 +0000
+Subject: [PATCH] ext4: dquot commit speedup
+
+Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
+---
+ fs/ext4/super.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/fs/ext4/super.c b/fs/ext4/super.c
+index 59d219a..4af616e 100644
+--- a/fs/ext4/super.c
++++ b/fs/ext4/super.c
+@@ -6409,6 +6409,8 @@ static int ext4_mark_dquot_dirty(struct dquot *dquot)
+       /* Are we journaling quotas? */
+       if (ext4_has_feature_quota(sb) ||
+           sbi->s_qf_names[USRQUOTA] || sbi->s_qf_names[GRPQUOTA]) {
++              if (test_bit(DQ_MOD_B, &dquot->dq_flags))
++                      return 0;
+               dquot_mark_dquot_dirty(dquot);
+               return ext4_write_dquot(dquot);
+       } else {
+-- 
+2.33.0
+
index d5b0e8f..fdf44ca 100644 (file)
@@ -32,4 +32,3 @@ linux-5.8/ext4-enc-flag.patch
 oe2203/ext4-delayed-iput.patch
 linux-5.10/ext4-fiemap-kernel-data.patch
 rhel8/ext4-old_ea_inodes_handling_fix.patch
-rhel8/ext4-encdata.patch
index ab90afa..25418dc 100644 (file)
@@ -23,13 +23,15 @@ rhel7.6/ext4-export-orphan-add.patch
 linux-5.8/ext4-export-mb-stream-allocator-variables.patch
 ubuntu19/ext4-iget-with-flags.patch
 linux-5.4/export-ext4fs-dirhash-helper.patch
-ubuntu20.04.3/ext4-simple-blockalloc.patch
-linux-5.14/ext4-xattr-disable-credits-check.patch
 linux-5.8/ext4-no-max-dir-size-limit-for-iam-objects.patch
+oe2203/ext4-dquot-commit-speedup.patch
 rhel8/ext4-ialloc-uid-gid-and-pass-owner-down.patch
 base/ext4-projid-xattrs.patch
-linux-5.8/ext4-enc-flag.patch
 oe2203/ext4-delayed-iput.patch
+rhel8/ext4-ext-merge.patch
+linux-5.14/ext4-xattr-disable-credits-check.patch
 linux-5.10/ext4-fiemap-kernel-data.patch
 rhel8/ext4-old_ea_inodes_handling_fix.patch
-rhel8/ext4-encdata.patch
+linux-5.8/ext4-enc-flag.patch
+ubuntu20.04.3/ext4-simple-blockalloc.patch
+oe2203/ext4-add-periodic-superblock-update.patch
index 875373c..006fe47 100644 (file)
@@ -30,6 +30,7 @@ TBD Whamcloud
          vanilla linux 5.4.136  (ZFS + ldiskfs)
          5.10.0-60.94.0.118.oe2203 (openEuler 22.03 LTS)
          5.10.0-136.32.0.108.oe2203sp1 (openEuler 22.03 LTS SP1)
+         5.10.0-153.19.0.95.oe2203sp2 (openEuler 22.03 LTS SP2)
        * ldiskfs needs an ldiskfs patch series for that kernel, ZFS does not
        * Client primary kernels built and tested during release cycle:
          5.14.0-284.25.1.el9  (RHEL9.2)
index 558c503..d72b428 100644 (file)
@@ -4890,6 +4890,7 @@ lustre/kernel_patches/targets/5.14-sles15sp4.target
 lustre/kernel_patches/targets/3.x-fc18.target
 lustre/kernel_patches/targets/5.10-oe2203.target
 lustre/kernel_patches/targets/5.10-oe2203sp1.target
+lustre/kernel_patches/targets/5.10-oe2203sp2.target
 lustre/ldlm/Makefile
 lustre/ldlm/autoMakefile
 lustre/ec/autoMakefile
diff --git a/lustre/kernel_patches/targets/5.10-oe2203sp2.target.in b/lustre/kernel_patches/targets/5.10-oe2203sp2.target.in
new file mode 100644 (file)
index 0000000..805f11c
--- /dev/null
@@ -0,0 +1,21 @@
+lnxmaj="5.10.0"
+lnxrel="153.19.0.95.oe2203sp2"
+
+KERNEL_SRPM=kernel-${lnxmaj}-${lnxrel}.src.rpm
+SERIES=""
+EXTRA_VERSION=${lnxrel}_lustre.@VERSION@
+LUSTRE_VERSION=@VERSION@
+
+DEVEL_PATH_ARCH_DELIMETER="."
+OFED_VERSION=inkernel
+
+#SMP_ARCHS="i686 x86_64 ia64 ppc64"
+# openEuler doesn't use smp specific kernels
+SMP_ARCHS=""
+
+for cc in gcc ; do
+    if which $cc >/dev/null 2>/dev/null ; then
+        export CC=$cc
+        break
+    fi
+done