linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Soeren Sonnenburg <kernel@nn7.de>
To: Con Kolivas <kernel@kolivas.org>
Cc: Willy Tarreau <willy@w.ods.org>,
	Mark Hahn <hahn@physics.mcmaster.ca>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	gillb4@telusplanet.net
Subject: Re: xterm scrolling speed - scheduling weirdness in 2.6 ?!
Date: Sun, 04 Jan 2004 09:09:23 +0100	[thread overview]
Message-ID: <1073203762.9851.394.camel@localhost> (raw)
In-Reply-To: <200401041242.47410.kernel@kolivas.org>

On Sun, 2004-01-04 at 02:42, Con Kolivas wrote:
> On Sun, 4 Jan 2004 10:35, Willy Tarreau wrote:
> > 6) Conclusion
> > =============
> >
> > Under 2.4, xterm uses jump scrolling which it does not use by default under
> > 2.6 if X responds fast enough. The first dirty solution which comes to mind
> > is to renice X to >+10 to slow it a bit so that xterm hits the high water
> > level and jumps.
> >
> > But it's not an effect of the scheduler alone, but a side effect of the
> > scheduler and xterm both trying to automatically adjust their behaviour in
> > a different manner. 
> 
> Not quite. The scheduler retains high priority for X for longer so it's no new 
> dynamic adjustment of any sort, just better cpu usage by X (which is why it's 
> smoother now at nice 0 than previously). 

But why is i.e. running the command a second or third time much faster
compared with the first run ? Does X get less priority then ?

> > If either the scheduler or xterm was a bit smarter or 
> > used different thresholds, the problem would go away. It would also explain
> > why there are people who cannot reproduce it. Perhaps a somewhat faster or
> > slower system makes the problem go away. Honnestly, it's the first time
> > that I notice that my xterms are jump-scrolling, it was so much fluid
> > anyway.
> 
> Very thorough but not a scheduler problem as far as I'm concerned. Can you not 
> disable smooth scrolling and force jump scrolling?

I think it is a schedulers problem as it works if you run the program in
question often enough (dmesg/find/whatever). Suddenly it comes back to
full scrolling speed. 

Judging from the xfree4.3 xterm sources this is the function that gets
called when there is something to scroll. And it looks perfectly ok to
*me* as it scrolls amount lines at once. So the output of (dmesg/...)
seems to be received slower or xterm updates more often than in 2.4.
leading to fewer lines to scroll (== amount). It cannot be xterm
updating more often as it would a) be faster than and b) amount would be
>>> 1 on later on which would lead to high scrolling speed again.

So IMHO it must be the output of the program that is coming in slowly.

I added a fprintf(stderr, "%d\n", amount); to that code and indeed
amount was *always* 1 no matter what I did (it even was 1 when the
(dmesg/...) output came in fast). And jump scrolling would take place if
amount > 59 in my case... can this still be not a schedulers issue ?

from the xfree86-4.3.0 build-tree ./xc/programs/xterm/util.c

/*
 * scrolls the screen by amount lines, erases bottom, doesn't alter
 * cursor position (i.e. cursor moves down amount relative to text).
 * All done within the scrolling region, of course.
 * requires: amount > 0
 */
