Open mabod opened 2 weeks ago
Seems to me that 'atrous' on CPU has an issue with kernel 6.10
6.6.47:
4,0548 [dev_pixelpipe] took 0,635 secs (14,597 CPU) [export] processed 'atrous' on CPU, blended on CPU
6.10.6:
4,9645 [dev_pixelpipe] took 1,489 secs (33,736 CPU) [export] processed 'atrous' on CPU, blended on CPU
I do not know if the relevant change came in 6.10 or 6.9 or 6.8 or 6.7. I only see that 'atrous' on CPU takes 2 times longer with kernel 6.10 than it takes with kernel 6.6. I do not know what to do more other than reporting this finding.
And I am honestly surprised that the kernel has so much influence on the performance anyways. Converting bench.SRW takes 3.8 s with kernel 6.6 but 4.7 s with kernel 6.10. That is significant.
I do not know how to debug this further.
I do not have a stock kernel 6.7.12. But I compiled 6.7.12 with linux-tkg and it has the same performance issue like kernel 6.10.6. The linux-tkg kernel 6.6.48 does not have that performance issue and also not stock arch LTS kernel 6.6.47.
Looks like the relevant change was introduce with kernel series 6.7
Maybe some new CPU-bug mitigation was introduced? Compare the output of this command with old and new kernel:
cat /sys/devices/system/cpu/vulnerabilities/*
Maybe some new CPU-bug mitigation was introduced? Compare the output of this command with old and new kernel:
cat /sys/devices/system/cpu/vulnerabilities/*
No change. 6.7.12 and 6.6.47 are the same.
They could change some task scheduling
That is a possibility. I am currently checking the change logs etc. to find evidence. So far I found:
https://lore.kernel.org/lkml/ZTz9RpZxfxysYCmt@gmail.com/
But on the other hand, if it is a scheduler thing, why does it only affect 'atrous' on CPU? It should affect all modules in the pixelpipe. But all the other modules take more or less the same time. Just atrous has double execution time.
I did a test with a changed scheduler but it makes no difference. I tested
amd_pstate=active with governor "powersave" and energy_performance_preference=balance_performance
and
amd_pstate=passive with governor "ondemand"
Both give the same result and confirm that starting with kernel series 6.7 the 'atrous' module consumes double the amount of time in the pixelpipe. All other modules are not affected by the kernel version change.
In the meantime I also tested kernel 6.5.13. The result is as expected. darktable is as fast as with kernel 6.6. The initial finding is confirmed:
Starting with kernel series 6.7 darktable looses ca. 23 % performance when exporting pictures. Exporting takes ca. 3.8 s per picture with kernel 6.6 and earlier, but 4.7 s per picture with kernel 6.7 and later. And the "atrous" module seems to be the biggest contributor to this issue.
For me it is really a surprise that the kernel has such a significant impact on darktable performance. May be this is memory management related. I dont know. Can somebody please look into this? May be there is a workaround or a simple cure for this performance drop.
Describe the bug
The pixel pipeline processing with opencl disabled takes considerably longer with kernel 6.10.6 compared to 6.6.47.
With kernel 6.6.47:
With kernel 6.10.6:
The performance regression does not happen with opencl enabled.
The issue is repoducible with stock arch kernels
and with linux-tkg kernels
I can not tell if it started before the 6.10 series.
Steps to reproduce
darktable-cli bench.SRW /tmp/aaa.jpg --core --disable-opencl --configdir /tmp -d all
resp.
darktable-cli bench.SRW /tmp/aaa.jpg --core --disable-opencl --configdir /tmp -d perf
bench.SRW and xmp file can be found here:
https://drive.google.com/drive/folders/1cfV2b893JuobVwGiZXcaNv5-yszH6j-N?usp=sharing
Expected behavior
darktable should show same performance for 6.10.6 and 6.6.47 kernel.
Logfile | Screenshot | Screencast
Full logs with
-d all
:6.6.47-full-log.txt 6.10.6-full-log.txt
short logs with
-d perf
: kernel 6.6.47 with -d perf:kernel.6.10.6 with -d perf
Commit
No response
Where did you obtain darktable from?
distro packaging
darktable version
4.8.1
What OS are you using?
Linux
What is the version of your OS?
Endeavouros (arch)
Describe your system?
Are you using OpenCL GPU in darktable?
No
If yes, what is the GPU card and driver?
No response
Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip
No response