linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Johannes Weiner <hannes@cmpxchg.org>
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, 01 Jun 2009 10:05:22 +0200	[thread overview]
Message-ID: <87zlcscrb1.fsf@basil.nowhere.org> (raw)
In-Reply-To: <1243436746-2698-1-git-send-email-hannes@cmpxchg.org> (Johannes Weiner's message of "Wed, 27 May 2009 17:05:46 +0200")

Johannes Weiner <hannes@cmpxchg.org> writes:
>
> 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.

I think it's a good idea, something that needed fixing in Linux forever.

Now if we can only start swapping out in larger cluster too.

> +		if (swp_type(swp) != swp_type(entry))
> +			continue;
> +		/*
> +		 * Dont move the disk head too far away.  This also
> +		 * throttles readahead while thrashing, where virtual
> +		 * order diverges more and more from physical order.
> +		 */
> +		if (swp_offset(swp) > pmax)
> +			continue;
> +		if (swp_offset(swp) < pmin)
> +			continue;
> +		page = read_swap_cache_async(swp, gfp_mask, vma, pos);

It would be a good idea then to fix r_s_c_a() to pass down the VMA
and use alloc_page_vma() down below, so that NUMA Policy is preserved
over swapin. 

I originally tried this when I did the NUMA policy code, but then Hugh
pointed out it was useless because the prefetched pages are not
necessarily from this VMA anyways. With your virtual readahead it would
make sense again.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.

--
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>

  parent reply	other threads:[~2009-06-01  8:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-27 15:05 Johannes Weiner
2009-05-27 17:32 ` Rik van Riel
2009-05-27 21:48 ` Andrew Morton
2009-05-28  0:14   ` Johannes Weiner
2009-06-01  8:05 ` Andi Kleen [this message]
2009-06-08  7:52 ` Wu Fengguang
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=87zlcscrb1.fsf@basil.nowhere.org \
    --to=andi@firstfloor.org \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox