Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 92438 - Lazy refreshes of the terminal in xterm-202
Summary: Lazy refreshes of the terminal in xterm-202
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Seemant Kulleen (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-12 15:25 UTC by Arne Rempke
Modified: 2005-12-07 06:39 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arne Rempke 2005-05-12 15:25:24 UTC
When I use interactive applications like mutt, irssi or screen and they update the full screen content, it takes about a entire second until the data is refreshed on the display. It seems that this delay only occurs with xterm version 202.

Reproducible: Always
Steps to Reproduce:
1. emerge "=x11-terms/xterm-202"
2. xterm
3. irssi
4. Switch between two irssi windows

Actual Results:  
It takes up to one second until the screen is completely refreshed.

Expected Results:  
Refresh the screen immediately.

Xterm is running in fullscreen size (159x71 chars).
Comment 1 Joshua Baergen (RETIRED) gentoo-dev 2005-05-12 15:46:08 UTC
Attach your emerge info please.

Also, could you check CPU usage and memory usage while those refreshes are supposed to happen?  (Using top or the like)
Comment 2 Arne Rempke 2005-05-12 16:27:42 UTC
top reports nothing of intrest: irssi, screen, xterm and X all use very little CPU and memory (less than 10%).
It seems that the delays do not occur when I first stop setiathome, which is normally running all the time in background with a nice-level of 19, whereas the user applications run in level 0. With setiathome running, a comparision between xterm-202, aterm-1.00_beta2 and eterm-0.9.3-r4 showed that only xterm noticably delays as described above.

emerge info:
===================================
Portage 2.0.51.21-r1 (default-linux/x86/2005.0, gcc-3.4.3-20050110, glibc-2.3.5-r0,glibc-2.3.4.20050125-r1, 2.6.11-gentoo-r6-ar2 i686)
=================================================================
System uname: 2.6.11-gentoo-r6-ar2 i686 AMD Athlon(tm) XP 2500+
Gentoo Base System version 1.6.11
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.6
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r8
sys-devel/libtool:   1.5.16
virtual/os-headers:  2.6.11
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-xp -funroll-loops -fprefetch-loop-arrays -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=athlon-xp -funroll-loops -fprefetch-loop-arrays -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks maketest sandbox sfperms strict test userpriv usersandbox"
GENTOO_MIRRORS="http://trumpetti.atm.tut.fi/gentoo/ http://ftp.lug.ro/gentoo/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://pandemonium.tiscali.de/pub/gentoo/ http://ftp.easynet.nl/mirror/gentoo/ http://mirror.pudas.net/gentoo http://gentoo.zie.pg.gda.pl http://ftp.ntua.gr/pub/linux/gentoo/ http://src.gentoo.pl http://mirror.gentoo.no/"
LANG="de_DE@euro"
LDFLAGS="-Wl,-O1"
LINGUAS="de"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 3dnow X aalib acpi alsa apache2 apm avi berkdb bitmap-fonts bonobo cdparanoia cdr crypt cscope cups curl dba dga directfb divx4linux doc dvd dvdr emboss encode fam fbcon fbdev flac foomaticdb fortran gd gdbm ggi gif gphoto2 gtk gtk2 gtkhtml guile imagemagick imap imlib ipv6 jack java jpeg junit ldap libcaca libg++ libwww live mad mikmod mmx motif mozsvg mp3 mpeg mysql nas ncurses network nls nptl ogg oggvorbis opengl pam pdflib perl php png python qt quicktime radeon readline rtc ruby samba scanner sdl slang speex spell sqlite sse ssl svg svga tcltk tcpd tetex tiff truetype truetype-fonts type1-fonts usb vim-with-x vorbis xml xml2 xv zlib linguas_de userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LC_ALL, MAKEOPTS
Comment 3 Christopher Eineke 2005-05-17 09:07:32 UTC
Same problem here.

emerge info:
Portage 2.0.51.22 (default-linux/amd64/2004.3, gcc-3.4.3-20050110,
glibc-2.3.5-r0, 2.6.11-gentoo-r8 x86_64)
=================================================================
System uname: 2.6.11-gentoo-r8 x86_64 Mobile AMD Athlon(tm) 64 Processor 3400+
Gentoo Base System version 1.6.11
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.8
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r8
sys-devel/libtool:   1.5.16
virtual/os-headers:  2.6.11
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -mtune=athlon64 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=athlon64 -mtune=athlon64 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox strict"
GENTOO_MIRRORS="ftp://gentoo.risq.qc.ca ftp://gentoo.agsn.ca
http://gentoo.mirrored.ca http://gentoo.osuosl.org
http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.ca.gentoo.org/gentoo-portage"
USE="amd64 X a52 aac acpi alsa audiofile avi bash-completion bitmap-fonts bzip2
caps cdparanoia cdr crypt cups curl dpms dts dvd dvdr dvdread encode esd fam
flac gd gif gphoto2 gpm gtk gtk2 guile hal ieee1394 imlib2 java jp2 jpeg jpeg2k
junit kdeenablefinal ldap lm_sensors lzw lzw-tiff mad mikmod mng motif mozilla
mozsvg mp3 mpeg multilib ncurses network nomotif nptl nptlonly objc ogg
oggvorbis opengl oss pam pcmcia perl pic png povray python qt readline rtc ruby
samba sdl sndfile ssl svg tcpd tga theora threads tiff truetype truetype-fonts
type1-fonts usb userlocales vorbis wifi wmf wxgtk1 xine xinerama xml2 xmms xpm
xrandr xv xvid zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS

Comment 4 Kaspar Pflugshaupt 2005-05-18 03:07:13 UTC
Same happens here. I can see the delay when doing "man xterm" and paging through
the output with the space key. With Xterm-200-r1, scrolling is instantaneous;
with xterm-202 it is choppy to the point of unusability.

My "emerge info" output:
------------------------------------------------------------------------
Portage 2.0.51.22 (default-linux/x86/2005.0, gcc-3.4.3-20050110, glibc-2.3.5-r0,
2.6.11-gentoo-r8 i686)
=================================================================
System uname: 2.6.11-gentoo-r8 i686 Pentium III (Coppermine)
Gentoo Base System version 1.6.12
ccache version 2.4 [enabled]
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.8
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r9
sys-devel/libtool:   1.5.16
virtual/os-headers:  2.6.11
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium3 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-O2 -march=pentium3 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://mirror.switch.ch/mirror/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 X alsa apache2 apm arts avi berkdb bitmap-fonts cdr crypt cups curl dba
emboss encode esd fam foomaticdb fortran gd gdbm gif gpm gtk gtk2 imagemagick
imlib ipv6 java jpeg junit kde ldap libg++ libwww mad mikmod motif mp3 mpeg
mysql ncurses nls odbc ogg oggvorbis opengl oss pam pdflib perl png python qt
quicktime readline samba sdl slang spell ssl svga tcltk tcpd tetex tiff truetype
truetype-fonts type1-fonts vorbis xml xml2 xmms xv zlib userland_GNU
kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
--------------------------------------------------------------------------
Comment 5 Martin Wegner 2005-05-18 09:01:38 UTC
Same problem here. 200-r1 works.

% emerge info
Portage 2.0.51.21-r1 (default-linux/x86/2005.0, gcc-3.4.3-20050110,
glibc-2.3.5-r0, 2.6.11-mw i686)
=================================================================
System uname: 2.6.11-mw i686 AMD Athlon(tm) XP 3200+
Gentoo Base System version 1.6.11
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
dev-lang/python:     2.2.3-r5, 2.3.5
sys-apps/sandbox:    1.2.7
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r8
sys-devel/libtool:   1.5.16
virtual/os-headers:  2.6.11
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O3 -pipe -mmmx -msse -m3dnow -mfpmath=sse -ftracer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.2/share/config
/usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown
/usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown
/usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref
/usr/share/config /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -O3 -pipe -mmmx -msse -m3dnow -mfpmath=sse -ftracer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/
ftp://mirror.switch.ch/mirror/gentoo/ http://gentoo.osuosl.org
http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="de_DE@euro"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 3dnow X aalib acl alsa apache2 apm avi bash-completion berkdb
bitmap-fonts bonobo bzlib cdparanoia cdr crypt cups curl dedicated dga
divx4linux doc dvd eds emboss encode escreen fam fbcon flac foomaticdb fortran
gd gdbm gif gimpprint gnome gstreamer gtk gtk2 imagemagick imap imlib ipv6 java
jpeg libg++ libwww mad mailwrapper mbox mmx motif mozdevelop mozilla mozsvg mp3
mpeg mysql ncurses nls no-htdocs ogg oggvorbis opengl oss pam pcre pdflib perl
png python quicktime readline real rtc ruby samba sdl silverxp slang spell sse
ssl stencil-buffer svg svga tcltk tcpd tetex tiff truetype truetype-fonts
type1-fonts userlocales vim-with-x vorbis xchattext xine xml xml2 xmms xprint xv
zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LC_ALL, LDFLAGS, LINGUAS
Comment 6 Thomas Dickey 2005-05-18 09:23:09 UTC
The only time-related change that I recall is the sched_yield()
change in #201/#202.  A crude way to check this would be to
disable the HAVE_SCHED_YIELD ifdef.  I say crude, because to
implement it, there's some additional changes - but it "should"
function pretty much as before if that one detail is changed.
Comment 7 Thomas Dickey 2005-05-27 16:41:59 UTC
See also https://bugs.freedesktop.org/show_bug.cgi?id=3306
It would be nice to get some feedback on my remark regarding
the sched_yield() function.
Comment 8 Thomas Dickey 2005-07-03 13:03:35 UTC
The only thing I can think of here is that I had reduced the input
buffer size as part of the sched_yield() change.  In upcoming #203,
I've increased that.  But it would be nice if someone would test and
see if that's the issue.  (See the xterm manpage discussion of
minBufSize and maxBufSize).
Comment 9 Kaspar Pflugshaupt 2005-07-05 01:33:40 UTC
(In reply to comment #8)
> The only thing I can think of here is that I had reduced the input
> buffer size as part of the sched_yield() change.  In upcoming #203,
> I've increased that.  But it would be nice if someone would test and
> see if that's the issue.  (See the xterm manpage discussion of
> minBufSize and maxBufSize).

