All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@cmpxchg.org>
To: Wu Fengguang <fengguang.wu@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Hugh Dickins <hugh.dickins@tiscali.co.uk>,
	Rik van Riel <riel@redhat.com>
Subject: Re: [rfc][patch] swap: virtual swap readahead
Date: Mon, 8 Jun 2009 19:58:08 +0200	[thread overview]
Message-ID: <20090608175808.GD7563@cmpxchg.org> (raw)
In-Reply-To: <20090608075246.GA12644@localhost>

On Mon, Jun 08, 2009 at 03:52:46PM +0800, Wu Fengguang wrote:
> On Wed, May 27, 2009 at 05:05:46PM +0200, Johannes Weiner wrote:
> > The current swap readahead implementation reads a physically
> > contiguous group of swap slots around the faulting page to take
> > advantage of the disk head's position and in the hope that the
> > surrounding pages will be needed soon as well.
> > 
> > This works as long as the physical swap slot order approximates the
> > LRU order decently, otherwise it wastes memory and IO bandwidth to
> > read in pages that are unlikely to be needed soon.
> > 
> > However, the physical swap slot layout diverges from the LRU order
> > with increasing swap activity, i.e. high memory pressure situations,
> > and this is exactly the situation where swapin should not waste any
> > memory or IO bandwidth as both are the most contended resources at
> > this point.
> > 
> > This patch makes swap-in base its readaround window on the virtual
> > proximity of pages in the faulting VMA, as an indicator for pages
> > needed in the near future, while still taking physical locality of
> > swap slots into account.
> > 
> > This has the advantage of reading in big batches when the LRU order
> > matches the swap slot order while automatically throttling readahead
> > when the system is thrashing and swap slots are no longer nicely
> > grouped by LRU order.
> 
> Hi Johannes,
> 
> You may want to test the patch against a real desktop :)
> The attached scripts can do that. I also have the setup to
> test it out conveniently, so if you send me the latest patch..

Thanks a bunch for the offer!  I'm just now incorporating Hugh's
feedback and hope I will be back soon with the next version.  I will
let you know, for sure.

	Hannes

WARNING: multiple messages have this Message-ID (diff)
From: Johannes Weiner <hannes@cmpxchg.org>
To: Wu Fengguang <fengguang.wu@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Hugh Dickins <hugh.dickins@tiscali.co.uk>,
	Rik van Riel <riel@redhat.com>
Subject: Re: [rfc][patch] swap: virtual swap readahead
Date: Mon, 8 Jun 2009 19:58:08 +0200	[thread overview]
Message-ID: <20090608175808.GD7563@cmpxchg.org> (raw)
In-Reply-To: <20090608075246.GA12644@localhost>

On Mon, Jun 08, 2009 at 03:52:46PM +0800, Wu Fengguang wrote:
> On Wed, May 27, 2009 at 05:05:46PM +0200, Johannes Weiner wrote:
> > The current swap readahead implementation reads a physically
> > contiguous group of swap slots around the faulting page to take
> > advantage of the disk head's position and in the hope that the
> > surrounding pages will be needed soon as well.
> > 
> > This works as long as the physical swap slot order approximates the
> > LRU order decently, otherwise it wastes memory and IO bandwidth to
> > read in pages that are unlikely to be needed soon.
> > 
> > However, the physical swap slot layout diverges from the LRU order
> > with increasing swap activity, i.e. high memory pressure situations,
> > and this is exactly the situation where swapin should not waste any
> > memory or IO bandwidth as both are the most contended resources at
> > this point.
> > 
> > This patch makes swap-in base its readaround window on the virtual
> > proximity of pages in the faulting VMA, as an indicator for pages
> > needed in the near future, while still taking physical locality of
> > swap slots into account.
> > 
> > This has the advantage of reading in big batches when the LRU order
> > matches the swap slot order while automatically throttling readahead
> > when the system is thrashing and swap slots are no longer nicely
> > grouped by LRU order.
> 
> Hi Johannes,
> 
> You may want to test the patch against a real desktop :)
> The attached scripts can do that. I also have the setup to
> test it out conveniently, so if you send me the latest patch..

Thanks a bunch for the offer!  I'm just now incorporating Hugh's
feedback and hope I will be back soon with the next version.  I will
let you know, for sure.

	Hannes

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2009-06-08 18:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-27 15:05 [rfc][patch] swap: virtual swap readahead Johannes Weiner
2009-05-27 15:05 ` Johannes Weiner
2009-05-27 17:32 ` Rik van Riel
2009-05-27 17:32   ` Rik van Riel
2009-05-27 21:48 ` Andrew Morton
2009-05-27 21:48   ` Andrew Morton
2009-05-28  0:14   ` Johannes Weiner
2009-05-28  0:14     ` Johannes Weiner
2009-06-01  8:05 ` Andi Kleen
2009-06-01  8:05   ` Andi Kleen
2009-06-08  7:52 ` Wu Fengguang
2009-06-08 17:58   ` Johannes Weiner [this message]
2009-06-08 17:58     ` Johannes Weiner

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=20090608175808.GD7563@cmpxchg.org \
    --to=hannes@cmpxchg.org \
    --cc=akpm@linux-foundation.org \
    --cc=fengguang.wu@intel.com \
    --cc=hugh.dickins@tiscali.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.