mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Radoslaw Szkodzinski <astralstorm@gorzow.mm.pl>
To: ck@vds.kolivas.org
Cc: Con Kolivas <kernel@kolivas.org>,
	Peter Williams <pwil3058@bigpond.net.au>,
	Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [ck] Re: [PATCH] mm: Implement swap prefetching tweaks
Date: Sat, 11 Mar 2006 06:04:56 +0100	[thread overview]
Message-ID: <200603110605.03046.astralstorm@gorzow.mm.pl> (raw)
In-Reply-To: <200603111518.46474.kernel@kolivas.org>

[-- Attachment #1: Type: text/plain, Size: 2938 bytes --]

On Saturday 11 March 2006 05:18, Con Kolivas wrote yet:
> On Saturday 11 March 2006 10:11, Peter Williams wrote:
> > Andrew Morton wrote:
> > > Con Kolivas <kernel@kolivas.org> wrote:
> > >>	 * We also test if we're the only
> > >>+	 * task running anywhere. We want to have as little impact on all
> > >>+	 * resources (cpu, disk, bus etc). As this iterates over every cpu
> > >>+	 * we measure this infrequently.
> > >>+	 */
> > >>+	if (!(sp_stat.prefetched_pages % SWAP_CLUSTER_MAX)) {
> > >>+		unsigned long cpuload = nr_running();
> > >>+
> > >>+		if (cpuload > 1)
> > >>+			goto out;
> > >
> > > Sorry, this is just wrong.  If swap prefetch is useful then it's also
> > > useful if some task happens to be sitting over in the corner
> > > calculating pi.
> >
> > On SMP systems, something based on the run queues' raw_weighted_load
> > fields (comes with smpnice patch) might be more useful than nr_running()
> > as it contains information about the priority of the running tasks.
> > Perhaps (raw_weighted_load() > SCHED_LOAD_SCALE) or some variation,
> > where raw_weighted_load() is the sum of that field for all CPUs) would
> > suffice.  It would mean "there's more than the equivalent of one nice==0
> > task running" and shouldn't be any more expensive than nr_running().
> > Dividing SCHED_LOAD_SCALE by some number would be an obvious variation
> > to try as would taking into account this process's contribution to the
> > weighted load.
> >
> > Also if this was useful there's no real reason that raw_weighted_load
> > couldn't be made available on non SMP systems as well as SMP ones.
>
> That does seem reasonable, but I'm looking at total system load, not per
> runqueue. So a global_weighted_load() function would be required to return
> that. Because despite what anyone seems to want to believe, reading from
> disk hurts. Why it hurts so much I'm not really sure, but it's not a SCSI
> vs IDE with or without DMA issue. It's not about tweaking parameters. It
> doesn't seem to be only about cpu cycles. This is not a mistuned system
> that it happens on. It just plain hurts if we do lots of disk i/o, perhaps
> it's saturating the bus or something. Whatever it is, as much as I'd _like_
> swap prefetch to just keep working quietly at ultra ultra low priority, the
> disk reads that swap prefetch does are not innocuous so I really do want
> them to only be done when nothing else wants cpu.

Wouldn't the change break prefetching if I have 98% CPU time free and not 
100%? Something like an audio player in the background?

It seems that any Seti@home type of calculation would kill it.
In reality, we don't want disk reads when something interactive is running, so 
maybe you'd look at the nice level of the task?
(higher than x = don't count it?)

-- 
GPG Key id:  0xD1F10BA2
Fingerprint: 96E2 304A B9C4 949A 10A0  9105 9543 0453 D1F1 0BA2

AstralStorm

[-- Attachment #2: Type: application/pgp-signature, Size: 191 bytes --]

  parent reply	other threads:[~2006-03-11  5:08 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-10  9:54 Con Kolivas
2006-03-10 22:35 ` Andrew Morton
2006-03-10 23:11   ` Peter Williams
2006-03-11  4:18     ` Con Kolivas
2006-03-11  4:28       ` Peter Williams
2006-03-11  4:34         ` Con Kolivas
2006-03-11  5:34           ` Peter Williams
2006-03-11  5:04       ` Radoslaw Szkodzinski [this message]
2006-03-11  5:21         ` [ck] " Con Kolivas
2006-03-11  5:46       ` Peter Williams
2006-03-11  3:50   ` Con Kolivas
2006-03-11  5:33     ` Mike Galbraith
2006-03-11  5:50       ` Con Kolivas
2006-03-11  5:58         ` Con Kolivas
2006-03-11  6:11           ` Mike Galbraith
2006-03-11  6:00         ` Mike Galbraith
2006-03-11  6:05           ` Mike Galbraith
2006-03-11  7:20             ` Con Kolivas
2006-03-11  7:44               ` Mike Galbraith
2006-03-11  8:16                 ` Nick Piggin
2006-03-11  8:22                   ` Mike Galbraith
2006-03-11  7:24           ` Con Kolivas
2006-03-11  7:51             ` Mike Galbraith
2006-03-11  8:15               ` Con Kolivas
2006-03-12  4:54               ` Lee Revell
2006-03-12  5:27                 ` Mike Galbraith
2006-03-12  8:36                   ` Con Kolivas
2006-03-14  6:40                 ` Mike Galbraith
2006-03-14  6:50                   ` Lee Revell
2006-03-14  7:06                     ` Mike Galbraith
2006-03-14  8:44                       ` Mike Galbraith
2006-03-14  8:05                     ` [ck] " Jens Axboe

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=200603110605.03046.astralstorm@gorzow.mm.pl \
    --to=astralstorm@gorzow.mm.pl \
    --cc=akpm@osdl.org \
    --cc=ck@vds.kolivas.org \
    --cc=kernel@kolivas.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pwil3058@bigpond.net.au \
    /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

all inboxes | Powered by JetHome®