You are not logged in.

#1 2024-06-29 12:58:09

YjzJim
Member
Registered: 2023-12-13
Posts: 12

[Solved] btrfs quota causes irregular cpu usage spikes

I am using a laptop, Lenovo ThinkBook 14+. I dual boot arch with windows.
I created a partition with type Microsoft Basic Data, formatted as ntfs.
I edited fstab to mount it at boot as id1000, group1000(my user) to a folder under my home directory. This partition is also viewed as drive D on my windows system.

However, i have noticed that it will cause irregular cpu usage spikes under arch, with no clue whatsoever in journalctl or dmesg, i also checked acpi system interrupts, and still nothing.
When this happens, sometimes the whole system freeze, i can not change workspace, execute commands, stopping commands and so on.
I am wondering if anyone would have an idea why this would happen and is there any more information needed to troubleshoot it.

Here is my basic setup.

OS: Arch Linux x86_64
Host: 21LF (ThinkBook 14 G6+ AHP)
Kernel: Linux 6.9.7-lqx1-1-lqx
Display (LEN8AAF): 3072x1920 @ 120Hz (as 2048x1280) [Built-in]
WM: Hyprland (Wayland)
CPU: AMD Ryzen 7 8845H w/ Radeon 780M Graphics (16) @ 3.80 GHz
GPU: AMD Phoenix3 @ 0.80 GHz [Integrated]
Memory: 2.04 GiB / 27.22 GiB (8%)
Swap: 256.00 KiB / 4.00 GiB (0%)
Disk (/): 361.27 GiB / 1.78 TiB (20%) - btrfs

Device              Start        End    Sectors  Size Type
/dev/nvme0n1p1       2048    2099199    2097152    1G EFI System
/dev/nvme0n1p2   10487808 3831284479 3820796672  1.8T Linux filesystem
/dev/nvme0n1p3    2099200   10487807    8388608    4G Linux swap
/dev/nvme0n1p4 3831285760 4000796671  169510912 80.8G Microsoft basic data (this is the shared partition)

and on another drive

/dev/nvme1n1p1  2048 1000214527 1000212480 476.9G Microsoft basic data ( this is the windows system partition)

Last edited by YjzJim (2024-07-22 22:28:06)

Offline

#2 2024-06-29 14:29:28

cryptearth
Member
Registered: 2024-02-03
Posts: 2,181

Re: [Solved] btrfs quota causes irregular cpu usage spikes

1) don't use ntfs under linux
2) "sharing" one partition is very to next to impossible
3) if you want to exchange data between OSs use exFAT

reason: neither exFAT nor NTFS fully support posix as both are from microsoft

Offline

#3 2024-06-29 15:25:31

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,933

Re: [Solved] btrfs quota causes irregular cpu usage spikes

3rd link below. Mandatory.
Disable it (it's NOT the BIOS setting!) and reboot windows and linux twice for voodo reasons.
No, it doesn't matter how many disks you're using or whether you're swapping them.

Do you mount the partition w/ ntfs, ntfs3 or ntfs-3g and does it matter?
How do you gage the "cpu spike"? top? What process charges the CPU how much?

When this happens, sometimes the whole system freeze, i can not change workspace, execute commands, stopping commands and so on.

Cause that sounds more like an IO stall, you've not limted your CPU to a single core, have you?

https://wiki.archlinux.org/title/Solid_ … leshooting - do you get the same behavior w/ "iommu=soft"?

cryptearth wrote:

3) if you want to exchange data between OSs use exFAT
reason: neither exFAT nor NTFS fully support posix as both are from microsoft

You might want to review that logic wink
Also maybe https://en.wikipedia.org/wiki/Xenix (brace yourself) tongue

Offline

#4 2024-06-29 18:05:22

YjzJim
Member
Registered: 2023-12-13
Posts: 12

Re: [Solved] btrfs quota causes irregular cpu usage spikes

seth wrote:

