Re: Fwd: [6.5.1] Slow boot and opening files (RIP: kvfree_rcu_bulk)

From: Uladzislau Rezki
Date: Tue Sep 05 2023 - 14:01:41 EST


>
> For a comparison, I've attached a journalctl log for my custom 6.4.14 Kernel.
>
1. I tried to apply your patches on stable 6.5.1 kernel. All of them can be
applied except of one. Its name is 0001-ms178.patch and it produces below
rejects:

<snip>
arch/alpha/kernel/syscalls/syscall.tbl.rej
arch/arm/tools/syscall.tbl.rej
arch/arm64/include/asm/unistd.h.rej
arch/arm64/include/asm/unistd32.h.rej
arch/ia64/kernel/syscalls/syscall.tbl.rej
arch/m68k/kernel/syscalls/syscall.tbl.rej
arch/microblaze/kernel/syscalls/syscall.tbl.rej
arch/mips/kernel/syscalls/syscall_n32.tbl.rej
arch/mips/kernel/syscalls/syscall_n64.tbl.rej
arch/mips/kernel/syscalls/syscall_o32.tbl.rej
arch/parisc/kernel/syscalls/syscall.tbl.rej
arch/powerpc/kernel/syscalls/syscall.tbl.rej
arch/s390/kernel/syscalls/syscall.tbl.rej
arch/sh/kernel/syscalls/syscall.tbl.rej
arch/sparc/kernel/syscalls/syscall.tbl.rej
arch/x86/entry/syscalls/syscall_32.tbl.rej
arch/x86/entry/syscalls/syscall_64.tbl.rej
arch/xtensa/kernel/syscalls/syscall.tbl.rej
include/uapi/asm-generic/unistd.h.rej
<snip>

But let's skip that part.

2. One of patches also modifies the kernel/rcu/tree.c file:

<snip>
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 1449cb69a0e0..fbc20c6cdbeb 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -2810,6 +2810,7 @@ struct kfree_rcu_cpu_work {

/**
* struct kfree_rcu_cpu - batch up kfree_rcu() requests for RCU grace period
+ * @gp_snap: The GP snapshot recorded at the last scheduling of monitor work.
* @head: List of kfree_rcu() objects not yet waiting for a grace period
* @head_gp_snap: Snapshot of RCU state for objects placed to "@head"
* @bulk_head: Bulk-List of kvfree_rcu() objects not yet waiting for a grace period
@@ -2849,6 +2850,7 @@ struct kfree_rcu_cpu {
struct kfree_rcu_cpu_work krw_arr[KFREE_N_BATCHES];
raw_spinlock_t lock;
struct delayed_work monitor_work;
+ unsigned long gp_snap;
bool initialized;

struct delayed_work page_cache_work;
@@ -3095,6 +3097,7 @@ schedule_delayed_monitor_work(struct kfree_rcu_cpu *krcp)
mod_delayed_work(system_wq, &krcp->monitor_work, delay);
return;
}
+ krcp->gp_snap = get_state_synchronize_rcu();
queue_delayed_work(system_wq, &krcp->monitor_work, delay);
}

@@ -3187,7 +3190,10 @@ static void kfree_rcu_monitor(struct work_struct *work)
// be that the work is in the pending state when
// channels have been detached following by each
// other.
- queue_rcu_work(system_wq, &krwp->rcu_work);
+ if (poll_state_synchronize_rcu(krcp->gp_snap))
+ queue_work(system_wq, &krwp->rcu_work.work);
+ else
+ queue_rcu_work(system_wq, &krwp->rcu_work);
}
}
<snip>

i do not understand where you got this patch and what a reason behind of
applying is.

3. Could you please remove that patch(revert it) and try one more time?

4. When i apply all your patches i see that you modify:

urezki@pc638:~/data/raid0/coding/linux-stable.git$ git st | wc -l
455
urezki@pc638:~/data/raid0/coding/linux-stable.git$

455 files. The delta is huge. It touches arch, mm, rcu, drivers, crypto,
include/linux/ generic headers, init, kernel, lib, net, etc parts.

So as a result we have:

<snip>
451 files changed, 34218 insertions(+), 5576 deletions(-)
<snip>

--
Uladzislau Rezki