]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
vt(4): Add vtbuf_dirty*_locked() to lock vtbuf once, not twice
authordumbbell <dumbbell@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 19 Aug 2014 21:31:32 +0000 (21:31 +0000)
committerdumbbell <dumbbell@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 19 Aug 2014 21:31:32 +0000 (21:31 +0000)
commit37ef9f41e1987bb1db0302376fbafc049f33af94
tree9bd7bbb358698292b61605605fd972ddffb768e4
parent59a257eb689b77bffa05a5c3d8923b999da373ed
vt(4): Add vtbuf_dirty*_locked() to lock vtbuf once, not twice

In several functions, vtbuf_putchar() in particular, the lock on vtbuf
is acquired twice:
    1. once by the said functions;
    2. once in vtbuf_dirty().

Now, vtbuf_dirty_locked() and vtbuf_dirty_cell_locked() allow to
acquire that lock only once.

This improves the input speed of vt(4). To measure the gain, a
50,000-lines file was displayed on the console using cat(1). The time
taken by cat(1) is reported below:
    o  On amd64, with vt_vga:
        - before: 1.0"
        - after:  0.5"
    o  On sparc64, with creator_vt:
        - before: 13.6"
        - after:  10.5"

This is an MFC of r269780.

git-svn-id: svn://svn.freebsd.org/base/stable/9@270184 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/dev/vt/vt_buf.c