Project

General

Profile

Actions

Bug #14089

closed

gfx_private: do not read from WC memory

Added by Toomas Soome 2 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
kernel
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

gfx_private does read+update on framebuffer memory to draw glyphs and cursor. This does hurt the performance. Instead, update the shadow buffer first and write prepared data from shadow buffer to framebuffer, eliminating reads from WC memory.

Testing results (limited tests in sense that I only have one physical host) with screen scroll - all the output was done on last line and causing screen scroll by one line:
Before patch:

root@beastie:/code/illumos-gate# time cat /etc/passwd >/dev/console

real    0m0,458s
user    0m0,001s
sys     0m0,458s
root@beastie:/code/illumos-gate# time cat /etc/passwd >/dev/console

real    0m0,459s
user    0m0,001s
sys     0m0,458s
root@beastie:/code/illumos-gate# time cat /etc/passwd >/dev/console

real    0m0,459s
user    0m0,001s
sys     0m0,458s
root@beastie:/code/illumos-gate# time cat /etc/passwd >/dev/console

real    0m0,459s
user    0m0,001s
sys     0m0,458s
root@beastie:/code/illumos-gate# 

After patch:

root@beastie:/home/tsoome# time cat /etc/passwd >/dev/console

real    0m0,021s
user    0m0,001s
sys     0m0,021s
root@beastie:/home/tsoome# 
root@beastie:/home/tsoome# time cat /etc/passwd >/dev/console

real    0m0,022s
user    0m0,001s
sys     0m0,022s
root@beastie:/home/tsoome# time cat /etc/passwd >/dev/console

real    0m0,023s
user    0m0,001s
sys     0m0,022s
root@beastie:/home/tsoome#

Same test without scroll before patch:

root@beastie:/home/tsoome# time cat /etc/passwd >/dev/console

real    0m0,081s
user    0m0,001s
sys     0m0,080s
root@beastie:/home/tsoome# time cat /etc/passwd >/dev/console

real    0m0,081s
user    0m0,001s
sys     0m0,080s
root@beastie:/home/tsoome#

And after patch:

root@beastie:/home/tsoome# time cat /etc/passwd >/dev/console

real    0m0,005s
user    0m0,001s
sys     0m0,004s
root@beastie:/home/tsoome# time cat /etc/passwd >/dev/console

real    0m0,004s
user    0m0,001s
sys     0m0,004s
root@beastie:/home/tsoome#

Tests were performed on 1600x1200x32 framebuffer.

As reported by Garrett D'Amore:

Before:

root@habsr02:~# time cat /etc/issue > /dev/console

real    0m12.934s
user    0m0.001s
sys     0m12.933s

After:

root@habsr02:~# time cat /etc/issue >/dev/console

real    0m0.080s
user    0m0.001s
sys     0m0.079s

Actions #1

Updated by Toomas Soome 2 months ago

  • Description updated (diff)
Actions #2

Updated by Patrick Mooney 2 months ago

  • Gerrit CR set to 1714
Actions #3

Updated by Patrick Mooney 2 months ago

Rick tested this on a machine that was previously beset by performance issues on the framebuffer:

Booted and my console is fast enough now. pkg install build-essential doesn't hang spinning the progress indicator. prtconf -Dd only takes a few seconds to scroll past instead of nearly a minute

Actions #4

Updated by Rick Altherr 2 months ago

As Patrick Mooney mentioned, I tested this on an AMD EPYC reference system that has a notoriously slow console. I previously tracked the slow performance down to limited bandwidth available to the VGA framebuffer. This system uses an AST2500 BMC for VGA. While the BMC has a PCIe gen1 x1 link to the host, the VGA core is internally connected via a classic PCI bus (32-bit, 33MHz).

Testing results before patch:

oxide@ethanol.home.corgimeadows.com:~$ time cat /etc/passwd > /dev/console

real    0m3.58s
user    0m0.00s
sys     0m3.58s
oxide@ethanol.home.corgimeadows.com:~$ time cat /etc/passwd > /dev/console

real    0m3.58s
user    0m0.00s
sys     0m3.58s
oxide@ethanol.home.corgimeadows.com:~$

After patch:

oxide@ethanol.home.corgimeadows.com:~$ time cat /etc/passwd > /dev/console

real    0m0.20s
user    0m0.00s
sys     0m0.20s
oxide@ethanol.home.corgimeadows.com:~$ time cat /etc/passwd > /dev/console

real    0m0.14s
user    0m0.00s
sys     0m0.14s
oxide@ethanol.home.corgimeadows.com:~$ time cat /etc/passwd > /dev/console

real    0m0.14s
user    0m0.00s
sys     0m0.14s
oxide@ethanol.home.corgimeadows.com:~$

Actions #5

Updated by Toomas Soome 2 months ago

  • Description updated (diff)
Actions #6

Updated by Electric Monk 2 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 80cb7d835ea830bbb01519a84135ba3099446327

commit  80cb7d835ea830bbb01519a84135ba3099446327
Author: Toomas Soome <tsoome@me.com>
Date:   2021-09-20T15:07:30.000Z

    14089 gfx_private: do not read from WC memory
    Reviewed by: Jason King <jason.brian.king@gmail.com>
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF