From: Andrew Morton <akpm@osdl.org>
To: ashwin.chaugule@celunite.com
Cc: linux-kernel@vger.kernel.org, Rik van Riel <riel@redhat.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [RFC][PATCH 0/2] Swap token re-tuned
Date: Sun, 1 Oct 2006 15:56:08 -0700 [thread overview]
Message-ID: <20061001155608.0a464d4c.akpm@osdl.org> (raw)
In-Reply-To: <1159555312.2141.13.camel@localhost.localdomain>
On Sat, 30 Sep 2006 00:11:51 +0530
Ashwin Chaugule <ashwin.chaugule@celunite.com> wrote:
>
> Hi,
> Here's a brief up on the next two mails.
When preparing patches, please give each one's email a different and
meaningful Subject:, and try to put the description of the patch within the
email which contains that patch, thanks.
> PATCH 1:
>
> In the current implementation of swap token tuning, grab swap token is
> made from :
> 1) after page_cache_read (filemap.c) and
> 2) after the readahead logic in do_swap_page (memory.c)
>
> IMO, the contention for the swap token should happen _before_ the
> aforementioned calls, because in the event of low system memory, calls
> to freeup space will be made later from page_cache_read and
> read_swap_cache_async , so we want to avoid "false LRU" pages by
> grabbing the token before the VM starts searching for replacement
> candidates.
Seems sane.
> 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 did some testing with the two patches combined and the results are as
> follows:
>
> Current Upstream implementation:
> ===============================
>
> root@ashbert:~/crap# time ./qsbench -n 9000000 -p 3 -s 1420300
> seed = 1420300
> seed = 1420300
> seed = 1420300
>
> real 3m40.124s
> user 0m12.060s
> sys 0m0.940s
>
>
> -------------reboot-----------------
>
> With my implementation :
> ========================
>
> root@ashbert:~/crap# time ./qsbench -n 9000000 -p 3 -s 1420300
> seed = 1420300
> seed = 1420300
> seed = 1420300
>
> real 2m58.708s
> user 0m11.880s
> sys 0m1.070s
>
qsbench gives quite unstable results in my experience. How stable is the
above result (say, average across ten runs?)
It's quite easy to make changes in this area which speed qsbench up with
one set of arguments, and which slow it down with a different set. Did you
try mixing the tests up a bit?
Also, qsbench isn't really a very good test for swap-intensive workloads -
it's re-referencing and locality patterns seem fairly artificial.
Another workload which it would be useful to benchmark is a kernel compile
- say, boot with `mem=16M' and time `make -j4 vmlinux' (numbers may need
tuning).
next prev parent reply other threads:[~2006-10-01 22:56 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 [this message]
2006-10-02 7:35 ` Peter Zijlstra
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=20061001155608.0a464d4c.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=a.p.zijlstra@chello.nl \
--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