Writing to disk (USB or sdcard) stalls other tasks
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- linux, raspberry-pi
- Domain
- operating-systems, performance
Research direction
The report names no kernel files, tests, or entry points. Start by reproducing the stream-writing workload while comparing disk, tmpfs, USB networking, and Ethernet, then trace the kernel writeback and I/O path. Done would be a confirmed cause with a focused diagnostic or actionable kernel fix.
Written by the indexing model from the issue text.
Description
Have spent quite some time narrowing this down now, but don't know where to look further.
Background is, I'm using a system that receives a 500kbyte/s h264 video stream via wifi cards in monitor mode. This video stream is then displayed on the Pi and should also be written to an USB memory stick or the internal sd card.
However, the problem is, it's just not possible to record this videostream (about 500kbyte/s) without the video sometimes stuttering. This always happens when there is data being written to a disk (USB stick or internal sdcard doesn't matter).
Have tried now:
-
different Raspbian images, kernel versions, raspberry firmware versions
-
deadline i/o scheduler, cfq, noop, bfq, 1000Hz timer, different preemption options
-
niced/ioniced the tasks
-
different sdcards and usb sticks
-
different filesystems
-
verified that usb and sdcard write speed is good
-
made sure no other background tasks like log rotate or whatever are running
-
tried sync and async mounting options
-
tried all kinds of different vm_dirty_background etc. values to smooth out the writing
-
Some things I probably forgot right now
-
The system is not loaded much, cpu usage is around 10%, no high iowait values etc.
What works fine is: Displaying and writing the same data stream to:
- A filesystem in RAM (/tmp tmpfs for example)
- A smartphone connected via USB tethering (usb0 "virtual" network interface)
- Another computer connected via ethernet (eth0 internal Pi ethernet interface)
- Another Raspberry via another Ralink wifi card in monitor mode
This looks to me like pdflush (I think that's what it was called some years ago, sorry, my Linux knowledge may not be up-to-date) somehow has too high priority when writing and stalls things out? Or some other disk-access related stuff in the kernel? Or maybe something in the underlying Raspberry firmware?
How could I narrow this down further?
- Dominant language
- C
- Stars
- 13.2k
- Forks
- 5.5k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 21
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from raspberrypi/linux
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7415 · 2 comments · 1 reaction ·
-
rp1-cfe doesn't forward V4L2_EVENT_SOURCE_CHANGE event from csi-2 sensor driver to userspace app Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
raspberrypi/linux#7399 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
raspberrypi/linux#7357 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7054 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
raspberrypi/linux#7634 · 8 comments · 1 reaction ·
All issues in raspberrypi/linux
Similar issues
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·
-
bug Self Built Image SNAPSHOT Supported Device target/ramips
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100