Do you mount the partition w/ ntfs, ntfs3 or ntfs-3g and does it matter?

This was the case in fstab

# /dev/nvme0n1p4
UUID=18FA6688517A12B7    /home/Jim/Downloads/Shared    ntfs          rw,nosuid,nodev,user_id=1000,group_id=1000,allow_other,blksize=4096    0 0

i have changed it to

# /dev/nvme0n1p4
UUID=18FA6688517A12B7    /home/Jim/Downloads/Shared    ntfs-3g          uid=1000,gid=1000,dmask=022,fmask=133    0 0

No idea whether or not it fixes the issue, it hasn't happened but if it reoccurs, i will post again.

seth wrote:

How do you gage the "cpu spike"? top? What process charges the CPU how much?

I can not use top when the system is frozen.
However, immediately after i can use it, i can still see spikes in cpu usage (htop).

BUT NO PROCESS SHOWN MATCHES THE CPU USAGE. With the processes it is running, all cores should have cpu usgae below 10%.
That is why i suspected acpi interrupt before.(not the problem)

seth wrote:

Cause that sounds more like an IO stall, you've not limted your CPU to a single core, have you?

I have not limited my cpu to a single core.

seth wrote:

https://wiki.archlinux.org/title/Solid_ … leshooting - do you get the same behavior w/ "iommu=soft"?

No kernel messages match what is shown in wiki.

Last edited by YjzJim (2024-06-29 19:04:21)

Offline

#5 2024-06-29 22:03:02

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,933

Re: [Solved] btrfs quota causes irregular cpu usage spikes

i have changed it to

Do you also have https://archlinux.org/packages/extra/x86_64/ntfs-3g/ installed?
Also check "mount" for what's actually end up being used, eg. udisks might ignore some parts of your fstab.

I can not use top when the system is frozen.
However, immediately after i can use it, i can still see spikes in cpu usage (htop).

What does "can not use" mean?? Does it not update or can you not start it (keep it running)?
And how spikey are those spikes? Have all cores been maxed out? (If it "spikes" from 10% to 20%, that's not gonna knock out the system)

No kernel messages match what is shown in wiki.

That's really not the point. If it's not related to the ntfs driver, try to skip the HW iommu

Is the freeze actually linked to accessing the ntfs partition?

Offline

#6 2024-06-30 02:28:24

YjzJim
Member
Registered: 2023-12-13
Posts: 12

Re: [Solved] btrfs quota causes irregular cpu usage spikes

just an update.

I have ntfs-3g installed.
mounting is correctly done using ntfs-3g now

seth wrote:

What does "can not use" mean?? Does it not update or can you not start it (keep it running)?
And how spikey are those spikes? Have all cores been maxed out? (If it "spikes" from 10% to 20%, that's not gonna knock out the system)

I mean it happens irregularly and i don't sit there with top open all the time, and when it happens, i can not execute the top command........
During the spikes, usually one core maxes out. But there is no certainty which core, and sometimes one core becomes normal after maxing out and another core max out.

seth wrote:

Is the freeze actually linked to accessing the ntfs partition?

Frankly i am not that certain, i just never observe it with the partition unmounted. NOTE, IT DOES NOT HAPPEN AT BOOT, IT HAPPENS WHEN THE PARTITION IS MOUNTED and I AM NOT READING/WRITING FROM/TO IT (by myself)

Still, the spikes happen irregularly, and i haven't come up with any way to realize it again.
So i think i should wait a while, test the current changes( ntfs-3g instead of ntfs, and disable windows hibernation), while keeping top on.
If there is any update i will post again, if i doesn't appear again for a while, perhaps i can mark it solved.

Offline

#7 2024-07-22 22:25:36

YjzJim
Member
Registered: 2023-12-13
Posts: 12

Re: [Solved] btrfs quota causes irregular cpu usage spikes

My problem.

The cause is btrfs quota.
Disabling it fixes everything.

Offline

Board footer

Powered by FluxBB