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>
], [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
])
])
if [[ "$lts_sp" != "n/a" ]]; then
lts_sp=${lts_sp##*-}
lts_sp=${lts_sp,,}
- version="${version}${lts_sp}"
+ version="${version}.${lts_sp}"
fi
;;
*)
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
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)
+++ /dev/null
-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/"
-}
--- /dev/null
+lbuild-openeuler
\ No newline at end of file
+++ /dev/null
-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/"
-}
--- /dev/null
+# 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
+)"
--- /dev/null
+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
+
--- /dev/null
+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
+
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
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
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)
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
--- /dev/null
+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