From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Andrew Morton <akpm@osdl.org>
Cc: ashwin.chaugule@celunite.com, linux-kernel@vger.kernel.org,
Rik van Riel <riel@redhat.com>
Subject: Re: [RFC][PATCH 0/2] Swap token re-tuned
Date: Mon, 02 Oct 2006 09:35:52 +0200 [thread overview]
Message-ID: <1159774552.13651.80.camel@lappy> (raw)
In-Reply-To: <20061001155608.0a464d4c.akpm@osdl.org>
On Sun, 2006-10-01 at 15:56 -0700, Andrew Morton wrote:
> On Sat, 30 Sep 2006 00:11:51 +0530
> Ashwin Chaugule <ashwin.chaugule@celunite.com> wrote:
> > PATCH 2:
> >
> > Instead of using TIMEOUT as a parameter to transfer the token, I think a
> > better solution is to hand it over to a process that proves its
> > eligibilty.
> >
> > What my scheme does, is to find out how frequently a process is calling
> > these functions. The processes that call these more frequently get a
> > higher priority.
> > The idea is to guarantee that a high priority process gets the token.
> > The priority of a process is determined by the number of consecutive
> > calls to swap-in and no-page. I mean "consecutive" not from the
> > scheduler point of view, but from the process point of view. In other
> > words, if the task called these functions every time it was scheduled,
> > it means it is not getting any further with its execution.
> >
> > This way, its a matter of simple comparison of task priorities, to
> > decide whether to transfer the token or not.
>
> Does this introduce the possibility of starvation? Where the
> fast-allocating process hogs the system and everything else makes no
> progress?
I tinkered with this a bit yesterday, and didn't get good results for:
mem=64M ; make -j5
-vanilla: 2h32:55
-swap-token: 2h41:48
various other attempts at tweaking the code only made it worse. (will
have to rerun these test, but a ~3h test is well, a 3h test ;-)
Being frustrated with these results - I mean the idea made sense, so
what is going on - I came up with this answer:
Tasks owning the swap token will retain their pages and will hence swap
less, other (contending) tasks will get less pages and will fault more
frequent. This prio mechanism will favour exactly those tasks not
holding the token. Which makes for token bouncing.
The current mechanism seemingly assigns the token randomly (whomever
asks while not held gets it - and the hold time is fixed), however this
change in paging behaviour (holder less, contenders more) shifts the
odds in favour of one of the contenders. Also the fixed holding time
will make sure the token doesn't get released too soon and can make some
progress.
So while I agree it would be nice to get rid of all magic variables
(holding time in the current impl) this proposed solution hasn't
convinced me (for one it introduces another).
(for the interrested, the various attempts I tried are available here:
http://programming.kicks-ass.net/kernel-patches/swap_token/ )
next prev parent reply other threads:[~2006-10-02 7:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-29 18:41 [RFC][PATCH 0/2] Swap token re-tuned Ashwin Chaugule
2006-10-01 22:56 ` Andrew Morton
2006-10-02 7:35 ` Peter Zijlstra [this message]
2006-10-02 7:59 ` Andrew Morton
2006-10-02 8:14 ` Peter Zijlstra
2006-10-03 7:32 ` Peter Zijlstra
2006-10-08 20:23 ` [RFC][PATCH 1/2] grab swap token reordered Ashwin Chaugule
2006-10-08 20:28 ` [RFC][PATCH 2/2] new scheme to preempt swap token Ashwin Chaugule
2006-10-02 11:00 ` [RFC][PATCH 0/2] Swap token re-tuned Ashwin Chaugule
2006-10-02 11:08 ` Peter Zijlstra
2006-10-02 8:20 ` Ashwin Chaugule
2006-10-02 10:00 ` Ashwin Chaugule
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=1159774552.13651.80.camel@lappy \
--to=a.p.zijlstra@chello.nl \
--cc=akpm@osdl.org \
--cc=ashwin.chaugule@celunite.com \
--cc=linux-kernel@vger.kernel.org \
--cc=riel@redhat.com \
/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