Kernel:watchdog: BUG: soft lockup - CPU#2 stuck for XXXs

I have a problem with the terminal displaying the following message every 20-30 seconds.

kernel:watchdog: BUG: soft lockup - CPU#2 stuck for XXXs! [kworker/2:0:985723]

Please tell me how I can solve this problem. The OS version is Rocky Linux release 9.2 (Blue Onyx).

How long does thesis issue persist?

Soft lockups are basically potential hangs in the kernel. Sometimes they can be environment related (e.g. network mounts to unresponsive servers), but they can also be kernel regressions. Kernel dumps a stack trace for the hanging kernel thread, and this ends up in the journal. Can you search for “soft lockup” in journalctl output and paste 60 lines after the hit?

the other thing to try in support of what anthyve said, is has anything changed recently, for example have you performed a patch update, or a bios update to the motherboard, or had any hardware replaced.
usually change leads to problems appearing not withstanding external dependencies.
but this message has probably been seen by every linux system admin at some point in the recent years.
regards peter

Thank you for the suggestions. I did “dnf update” and reboot the Linux system. After that the messages does not appears so far. I don’t know what happened. Thank you.

Known problem in the first 9.2 release, fixed in later release.