serve Xorg performance penalty due to [u]vesafb creating wrong PAT entries
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Hi,
when using uvesafb or vesafb, these drivers will create uncached-minus PAT entries for the framebuffer memory because they use ioremap(). WHen the framebuffer memory intersects with the video RAM used by Xorg, the complete video RAM will be mapped uncached-minus what results in a server performance penalty.
Here are the correct MTRR entries created by uvesafb:
schlicht@netbook:~$ cat /proc/mtrr
reg00: base=0x000000000 ( 0MB), size= 2048MB, count=1: write-back
reg01: base=0x06ff00000 ( 1791MB), size= 1MB, count=1: uncachable
reg02: base=0x070000000 ( 1792MB), size= 256MB, count=1: uncachable
reg03: base=0x0d0000000 ( 3328MB), size= 16MB, count=1: write-combining
And here are the problematic PAT entries:
schlicht@netbook:~$ sudo cat /sys/kernel/
PAT memtype list:
write-back @ 0x0-0x1000
uncached-minus @ 0x6fedd000-
uncached-minus @ 0x6fee2000-
uncached-minus @ 0x6fee2000-
uncached-minus @ 0x6fee2000-
uncached-minus @ 0x6fee2000-
uncached-minus @ 0x6fee2000-
uncached-minus @ 0x6fee2000-
uncached-minus @ 0x6fee2000-
uncached-minus @ 0x6fee3000-
uncached-minus @ 0x6fee3000-
uncached-minus @ 0x6fee3000-
uncached-minus @ 0xd0000000-
uncached-minus @ 0xd0000000-
uncached-minus @ 0xf4000000-
uncached-minus @ 0xf4200000-
uncached-minus @ 0xf5000000-
uncached-minus @ 0xf5100000-
uncached-minus @ 0xf5400000-
uncached-minus @ 0xf5404000-
uncached-minus @ 0xf5404000-
uncached-minus @ 0xfed00000-
Therefore I created the attached patch for uvesafb which uses ioremap_wc() to create the correct PAT entries, as shown below:
schlicht@netbook:~$ sudo cat /sys/kernel/
PAT memtype list:
write-back @ 0x0-0x1000
uncached-minus @ 0x6fedd000-
uncached-minus @ 0x6fee2000-
uncached-minus @ 0x6fee2000-
uncached-minus @ 0x6fee2000-
uncached-minus @ 0x6fee2000-
uncached-minus @ 0x6fee2000-
uncached-minus @ 0x6fee2000-
uncached-minus @ 0x6fee2000-
uncached-minus @ 0x6fee3000-
uncached-minus @ 0x6fee3000-
uncached-minus @ 0x6fee3000-
write-combining @ 0xd0000000-
write-combining @ 0xd0000000-
uncached-minus @ 0xf4000000-
uncached-minus @ 0xf4200000-
uncached-minus @ 0xf5000000-
uncached-minus @ 0xf5100000-
uncached-minus @ 0xf5400000-
uncached-minus @ 0xf5404000-
uncached-minus @ 0xf5404000-
uncached-minus @ 0xfed00000-
This results in a performance gain, objectively measurable with e.g. x11perf -comppixwin10 -comppixwin100 -comppixwin500:
1: x11perf_
2: x11perf_
1 2 Operation
-------- ----------------- -----------------
300000.0 296000.0 ( 0.99) Composite 10x10 from window to window
38400.0 38500.0 ( 1.00) Composite 100x100 from window to window
1760.0 1760.0 ( 1.00) Composite 500x500 from window to window
124000.0 202000.0 ( 1.63) Composite 10x10 from pixmap to window
3340.0 24400.0 ( 7.31) Composite 100x100 from pixmap to window
131.0 1150.0 ( 8.78) Composite 500x500 from pixmap to window
You can see the serve performance gain when composing larger pixmaps to window.
Please consider applying/pushing the attached patch. I'll also attach a very similar patch for vesafb.
Kind regards,
Thomas
---
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.22.1.
AplayDevices:
**** List of PLAYBACK Hardware Devices ****
card 0: VT82xx [HDA VIA VT82xx], device 0: ALC272 Analog [ALC272 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
Architecture: i386
ArecordDevices:
**** List of CAPTURE Hardware Devices ****
card 0: VT82xx [HDA VIA VT82xx], device 0: ALC272 Analog [ALC272 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
CRDA: Error: [Errno 2] No such file or directory
Card0.Amixer.info:
Card hw:0 'VT82xx'/'HDA VIA VT82xx at 0xf5400000 irq 51'
Mixer name : 'Realtek ALC272'
Components : 'HDA:10ec0272,
Controls : 14
Simple ctrls : 8
DistroRelease: Ubuntu 10.10
LiveMediaBuild: Ubuntu 10.10 "Maverick Meerkat" - Alpha i386 (20100602.2)
MachineType: SAMSUNG ELECTRONICS CO., LTD. NC20/NB20
Package: linux (not installed)
ProcCmdLine: BOOT_IMAGE=
ProcEnviron:
LANG=de_DE.UTF-8
SHELL=/bin/bash
ProcVersionSign
Regression: No
RelatedPackageV
Reproducible: Yes
Tags: maverick kconfig needs-upstream-
Uname: Linux 2.6.34-5-generic i686
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare
dmi.bios.date: 11/25/2009
dmi.bios.vendor: Phoenix Technologies Ltd.
dmi.bios.version: 10MQ
dmi.board.name: NC20/NB20
dmi.board.vendor: SAMSUNG ELECTRONICS CO., LTD.
dmi.chassis.
dmi.chassis.type: 10
dmi.chassis.vendor: SAMSUNG ELECTRONICS CO., LTD.
dmi.chassis.
dmi.modalias: dmi:bvnPhoenixT
dmi.product.name: NC20/NB20
dmi.product.
dmi.sys.vendor: SAMSUNG ELECTRONICS CO., LTD.
tags: | added: kj-triage |
tags: | added: cherry-pick kernel-graphics kernel-needs-review |
Changed in linux (Ubuntu): | |
status: | Incomplete → Triaged |
importance: | Undecided → Medium |
tags: | added: patch |
Changed in linux (Ubuntu): | |
status: | Incomplete → Fix Released |
Similar patch for vesafb to use the correct ioremap_* calls to create suited PAT entries.