From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2022-02-23 19:38:14
Optimize performance of the fbdev console for the common case of
software-based clearing and image blitting.
The commit descripton of each patch contains resuls os a simple
microbenchmark. I also tested the full patchset's effect on the
console output by printing directory listings (i7-4790, FullHD,
simpledrm, kernel with debugging).
> time find /usr/share/doc -type f
In the unoptimized case:
real 0m6.173s
user 0m0.044s
sys 0m6.107s
With optimizations applied:
real 0m4.754s
user 0m0.044s
sys 0m4.698s
In the optimized case, printing the directory listing is ~25% faster
than before.
In v2 of the patchset, after implementing Sam's suggestion to update
cfb_imageblit() as well, it turns out that the compiled code in
sys_imageblit() is still significantly slower than the CFB version. A
fix is probably a larger task and would include architecture-specific
changes. A new TODO item suggests to investigate the performance of the
various helpers and format-conversion functions in DRM and fbdev.
v3:
* fix description of cfb_imageblit() patch (Pekka)
v2:
* improve readability for sys_imageblit() (Gerd, Sam)
* new TODO item for further optimization
Thomas Zimmermann (5):
fbdev: Improve performance of sys_fillrect()
fbdev: Improve performance of sys_imageblit()
fbdev: Remove trailing whitespaces from cfbimgblt.c
fbdev: Improve performance of cfb_imageblit()
drm: Add TODO item for optimizing format helpers
Documentation/gpu/todo.rst | 22 +++++
drivers/video/fbdev/core/cfbimgblt.c | 107 ++++++++++++++++---------
drivers/video/fbdev/core/sysfillrect.c | 16 +---
drivers/video/fbdev/core/sysimgblt.c | 49 ++++++++---
4 files changed, 133 insertions(+), 61 deletions(-)
--
2.35.1
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2022-02-23 19:38:12
Improve the performance of sys_imageblit() by manually unrolling
the inner blitting loop and moving some invariants out. The compiler
failed to do this automatically. The resulting binary code was even
slower than the cfb_imageblit() helper, which uses the same algorithm,
but operates on I/O memory.
A microbenchmark measures the average number of CPU cycles
for sys_imageblit() after a stabilizing period of a few minutes
(i7-4790, FullHD, simpledrm, kernel with debugging). The value
for CFB is given as a reference.
sys_imageblit(), new: 25934 cycles
sys_imageblit(), old: 35944 cycles
cfb_imageblit(): 30566 cycles
In the optimized case, sys_imageblit() is now ~30% faster than before
and ~20% faster than cfb_imageblit().
v2:
* move switch out of inner loop (Gerd)
* remove test for alignment of dst1 (Sam)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Sam Ravnborg <redacted>
---
drivers/video/fbdev/core/sysimgblt.c | 49 +++++++++++++++++++++-------
1 file changed, 38 insertions(+), 11 deletions(-)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2022-02-23 19:38:17
Improve the performance of sys_fillrect() by using word-aligned
32/64-bit mov instructions. While the code tried to implement this,
the compiler failed to create fast instructions. The resulting
binary instructions were even slower than cfb_fillrect(), which
uses the same algorithm, but operates on I/O memory.
A microbenchmark measures the average number of CPU cycles
for sys_fillrect() after a stabilizing period of a few minutes
(i7-4790, FullHD, simpledrm, kernel with debugging). The value
for CFB is given as a reference.
sys_fillrect(), new: 26586 cycles
sys_fillrect(), old: 166603 cycles
cfb_fillrect(): 41012 cycles
In the optimized case, sys_fillrect() is now ~6x faster than before
and ~1.5x faster than the CFB implementation.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <redacted>
---
drivers/video/fbdev/core/sysfillrect.c | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2022-02-23 19:38:19
Add a TODO item for optimizing blitting and format-conversion helpers
in DRM and fbdev. There's always demand for faster graphics output.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
Documentation/gpu/todo.rst | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
@@ -241,6 +241,28 @@ Contact: Thomas Zimmermann <tzimmermann@suse.de>, Daniel Vetter Level: Advanced+Benchmark and optimize blitting and format-conversion function+--------------------------------------------------------------++Drawing to dispay memory quickly is crucial for many applications'+performance.++On at least x86-64, sys_imageblit() is significantly slower than+cfb_imageblit(), even though both use the same blitting algorithm and+the latter is written for I/O memory. It turns out that cfb_imageblit()+uses movl instructions, while sys_imageblit apparently does not. This+seems to be a problem with gcc's optimizer. DRM's format-conversion+heleprs might be subject to similar issues.++Benchmark and optimize fbdev's sys_() helpers and DRM's format-conversion+helpers. In cases that can be further optimized, maybe implement a different+algorithm, For micro-optimizations, use movl/movq instructions explicitly.+That might possibly require architecture specific helpers (e.g., storel()+storeq()).++Contact: Thomas Zimmermann <tzimmermann@suse.de>++Level: Intermediate drm_framebuffer_funcs and drm_mode_config_funcs.fb_create cleanup -----------------------------------------------------------------
@@ -172,7 +172,7 @@ static inline void slow_imageblit(const struct fb_image *image, struct fb_info *l--;color=(*s&(1<<l))?fgcolor:bgcolor;val|=FB_SHIFT_HIGH(p,color,shift^bswapmask);-+/* Did the bitshift spill bits to the next long? */if(shift>=null_bits){FB_WRITEL(val,dst++);
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2022-02-23 19:38:33
Improve the performance of cfb_imageblit() by manually unrolling
the inner blitting loop and moving some invariants out. The compiler
failed to do this automatically. This change keeps cfb_imageblit()
in sync with sys_imagebit().
A microbenchmark measures the average number of CPU cycles
for cfb_imageblit() after a stabilizing period of a few minutes
(i7-4790, FullHD, simpledrm, kernel with debugging).
cfb_imageblit(), new: 15724 cycles
cfb_imageblit(): old: 30566 cycles
In the optimized case, cfb_imageblit() is now ~2x faster than before.
v3:
* fix commit description (Pekka)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
drivers/video/fbdev/core/cfbimgblt.c | 51 +++++++++++++++++++++++-----
1 file changed, 42 insertions(+), 9 deletions(-)
From: Sam Ravnborg <hidden> Date: 2022-02-23 20:25:51
On Wed, Feb 23, 2022 at 08:38:03PM +0100, Thomas Zimmermann wrote:
Improve the performance of cfb_imageblit() by manually unrolling
the inner blitting loop and moving some invariants out. The compiler
failed to do this automatically. This change keeps cfb_imageblit()
in sync with sys_imagebit().
A microbenchmark measures the average number of CPU cycles
for cfb_imageblit() after a stabilizing period of a few minutes
(i7-4790, FullHD, simpledrm, kernel with debugging).
cfb_imageblit(), new: 15724 cycles
cfb_imageblit(): old: 30566 cycles
In the optimized case, cfb_imageblit() is now ~2x faster than before.
v3:
* fix commit description (Pekka)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <redacted>
The code looks equally complicated now in the sys and cfb variants.
Question: What is cfb an abbreviation for anyway?
Not related to the patch - but if I have known the memory is lost..
Sam
From: Sam Ravnborg <hidden> Date: 2022-02-23 20:34:36
On Wed, Feb 23, 2022 at 08:38:04PM +0100, Thomas Zimmermann wrote:
quoted hunk
Add a TODO item for optimizing blitting and format-conversion helpers
in DRM and fbdev. There's always demand for faster graphics output.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
Documentation/gpu/todo.rst | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
@@ -241,6 +241,28 @@ Contact: Thomas Zimmermann <tzimmermann@suse.de>, Daniel Vetter Level: Advanced+Benchmark and optimize blitting and format-conversion function+--------------------------------------------------------------++Drawing to dispay memory quickly is crucial for many applications'
display
+performance.
+
+On at least x86-64, sys_imageblit() is significantly slower than
On, at least x86-64, ...
To me the extra comma makes sense, but grammar is not my strong side.
+cfb_imageblit(), even though both use the same blitting algorithm and
+the latter is written for I/O memory. It turns out that cfb_imageblit()
+uses movl instructions, while sys_imageblit apparently does not. This
+seems to be a problem with gcc's optimizer. DRM's format-conversion
+heleprs might be subject to similar issues.
helpers
+
+Benchmark and optimize fbdev's sys_() helpers and DRM's format-conversion
+helpers. In cases that can be further optimized, maybe implement a different
+algorithm, For micro-optimizations, use movl/movq instructions explicitly.
algorithm. (period, not comma)
+That might possibly require architecture specific helpers (e.g., storel()
+storeq()).
+
+Contact: Thomas Zimmermann [off-list ref]
+
+Level: Intermediate
With the small fixes above:
Acked-by: Sam Ravnborg <redacted>
Another option would be to re-implement imageblit() to be drm specific.
Maybe we can then throw out some legacy code and optimize only for the drm
use. And then maybe only a small part of the code would differ if this
is I/O memory or direct accessible memory.
Sam
From: Javier Martinez Canillas <javierm@redhat.com> Date: 2022-02-24 08:31:21
On 2/23/22 20:38, Thomas Zimmermann wrote:
Improve the performance of cfb_imageblit() by manually unrolling
the inner blitting loop and moving some invariants out. The compiler
failed to do this automatically. This change keeps cfb_imageblit()
in sync with sys_imagebit().
A microbenchmark measures the average number of CPU cycles
for cfb_imageblit() after a stabilizing period of a few minutes
(i7-4790, FullHD, simpledrm, kernel with debugging).
cfb_imageblit(), new: 15724 cycles
cfb_imageblit(): old: 30566 cycles
In the optimized case, cfb_imageblit() is now ~2x faster than before.
v3:
* fix commit description (Pekka)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
Makes sense, improves perf and makes the two more consistent as you mention.
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Best regards,
--
Javier Martinez Canillas
Linux Engineering
Red Hat
From: Javier Martinez Canillas <javierm@redhat.com> Date: 2022-02-24 08:39:46
On 2/23/22 20:38, Thomas Zimmermann wrote:
Add a TODO item for optimizing blitting and format-conversion helpers
in DRM and fbdev. There's always demand for faster graphics output.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
After fixing the typos mentioned by Sam:
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Best regards,
--
Javier Martinez Canillas
Linux Engineering
Red Hat
From: Javier Martinez Canillas <javierm@redhat.com> Date: 2022-02-24 09:03:10
Hello Sam,
On 2/23/22 21:25, Sam Ravnborg wrote:
[snip]
Question: What is cfb an abbreviation for anyway?
Not related to the patch - but if I have known the memory is lost..
I was curious so I dug on this. It seems CFB stands for Color Frame Buffer.
Doing a `git grep "(CFB)"` in the linux history repo [0], I get this:
Documentation/isdn/README.diversion: (CFB).
drivers/video/pmag-ba-fb.c: * PMAG-BA TURBOchannel Color Frame Buffer (CFB) card support,
include/video/pmag-ba-fb.h: * TURBOchannel PMAG-BA Color Frame Buffer (CFB) card support,
Probably the helpers are called like this because they were for any fbdev
driver but assumed that the framebuffer was always in I/O memory. Later some
drivers were allocating the framebuffer in system memory and still using the
helpers, that were using I/O memory accessors and it's ilegal on some arches.
So the sys_* variants where introduced by commit 68648ed1f58d ("fbdev: add
drawing functions for framebuffers in system RAM") to fix this. The old
ones just kept their name, but probably it should had been renamed to io_*
for the naming to be consistent with the sys_* functions.
[0]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/
Best regards,
--
Javier Martinez Canillas
Linux Engineering
Red Hat
From: Sam Ravnborg <hidden> Date: 2022-02-24 10:30:03
Hi Javier,
On Thu, Feb 24, 2022 at 10:02:59AM +0100, Javier Martinez Canillas wrote:
Hello Sam,
On 2/23/22 21:25, Sam Ravnborg wrote:
[snip]
quoted
Question: What is cfb an abbreviation for anyway?
Not related to the patch - but if I have known the memory is lost..
I was curious so I dug on this. It seems CFB stands for Color Frame Buffer.
Doing a `git grep "(CFB)"` in the linux history repo [0], I get this:
Documentation/isdn/README.diversion: (CFB).
drivers/video/pmag-ba-fb.c: * PMAG-BA TURBOchannel Color Frame Buffer (CFB) card support,
include/video/pmag-ba-fb.h: * TURBOchannel PMAG-BA Color Frame Buffer (CFB) card support,
Probably the helpers are called like this because they were for any fbdev
driver but assumed that the framebuffer was always in I/O memory. Later some
drivers were allocating the framebuffer in system memory and still using the
helpers, that were using I/O memory accessors and it's ilegal on some arches.
So the sys_* variants where introduced by commit 68648ed1f58d ("fbdev: add
drawing functions for framebuffers in system RAM") to fix this. The old
ones just kept their name, but probably it should had been renamed to io_*
for the naming to be consistent with the sys_* functions.
[0]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/
Interesting - thanks for the history lesson and thanks for taking your
time to share your findings too.
Sam
Hi Javier,
On Thu, Feb 24, 2022 at 10:03 AM Javier Martinez Canillas
[off-list ref] wrote:
On 2/23/22 21:25, Sam Ravnborg wrote:
quoted
Question: What is cfb an abbreviation for anyway?
Not related to the patch - but if I have known the memory is lost..
I was curious so I dug on this. It seems CFB stands for Color Frame Buffer.
Doing a `git grep "(CFB)"` in the linux history repo [0], I get this:
The naming actually comes from X11.
"mfb" is a monochrome frame buffer (bpp = 1).
"cfb" is a color frame buffer (bpp > 1), which uses a chunky format.
Probably the helpers are called like this because they were for any fbdev
driver but assumed that the framebuffer was always in I/O memory. Later some
drivers were allocating the framebuffer in system memory and still using the
helpers, that were using I/O memory accessors and it's ilegal on some arches.
Yep. Graphics memory used to be on a graphics card.
On systems (usually non-x86) where it was part of main memory, usually
it didn't matter at all whether you used I/O memory or plain memory
accessors anyway.
Then x86 got unified memory...
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2022-03-02 19:30:44
Hi,
merged with fixes for the typoes in the final patch. Thanks for reviewing.
Best regards
Thomas
Am 23.02.22 um 20:37 schrieb Thomas Zimmermann:
Optimize performance of the fbdev console for the common case of
software-based clearing and image blitting.
The commit descripton of each patch contains resuls os a simple
microbenchmark. I also tested the full patchset's effect on the
console output by printing directory listings (i7-4790, FullHD,
simpledrm, kernel with debugging).
> time find /usr/share/doc -type f
In the unoptimized case:
real 0m6.173s
user 0m0.044s
sys 0m6.107s
With optimizations applied:
real 0m4.754s
user 0m0.044s
sys 0m4.698s
In the optimized case, printing the directory listing is ~25% faster
than before.
In v2 of the patchset, after implementing Sam's suggestion to update
cfb_imageblit() as well, it turns out that the compiled code in
sys_imageblit() is still significantly slower than the CFB version. A
fix is probably a larger task and would include architecture-specific
changes. A new TODO item suggests to investigate the performance of the
various helpers and format-conversion functions in DRM and fbdev.
v3:
* fix description of cfb_imageblit() patch (Pekka)
v2:
* improve readability for sys_imageblit() (Gerd, Sam)
* new TODO item for further optimization
Thomas Zimmermann (5):
fbdev: Improve performance of sys_fillrect()
fbdev: Improve performance of sys_imageblit()
fbdev: Remove trailing whitespaces from cfbimgblt.c
fbdev: Improve performance of cfb_imageblit()
drm: Add TODO item for optimizing format helpers
Documentation/gpu/todo.rst | 22 +++++
drivers/video/fbdev/core/cfbimgblt.c | 107 ++++++++++++++++---------
drivers/video/fbdev/core/sysfillrect.c | 16 +---
drivers/video/fbdev/core/sysimgblt.c | 49 ++++++++---
4 files changed, 133 insertions(+), 61 deletions(-)
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
From: Marek Szyprowski <m.szyprowski@samsung.com> Date: 2022-03-08 22:52:31
Hi Thomas,
On 23.02.2022 20:38, Thomas Zimmermann wrote:
Improve the performance of cfb_imageblit() by manually unrolling
the inner blitting loop and moving some invariants out. The compiler
failed to do this automatically. This change keeps cfb_imageblit()
in sync with sys_imagebit().
A microbenchmark measures the average number of CPU cycles
for cfb_imageblit() after a stabilizing period of a few minutes
(i7-4790, FullHD, simpledrm, kernel with debugging).
cfb_imageblit(), new: 15724 cycles
cfb_imageblit(): old: 30566 cycles
In the optimized case, cfb_imageblit() is now ~2x faster than before.
v3:
* fix commit description (Pekka)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <redacted>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
This patch landed recently in linux next-20220308 as commit 0d03011894d2
("fbdev: Improve performance of cfb_imageblit()"). Sadly it causes a
freeze after DRM and emulated fbdev initialization on various Samsung
Exynos ARM 32bit based boards. This happens when kernel is compiled from
exynos_defconfig. Surprisingly when kernel is compiled from
multi_v7_defconfig all those boards boot fine, so this is a matter of
one of the debugging options enabled in the exynos_defconfig. I will try
to analyze this further and share the results. Reverting $subject on top
of next-20220308 fixes the boot issue.
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2022-03-09 08:22:38
Hi
Am 08.03.22 um 23:52 schrieb Marek Szyprowski:
Hi Thomas,
On 23.02.2022 20:38, Thomas Zimmermann wrote:
quoted
Improve the performance of cfb_imageblit() by manually unrolling
the inner blitting loop and moving some invariants out. The compiler
failed to do this automatically. This change keeps cfb_imageblit()
in sync with sys_imagebit().
A microbenchmark measures the average number of CPU cycles
for cfb_imageblit() after a stabilizing period of a few minutes
(i7-4790, FullHD, simpledrm, kernel with debugging).
cfb_imageblit(), new: 15724 cycles
cfb_imageblit(): old: 30566 cycles
In the optimized case, cfb_imageblit() is now ~2x faster than before.
v3:
* fix commit description (Pekka)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <redacted>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
This patch landed recently in linux next-20220308 as commit 0d03011894d2
("fbdev: Improve performance of cfb_imageblit()"). Sadly it causes a
freeze after DRM and emulated fbdev initialization on various Samsung
Exynos ARM 32bit based boards. This happens when kernel is compiled from
exynos_defconfig. Surprisingly when kernel is compiled from
multi_v7_defconfig all those boards boot fine, so this is a matter of
one of the debugging options enabled in the exynos_defconfig. I will try
to analyze this further and share the results. Reverting $subject on top
of next-20220308 fixes the boot issue.
Thanks for reporting. I don't have the hardware to reproduce it and
there's no obvious difference to the original version. It's supposed to
be the same algorithm with a different implementation. Unless you can
figure out the issue, we can also revert the patch easily.
Best regards
Thomas
From: Marek Szyprowski <m.szyprowski@samsung.com> Date: 2022-03-09 09:22:16
Hi,
On 09.03.2022 09:22, Thomas Zimmermann wrote:
Am 08.03.22 um 23:52 schrieb Marek Szyprowski:
quoted
On 23.02.2022 20:38, Thomas Zimmermann wrote:
quoted
Improve the performance of cfb_imageblit() by manually unrolling
the inner blitting loop and moving some invariants out. The compiler
failed to do this automatically. This change keeps cfb_imageblit()
in sync with sys_imagebit().
A microbenchmark measures the average number of CPU cycles
for cfb_imageblit() after a stabilizing period of a few minutes
(i7-4790, FullHD, simpledrm, kernel with debugging).
cfb_imageblit(), new: 15724 cycles
cfb_imageblit(): old: 30566 cycles
In the optimized case, cfb_imageblit() is now ~2x faster than before.
v3:
* fix commit description (Pekka)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <redacted>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
This patch landed recently in linux next-20220308 as commit 0d03011894d2
("fbdev: Improve performance of cfb_imageblit()"). Sadly it causes a
freeze after DRM and emulated fbdev initialization on various Samsung
Exynos ARM 32bit based boards. This happens when kernel is compiled from
exynos_defconfig. Surprisingly when kernel is compiled from
multi_v7_defconfig all those boards boot fine, so this is a matter of
one of the debugging options enabled in the exynos_defconfig. I will try
to analyze this further and share the results. Reverting $subject on top
of next-20220308 fixes the boot issue.
Thanks for reporting. I don't have the hardware to reproduce it and
there's no obvious difference to the original version. It's supposed
to be the same algorithm with a different implementation. Unless you
can figure out the issue, we can also revert the patch easily.
I've played a bit with .config options and found that the issue is
caused by the compiled-in fonts used for the framebuffer. For some
reasons (so far unknown to me), exynos_defconfig has the following odd
setup:
CONFIG_FONT_SUPPORT=y
CONFIG_FONTS=y
# CONFIG_FONT_8x8 is not set
# CONFIG_FONT_8x16 is not set
# CONFIG_FONT_6x11 is not set
CONFIG_FONT_7x14=y
# CONFIG_FONT_PEARL_8x8 is not set
# CONFIG_FONT_ACORN_8x8 is not set
# CONFIG_FONT_MINI_4x6 is not set
# CONFIG_FONT_6x10 is not set
# CONFIG_FONT_10x18 is not set
# CONFIG_FONT_SUN8x16 is not set
# CONFIG_FONT_SUN12x22 is not set
# CONFIG_FONT_TER16x32 is not set
# CONFIG_FONT_6x8 is not set
Such setup causes a freeze during framebuffer initialization (or just
after it got registered). I've reproduced this even on Raspberry Pi 3B
with multi_v7_defconfig and changed fonts configuration (this also
required to disable vivid driver, which forces 8x16 font), where I got
the following panic:
simple-framebuffer 3eace000.framebuffer: framebuffer at 0x3eace000,
0x12c000 bytes
simple-framebuffer 3eace000.framebuffer: format=a8r8g8b8,
mode=640x480x32, linelength=2560
8<--- cut here ---
Unable to handle kernel paging request at virtual address f0aac000
[f0aac000] *pgd=01d8b811, *pte=00000000, *ppte=00000000
Internal error: Oops: 807 [#1] SMP ARM
Modules linked in:
CPU: 3 PID: 1 Comm: swapper/0 Not tainted
5.17.0-rc7-next-20220308-00002-g9e9894c98f8c #11471
Hardware name: BCM2835
PC is at cfb_imageblit+0x52c/0x64c
LR is at 0x1
pc : [<c0603dd8>] lr : [<00000001>] psr: a0000013
sp : f081da68 ip : c1d5ffff fp : f081dad8
r10: f0980000 r9 : c1d69600 r8 : fffb5007
r7 : 00000000 r6 : 00000001 r5 : 00000a00 r4 : 00000001
r3 : 00000055 r2 : f0aac000 r1 : f081dad8 r0 : 00000007
Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
Control: 10c5383d Table: 0000406a DAC: 00000051
Register r0 information: non-paged memory
Register r1 information: 2-page vmalloc region starting at 0xf081c000
allocated at kernel_clone+0xc0/0x428
Register r2 information: 0-page vmalloc region starting at 0xf0980000
allocated at simplefb_probe+0x284/0x9b0
Register r3 information: non-paged memory
Register r4 information: non-paged memory
Register r5 information: non-paged memory
Register r6 information: non-paged memory
Register r7 information: NULL pointer
Register r8 information: non-paged memory
Register r9 information: non-slab/vmalloc memory
Register r10 information: 0-page vmalloc region starting at 0xf0980000
allocated at simplefb_probe+0x284/0x9b0
Register r11 information: 2-page vmalloc region starting at 0xf081c000
allocated at kernel_clone+0xc0/0x428
Register r12 information: non-slab/vmalloc memory
Process swapper/0 (pid: 1, stack limit = 0x(ptrval))
Stack: (0xf081da68 to 0xf081e000)
...
cfb_imageblit from soft_cursor+0x164/0x1cc
soft_cursor from bit_cursor+0x4c0/0x4fc
bit_cursor from fbcon_cursor+0xf8/0x108
fbcon_cursor from hide_cursor+0x34/0x94
hide_cursor from redraw_screen+0x13c/0x22c
redraw_screen from fbcon_prepare_logo+0x164/0x444
fbcon_prepare_logo from fbcon_init+0x38c/0x4bc
fbcon_init from visual_init+0xc0/0x108
visual_init from do_bind_con_driver+0x1ac/0x38c
do_bind_con_driver from do_take_over_console+0x13c/0x1c8
do_take_over_console from do_fbcon_takeover+0x74/0xcc
do_fbcon_takeover from register_framebuffer+0x1bc/0x2cc
register_framebuffer from simplefb_probe+0x8dc/0x9b0
simplefb_probe from platform_probe+0x80/0xc0
platform_probe from really_probe+0xc0/0x304
really_probe from __driver_probe_device+0x88/0xe0
__driver_probe_device from driver_probe_device+0x34/0xd4
driver_probe_device from __driver_attach+0x8c/0xe0
__driver_attach from bus_for_each_dev+0x64/0xb0
bus_for_each_dev from bus_add_driver+0x160/0x1e4
bus_add_driver from driver_register+0x78/0x10c
driver_register from do_one_initcall+0x44/0x1e0
do_one_initcall from kernel_init_freeable+0x1bc/0x20c
kernel_init_freeable from kernel_init+0x18/0x12c
kernel_init from ret_from_fork+0x14/0x2c
Code: e28db070 e00473a3 e08b7107 e5177044 (e5827000)
---[ end trace 0000000000000000 ]---
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
CPU0: stopping
CPU: 0 PID: 0 Comm: swapper/0 Tainted: G D
5.17.0-rc7-next-20220308-00002-g9e9894c98f8c #11471
Hardware name: BCM2835
unwind_backtrace from show_stack+0x10/0x14
show_stack from 0xc1201e64
CPU2: stopping
CPU: 2 PID: 0 Comm: swapper/2 Tainted: G D
5.17.0-rc7-next-20220308-00002-g9e9894c98f8c #11471
Hardware name: BCM2835
unwind_backtrace from show_stack+0x10/0x14
show_stack from 0xf0809f5c
CPU1: stopping
CPU: 1 PID: 0 Comm: swapper/1 Tainted: G D
5.17.0-rc7-next-20220308-00002-g9e9894c98f8c #11471
Hardware name: BCM2835
unwind_backtrace from show_stack+0x10/0x14
show_stack from 0xf0805f5c
---[ end Kernel panic - not syncing: Attempted to kill init!
exitcode=0x0000000b ]---
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
Hi Marek,
On Wed, Mar 9, 2022 at 10:22 AM Marek Szyprowski
[off-list ref] wrote:
On 09.03.2022 09:22, Thomas Zimmermann wrote:
quoted
Am 08.03.22 um 23:52 schrieb Marek Szyprowski:
quoted
On 23.02.2022 20:38, Thomas Zimmermann wrote:
quoted
Improve the performance of cfb_imageblit() by manually unrolling
the inner blitting loop and moving some invariants out. The compiler
failed to do this automatically. This change keeps cfb_imageblit()
in sync with sys_imagebit().
A microbenchmark measures the average number of CPU cycles
for cfb_imageblit() after a stabilizing period of a few minutes
(i7-4790, FullHD, simpledrm, kernel with debugging).
cfb_imageblit(), new: 15724 cycles
cfb_imageblit(): old: 30566 cycles
In the optimized case, cfb_imageblit() is now ~2x faster than before.
v3:
* fix commit description (Pekka)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <redacted>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
This patch landed recently in linux next-20220308 as commit 0d03011894d2
("fbdev: Improve performance of cfb_imageblit()"). Sadly it causes a
freeze after DRM and emulated fbdev initialization on various Samsung
Exynos ARM 32bit based boards. This happens when kernel is compiled from
exynos_defconfig. Surprisingly when kernel is compiled from
multi_v7_defconfig all those boards boot fine, so this is a matter of
one of the debugging options enabled in the exynos_defconfig. I will try
to analyze this further and share the results. Reverting $subject on top
of next-20220308 fixes the boot issue.
Thanks for reporting. I don't have the hardware to reproduce it and
there's no obvious difference to the original version. It's supposed
to be the same algorithm with a different implementation. Unless you
can figure out the issue, we can also revert the patch easily.
I've played a bit with .config options and found that the issue is
caused by the compiled-in fonts used for the framebuffer. For some
reasons (so far unknown to me), exynos_defconfig has the following odd
setup:
CONFIG_FONT_SUPPORT=y
CONFIG_FONTS=y
# CONFIG_FONT_8x8 is not set
# CONFIG_FONT_8x16 is not set
# CONFIG_FONT_6x11 is not set
CONFIG_FONT_7x14=y
# CONFIG_FONT_PEARL_8x8 is not set
# CONFIG_FONT_ACORN_8x8 is not set
# CONFIG_FONT_MINI_4x6 is not set
# CONFIG_FONT_6x10 is not set
# CONFIG_FONT_10x18 is not set
# CONFIG_FONT_SUN8x16 is not set
# CONFIG_FONT_SUN12x22 is not set
# CONFIG_FONT_TER16x32 is not set
# CONFIG_FONT_6x8 is not set
Such setup causes a freeze during framebuffer initialization (or just
after it got registered). I've reproduced this even on Raspberry Pi 3B
with multi_v7_defconfig and changed fonts configuration (this also
required to disable vivid driver, which forces 8x16 font), where I got
the following panic:
simple-framebuffer 3eace000.framebuffer: framebuffer at 0x3eace000,
0x12c000 bytes
simple-framebuffer 3eace000.framebuffer: format=a8r8g8b8,
mode=640x480x32, linelength=2560
8<--- cut here ---
Unable to handle kernel paging request at virtual address f0aac000
So support for images with offsets or widths that are not a multiple
of 8 got broken in cfb_imageblit(). Oops...
BTW, the various drawing routines used to set a bitmask indicating
which alignments were supported (see blit_x), but most of them no
longer do, presumably because all alignments are now supported
(since ca. 20 years?).
So you can (temporarily) work around this by filling in blit_x,
preventing the use of the 7x14 font.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2022-03-10 19:22:04
Hi
Am 09.03.22 um 11:39 schrieb Geert Uytterhoeven:
Hi Marek,
On Wed, Mar 9, 2022 at 10:22 AM Marek Szyprowski
[off-list ref] wrote:
quoted
On 09.03.2022 09:22, Thomas Zimmermann wrote:
quoted
Am 08.03.22 um 23:52 schrieb Marek Szyprowski:
quoted
On 23.02.2022 20:38, Thomas Zimmermann wrote:
quoted
Improve the performance of cfb_imageblit() by manually unrolling
the inner blitting loop and moving some invariants out. The compiler
failed to do this automatically. This change keeps cfb_imageblit()
in sync with sys_imagebit().
A microbenchmark measures the average number of CPU cycles
for cfb_imageblit() after a stabilizing period of a few minutes
(i7-4790, FullHD, simpledrm, kernel with debugging).
cfb_imageblit(), new: 15724 cycles
cfb_imageblit(): old: 30566 cycles
In the optimized case, cfb_imageblit() is now ~2x faster than before.
v3:
* fix commit description (Pekka)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <redacted>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
This patch landed recently in linux next-20220308 as commit 0d03011894d2
("fbdev: Improve performance of cfb_imageblit()"). Sadly it causes a
freeze after DRM and emulated fbdev initialization on various Samsung
Exynos ARM 32bit based boards. This happens when kernel is compiled from
exynos_defconfig. Surprisingly when kernel is compiled from
multi_v7_defconfig all those boards boot fine, so this is a matter of
one of the debugging options enabled in the exynos_defconfig. I will try
to analyze this further and share the results. Reverting $subject on top
of next-20220308 fixes the boot issue.
Thanks for reporting. I don't have the hardware to reproduce it and
there's no obvious difference to the original version. It's supposed
to be the same algorithm with a different implementation. Unless you
can figure out the issue, we can also revert the patch easily.
I've played a bit with .config options and found that the issue is
caused by the compiled-in fonts used for the framebuffer. For some
reasons (so far unknown to me), exynos_defconfig has the following odd
setup:
CONFIG_FONT_SUPPORT=y
CONFIG_FONTS=y
# CONFIG_FONT_8x8 is not set
# CONFIG_FONT_8x16 is not set
# CONFIG_FONT_6x11 is not set
CONFIG_FONT_7x14=y
# CONFIG_FONT_PEARL_8x8 is not set
# CONFIG_FONT_ACORN_8x8 is not set
# CONFIG_FONT_MINI_4x6 is not set
# CONFIG_FONT_6x10 is not set
# CONFIG_FONT_10x18 is not set
# CONFIG_FONT_SUN8x16 is not set
# CONFIG_FONT_SUN12x22 is not set
# CONFIG_FONT_TER16x32 is not set
# CONFIG_FONT_6x8 is not set
Such setup causes a freeze during framebuffer initialization (or just
after it got registered). I've reproduced this even on Raspberry Pi 3B
with multi_v7_defconfig and changed fonts configuration (this also
required to disable vivid driver, which forces 8x16 font), where I got
the following panic:
simple-framebuffer 3eace000.framebuffer: framebuffer at 0x3eace000,
0x12c000 bytes
simple-framebuffer 3eace000.framebuffer: format=a8r8g8b8,
mode=640x480x32, linelength=2560
8<--- cut here ---
Unable to handle kernel paging request at virtual address f0aac000
So support for images with offsets or widths that are not a multiple
of 8 got broken in cfb_imageblit(). Oops...
BTW, the various drawing routines used to set a bitmask indicating
which alignments were supported (see blit_x), but most of them no
longer do, presumably because all alignments are now supported
(since ca. 20 years?).
So you can (temporarily) work around this by filling in blit_x,
preventing the use of the 7x14 font.
How do I activate the 7x14 font? It's compiled into the kernel already
(CONFIG_FONT_7x14=y).
Best regards
Thomas
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
Hi Thomas,
On Thu, Mar 10, 2022 at 8:22 PM Thomas Zimmermann [off-list ref] wrote:
Am 09.03.22 um 11:39 schrieb Geert Uytterhoeven:
quoted
On Wed, Mar 9, 2022 at 10:22 AM Marek Szyprowski
[off-list ref] wrote:
quoted
On 09.03.2022 09:22, Thomas Zimmermann wrote:
quoted
Am 08.03.22 um 23:52 schrieb Marek Szyprowski:
quoted
On 23.02.2022 20:38, Thomas Zimmermann wrote:
quoted
Improve the performance of cfb_imageblit() by manually unrolling
the inner blitting loop and moving some invariants out. The compiler
failed to do this automatically. This change keeps cfb_imageblit()
in sync with sys_imagebit().
A microbenchmark measures the average number of CPU cycles
for cfb_imageblit() after a stabilizing period of a few minutes
(i7-4790, FullHD, simpledrm, kernel with debugging).
cfb_imageblit(), new: 15724 cycles
cfb_imageblit(): old: 30566 cycles
In the optimized case, cfb_imageblit() is now ~2x faster than before.
v3:
* fix commit description (Pekka)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <redacted>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
This patch landed recently in linux next-20220308 as commit 0d03011894d2
("fbdev: Improve performance of cfb_imageblit()"). Sadly it causes a
freeze after DRM and emulated fbdev initialization on various Samsung
Exynos ARM 32bit based boards. This happens when kernel is compiled from
exynos_defconfig. Surprisingly when kernel is compiled from
multi_v7_defconfig all those boards boot fine, so this is a matter of
one of the debugging options enabled in the exynos_defconfig. I will try
to analyze this further and share the results. Reverting $subject on top
of next-20220308 fixes the boot issue.
Thanks for reporting. I don't have the hardware to reproduce it and
there's no obvious difference to the original version. It's supposed
to be the same algorithm with a different implementation. Unless you
can figure out the issue, we can also revert the patch easily.
I've played a bit with .config options and found that the issue is
caused by the compiled-in fonts used for the framebuffer. For some
reasons (so far unknown to me), exynos_defconfig has the following odd
setup:
CONFIG_FONT_SUPPORT=y
CONFIG_FONTS=y
# CONFIG_FONT_8x8 is not set
# CONFIG_FONT_8x16 is not set
# CONFIG_FONT_6x11 is not set
CONFIG_FONT_7x14=y
# CONFIG_FONT_PEARL_8x8 is not set
# CONFIG_FONT_ACORN_8x8 is not set
# CONFIG_FONT_MINI_4x6 is not set
# CONFIG_FONT_6x10 is not set
# CONFIG_FONT_10x18 is not set
# CONFIG_FONT_SUN8x16 is not set
# CONFIG_FONT_SUN12x22 is not set
# CONFIG_FONT_TER16x32 is not set
# CONFIG_FONT_6x8 is not set
Such setup causes a freeze during framebuffer initialization (or just
after it got registered). I've reproduced this even on Raspberry Pi 3B
with multi_v7_defconfig and changed fonts configuration (this also
required to disable vivid driver, which forces 8x16 font), where I got
the following panic:
simple-framebuffer 3eace000.framebuffer: framebuffer at 0x3eace000,
0x12c000 bytes
simple-framebuffer 3eace000.framebuffer: format=a8r8g8b8,
mode=640x480x32, linelength=2560
8<--- cut here ---
Unable to handle kernel paging request at virtual address f0aac000
So support for images with offsets or widths that are not a multiple
of 8 got broken in cfb_imageblit(). Oops...
BTW, the various drawing routines used to set a bitmask indicating
which alignments were supported (see blit_x), but most of them no
longer do, presumably because all alignments are now supported
(since ca. 20 years?).
So you can (temporarily) work around this by filling in blit_x,
preventing the use of the 7x14 font.
How do I activate the 7x14 font? It's compiled into the kernel already
(CONFIG_FONT_7x14=y).
Documentation/fb/fbcon.rst:1. fbcon=font:<name>
Or just disable all other fonts.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2022-03-13 19:23:47
Hi Geert
Am 10.03.22 um 20:23 schrieb Geert Uytterhoeven:
[...]
quoted
How do I activate the 7x14 font? It's compiled into the kernel already
(CONFIG_FONT_7x14=y).
Documentation/fb/fbcon.rst:1. fbcon=font:<name>
Or just disable all other fonts.
Thanks. I've been able to reproduce the problem and will send a patch soon.
Best regards
Thomas
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2022-03-24 19:19:05
Hi
Am 24.03.22 um 20:11 schrieb Guenter Roeck:
Hi,
On Wed, Feb 23, 2022 at 08:38:03PM +0100, Thomas Zimmermann wrote:
quoted
Improve the performance of cfb_imageblit() by manually unrolling
the inner blitting loop and moving some invariants out. The compiler
failed to do this automatically. This change keeps cfb_imageblit()
in sync with sys_imagebit().
A microbenchmark measures the average number of CPU cycles
for cfb_imageblit() after a stabilizing period of a few minutes
(i7-4790, FullHD, simpledrm, kernel with debugging).
cfb_imageblit(), new: 15724 cycles
cfb_imageblit(): old: 30566 cycles
In the optimized case, cfb_imageblit() is now ~2x faster than before.
v3:
* fix commit description (Pekka)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
This patch causes crashes with arm mainstone, z2, and collie emulations.
Reverting it fixes the problem.
collie crash log and bisect log attached.
Hi,
On Wed, Feb 23, 2022 at 08:38:03PM +0100, Thomas Zimmermann wrote:
Improve the performance of cfb_imageblit() by manually unrolling
the inner blitting loop and moving some invariants out. The compiler
failed to do this automatically. This change keeps cfb_imageblit()
in sync with sys_imagebit().
A microbenchmark measures the average number of CPU cycles
for cfb_imageblit() after a stabilizing period of a few minutes
(i7-4790, FullHD, simpledrm, kernel with debugging).
cfb_imageblit(), new: 15724 cycles
cfb_imageblit(): old: 30566 cycles
In the optimized case, cfb_imageblit() is now ~2x faster than before.
v3:
* fix commit description (Pekka)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Hi,
On Wed, Feb 23, 2022 at 08:38:03PM +0100, Thomas Zimmermann wrote:
quoted
Improve the performance of cfb_imageblit() by manually unrolling
the inner blitting loop and moving some invariants out. The compiler
failed to do this automatically. This change keeps cfb_imageblit()
in sync with sys_imagebit().
A microbenchmark measures the average number of CPU cycles
for cfb_imageblit() after a stabilizing period of a few minutes
(i7-4790, FullHD, simpledrm, kernel with debugging).
cfb_imageblit(), new: 15724 cycles
cfb_imageblit(): old: 30566 cycles
In the optimized case, cfb_imageblit() is now ~2x faster than before.
v3:
* fix commit description (Pekka)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
This patch causes crashes with arm mainstone, z2, and collie emulations.
Reverting it fixes the problem.
collie crash log and bisect log attached.