Bug 1902818

Summary: kernel 5.9 - video decoding performance dropdown
Product: [Fedora] Fedora Reporter: Václav Nováček <waclaw66>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 33CC: acaringi, adscvr, airlied, bskeggs, hdegoede, itamar, jarodwilson, jeremy, jglisse, jonathan, josef, kernel-maint, lgoncalv, linville, masami256, mchehab, mjg59, ptalbert, steved
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-10 17:25:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
dmesg none

Description Václav Nováček 2020-11-30 18:57:04 UTC
Created attachment 1734937 [details]
dmesg

1. Please describe the problem:
There is performance dropdown (about 50%) since kernel 5.9.x while scaling video on Intel i3-4130T cpu.

2. What is the Version-Release number of the kernel:
5.9.10

3. Did it work previously in Fedora? If so, what kernel version did the issue
   *first* appear?  Old kernels are available for download at
   https://koji.fedoraproject.org/koji/packageinfo?packageID=8 :
5.9.7

4. Can you reproduce this issue? If so, please provide the steps to reproduce
   the issue below:
ffmpeg -i fullhd_video.mp4 -benchmark -s 1280x720 -pix_fmt yuv420p -c:v rawvideo -f null -

on 5.8.18 -s parameter has almost no influence

5. Does this problem occur with the latest Rawhide kernel? To install the
   Rawhide kernel, run ``sudo dnf install fedora-repos-rawhide`` followed by
   ``sudo dnf update --enablerepo=rawhide kernel``:
YES

6. Are you running any modules that not shipped with directly Fedora's kernel?:
no

7. Please attach the kernel logs. You can get the complete kernel log
   for a boot with ``journalctl --no-hostname -k > dmesg.txt``. If the
   issue occurred on a previous boot, use the journalctl ``-b`` flag.

Comment 1 Václav Nováček 2020-12-01 07:25:12 UTC
Seems like ffmpeg problem, tried latest git build, it has slightly better results on 5.9.x comparing to 5.8.x.
Sorry for bothering.

Comment 2 Václav Nováček 2020-12-01 07:34:52 UTC
(In reply to Václav Nováček from comment #1)
> Seems like ffmpeg problem, tried latest git build, it has slightly better
> results on 5.9.x comparing to 5.8.x.
> Sorry for bothering.

My mistake, not true, problem still persists, adding -s or -pix_fmt parameter has big influence to the performance on 5.9.x comparing to 5.8.x.
Still not sure, where the problem is. The video source is tcp rtsp stream from ipcamera.
Decoding file from disk has similar results on 5.9.x and 5.8.x.

Comment 3 Václav Nováček 2021-01-20 08:38:56 UTC
Performance problem still persists on kernel 5.10.x
What can be the problem? I don't believe it's ffmpeg.

Comment 4 Václav Nováček 2021-01-20 08:43:50 UTC
I have tested it on another computer with different hardware (Intel, AMD+nVidia), same problem. It's not related to CPU or GPU. It's the kernel itself.

Comment 5 Václav Nováček 2021-01-20 09:02:28 UTC
here are cpu consumptions of the ffmpeg process for comparison

kernel 5.8
-s 1280x720 -pix_fmt yuv420p ... about 23% cpu usage of single core

kernel 5.9, 5.10
-s 1280x720 -pix_fmt yuv420p ... about 70% cpu usage of single core
-s 1280x720 ... about 50% cpu usage of single core
only decoding ... about 25% cpu usage of single core

it's very simillar on Intel and AMD as well
tested on the latest dev build of ffmpeg

Comment 6 Václav Nováček 2021-02-10 17:25:25 UTC
It turned out that kernel 5.9+ switched from ondemand to schedutil governor and therefore performance results differ.
Switching back to ondemand fixed it.