void
xtermScroll(TScreen * screen, int amount)
{
    int i = screen->bot_marg - screen->top_marg + 1;
    int shift;
    int bot;
    int refreshtop = 0;
    int refreshheight;
    int scrolltop;
    int scrollheight;

    if (screen->cursor_state)
    HideCursor();
    if (amount > i)
    amount = i;
    if (screen->jumpscroll) {
    if (screen->scroll_amt > 0) {
        if (screen->refresh_amt + amount > i)
        FlushScroll(screen);
        screen->scroll_amt += amount;
        screen->refresh_amt += amount;
    } else {
        if (screen->scroll_amt < 0)
        FlushScroll(screen);
        screen->scroll_amt = amount;
        screen->refresh_amt = amount;
    }
    refreshheight = 0;
    } else {
    ScrollSelection(screen, -(amount));
    if (amount == i) {
        ClearScreen(screen);
        return;
    }
    shift = -screen->topline;
    bot = screen->max_row - shift;
    scrollheight = i - amount;
    refreshheight = amount;
[...]

Looking at that how can it not be a scheduling problem ....

Soeren


  parent reply	other threads:[~2004-01-04  8:11 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.44.0401031439060.24942-100000@coffee.psychology.mcmaster.ca>
2004-01-03 20:19 ` xterm scrolling speed - scheduling weirdness in 2.6 ?! Soeren Sonnenburg
2004-01-03 21:00   ` Con Kolivas
2004-01-03 21:10     ` Soeren Sonnenburg
2004-01-03 21:15       ` Con Kolivas
2004-01-03 23:35         ` Willy Tarreau
2004-01-04  0:11           ` Soeren Sonnenburg
2004-01-04  1:42           ` Con Kolivas
2004-01-04  3:32             ` Tim Connors
2004-01-04  5:58               ` Con Kolivas
2004-01-06  1:09                 ` Peter Osterlund
2004-01-06  1:37                   ` Nick Piggin
2004-01-06  2:28                     ` Peter Osterlund
2004-01-06  2:50                       ` Nick Piggin
2004-01-06  6:27                       ` Nick Piggin
2004-01-05 22:25               ` Bryan Whitehead
2004-01-04  8:09             ` Soeren Sonnenburg [this message]
2004-01-04  8:49               ` Con Kolivas
2004-01-04 11:13                 ` Martin Schlemmer
2004-01-04 11:24                   ` Soeren Sonnenburg
2004-01-04 12:45                   ` Con Kolivas
2004-01-04 14:42                     ` Martin Schlemmer
2004-01-04 18:40                       ` mikeg
2004-01-04 22:58                       ` szonyi calin
2004-01-04 23:33                         ` Willy Tarreau
2004-01-04 23:44                           ` Valdis.Kletnieks
2004-01-04 23:47                           ` Mike Fedyk
2004-01-05  8:39                             ` Soeren Sonnenburg
2004-01-05 20:38                               ` Martin Schlemmer
2004-01-05  9:18                             ` Soeren Sonnenburg
2004-01-05 17:20                               ` Martin Schlemmer
2004-01-05 17:21                                 ` Willy Tarreau
2004-01-05  9:50                             ` Kenneth Johansson
2004-01-05 10:17                               ` Soeren Sonnenburg
2004-04-02 18:22                               ` solved (was Re: xterm scrolling speed - scheduling weirdness in 2.6 ?!) Soeren Sonnenburg
2004-04-03  5:35                                 ` Tim Connors
2004-04-03  6:06                                   ` Tim Connors
2004-04-03 14:11                                     ` Jamie Lokier
2004-01-05  8:26                         ` xterm scrolling speed - scheduling weirdness in 2.6 ?! Soeren Sonnenburg
2004-01-04  8:54               ` Lincoln Dale
2004-01-04  9:17                 ` Nick Piggin
2004-01-04 10:24                   ` Soeren Sonnenburg
2004-01-04 11:12                     ` Mike Fedyk
2004-01-04 11:17                       ` Soeren Sonnenburg
2004-01-04 11:20                         ` Mike Fedyk
2004-01-04 11:19                       ` Willy Tarreau
2004-01-05  0:48                         ` Nick Piggin
2004-01-04 11:46                   ` Nicks's scheduler's OK [was Re: xterm scrolling speed - scheduling weirdness in 2.6 ?!] Willy Tarreau
2004-01-04 12:07                   ` xterm scrolling speed - scheduling weirdness in 2.6 ?! Willy Tarreau
2004-01-05  0:51                     ` Nick Piggin
2004-01-05 18:37                       ` Willy Tarreau
2004-01-06  0:33                         ` Nick Piggin
2004-01-04 10:11                 ` Soeren Sonnenburg
2004-01-05 10:31                   ` venom
2004-01-03 21:18     ` Willy Tarreau
2004-01-03 21:39 Bob Gill
     [not found] <Pine.LNX.4.44.0401031402210.24942-100000@coffee.psychology.mcmaster.ca>
2004-01-03 19:07 ` Soeren Sonnenburg
  -- strict thread matches above, loose matches on Subject: below --
2004-01-03 18:52 Soeren Sonnenburg
2004-01-03 19:19 ` Willy Tarreau
2004-01-04 20:47   ` Peter Chubb
2004-01-04 20:54     ` Willy TARREAU
2004-01-05  3:46       ` Peter Chubb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1073203762.9851.394.camel@localhost \
    --to=kernel@nn7.de \
    --cc=gillb4@telusplanet.net \
    --cc=hahn@physics.mcmaster.ca \
    --cc=kernel@kolivas.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=willy@w.ods.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).