I've tried setting minBufSize to 512. Looks good so far, but I'll test some
more, under different system loads.

Kaspar
Comment 10 Kaspar Pflugshaupt 2005-07-05 01:47:54 UTC
Looks like I answered too quickly. Even with minBufSize increased to 512,
scrolling performance still drops as soon as there is system load (in my case,
emerging x11-misc/xaos in the background)

Timing examples:

NO LOAD        200-r1     202
ls -lR ~        0.25s    0.3s   

WITH LOAD
ls -lR ~         0.3s    > 4s

It seems that 202 gets a lot less attention from the scheduler...

Cheers

Kaspar
Comment 11 Thomas Dickey 2005-07-05 02:15:42 UTC
Originally there was only one buffer size (4096).
In testing for 201/202, it seemed that 128 (min) and
4096 (max) was working fine.  My current setup has
4096 minBufSize and 32768 maxBufSize, which is probably
overkill, but if the problem is just the buffer size,
that should do it.  If it's not the buffer size, I may
change the logic so that it can take sched_yield() itself
out, in case that call is causing the problem.
Comment 12 Kaspar Pflugshaupt 2005-07-21 04:05:52 UTC
(In reply to comment #11)
> Originally there was only one buffer size (4096).
> In testing for 201/202, it seemed that 128 (min) and
> 4096 (max) was working fine.  My current setup has
> 4096 minBufSize and 32768 maxBufSize, which is probably
> overkill, but if the problem is just the buffer size,
> that should do it.  If it's not the buffer size, I may
> change the logic so that it can take sched_yield() itself
> out, in case that call is causing the problem.

OK, I finally got around to testing this. When I set MinBufSize and maxBufSize
to the values you gave (4069 / 32768), xterm-202 seems to behave a lot better.
Using the same test as before, I get no difference in timings between 200-r1 and
202. Two questions come to mind, though:

(1) Can these or similar values be hard-coded as defaults? Currently, I'm
setting them via ~/.Xresources
(2) If set as defaults, will they have an impact on xterm's memory usage?

Thanks for the help 

Kaspar

(time to take that line out of package.mask :-)
Comment 13 Thomas Dickey 2005-07-21 04:33:14 UTC
I modified the defaults in #203 to use these values
(4096/32768).  So that part is done.  The maximum
value is an amount that xterm allocates on startup.
So that does affect its memory usage.  Before the
changes to the buffering, xterm had a static 4096-byte
buffer; now it is configurable.  The actual choice of
buffer sizes is just a guess: for some situations, a
bigger buffer than 4096 seems to be needed with the 2.6
kernels, but not always.
Comment 14 Martin Wegner 2005-08-10 03:59:31 UTC
I can confirm that version 204 WORKSFORME
Comment 15 Seemant Kulleen (RETIRED) gentoo-dev 2005-12-07 06:39:41 UTC
closing this bug, since this got fixed with 204 going stable a while ago