linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Con Kolivas <kernel@kolivas.org>
Subject: Re: swap-prefetch: 2.6.22 -mm merge plans
Date: Fri, 04 May 2007 17:34:03 +1000	[thread overview]
Message-ID: <463AE1EB.1020909@yahoo.com.au> (raw)
In-Reply-To: <20070503155407.GA7536@elte.hu>

Ingo Molnar wrote:
> * Andrew Morton <akpm@linux-foundation.org> wrote:
> 
> 
>>- If replying, please be sure to cc the appropriate individuals.  
>>  Please also consider rewriting the Subject: to something 
>>  appropriate.
> 
> 
> i'm wondering about swap-prefetch:

Well I had some issues with it that I don't think were fully discussed,
and Andrew prompted me to say something, but it went off list for a
couple of posts (my fault, sorry). Posting it below with Andrew's
permission...


>   mm-implement-swap-prefetching.patch
>   swap-prefetch-avoid-repeating-entry.patch
>   add-__gfp_movable-for-callers-to-flag-allocations-from-high-memory-that-may-be-migrated-swap-prefetch.patch
> 
> The swap-prefetch feature is relatively compact:
> 
>    10 files changed, 745 insertions(+), 1 deletion(-)
> 
> it is contained mostly to itself:
> 
>    mm/swap_prefetch.c            |  581 ++++++++++++++++++++++++++++++++
> 
> i've reviewed it once again and in the !CONFIG_SWAP_PREFETCH case it's a 
> clear NOP, while in the CONFIG_SWAP_PREFETCH=y case all the feedback 
> i've seen so far was positive. Time to have this upstream and time for a 
> desktop-oriented distro to pick it up.
> 
> I think this has been held back way too long. It's .config selectable 
> and it is as ready for integration as it ever is going to be. So it's a 
> win/win scenario.

Being able to config all these core heuristics changes is really not that
much of a positive. The fact that we might _need_ to config something out,
and double the configuration range isn't too pleasing.

Here were some of my concerns, and where our discussion got up to.

Andrew Morton wrote:
 > On Fri, 04 May 2007 14:34:45 +1000 Nick Piggin <nickpiggin@yahoo.com.au> wrote:
 >
 >
 >>Andrew Morton wrote:
 >>
 >>>istr you had issues with swap-prefetch?
 >>>
 >>>If so, now's a good time to reiterate them ;)
 >>
 >>1) It is said to help with the updatedb overnight problem, however it
 >>    actually _doesn't_ prefetch swap when there are low free pages, which
 >>    is how updatedb will leave the system. So this really puzzles me how
 >>    it would work. However if updatedb is causing excessive swapout, I
 >>    think we should try improving use-once algorithms first, for example.
 >
 >
 > Yes.  Perhaps it just doesn't help with the updatedb thing.  Or maybe with
 > normal system activity we get enough free pages to kick the thing off and
 > running.  Perhaps updatedb itself has a lot of rss, for example.

Could be, but I don't know. I'd think it unlikely to allow _much_ swapin,
if huge amounts of the desktop have been swapped out. But maybe... as I
said, nobody seems to have a recipe for these things.


 > Would be useful to see this claim substantiated with a real testcase,
 > description of results and an explanation of how and why it worked.

Yes... and then try to first improve regular page reclaim and use-once
handling.


 >>2) It is a _highly_ speculative operation, and in workloads where periods
 >>    of low and high page usage with genuinely unused anonymous / tmpfs
 >>    pages, it could waste power, memory bandwidth, bus bandwidth, disk
 >>    bandwidth...
 >
 >
 > Yes.  I suspect that's a matter of waiting for the corner-case reporters to
 > complain, then add more heuristics.

Ugh. Well it is a pretty fundamental problem. Basically swap-prefetch is
happy to do a _lot_ of work for these things which we have already decided
are least likely to be used again.


 >>3) I haven't seen a single set of numbers out of it. Feedback seems to
 >>    have mostly come from people who
 >
 >
 > Yup.  But can we come up with a testcase?  It's hard.

I guess it is hard firstly because swapping is quite random to start with.
But I haven't even seen basic things like "make -jhuge swapstorm has no
regressions".


 >>4) If this is helpful, wouldn't it be equally important for things like
 >>    mapped file pages? Seems like half a solution.
 >
 >
 > True.
 >
 > Without thinking about it, I almost wonder if one could do a userspace
 > implementation with something which pokes around in /proc/pid/pagemap and
 > /proc/pid/kpagemap, perhaps with some additional interfaces added to
 > do a swapcache read.  (Give userspace the ability to get at swapcache
 > via a regular fd?)
 >
 > (otoh the akpm usersapce implementation is swapoff -a;swapon -a)

Perhaps. You may need a few indicators to see whether the system is idle...
but OTOH, we've already got a lot of indicators for memory, disk usage,
etc. So, maybe :)


 >>5) New one: it is possibly going to interact badly with MADV_FREE lazy
 >>    freeing. The more complex we make page reclaim, the worse IMO.
 >
 >
 > That's a bit vague.  What sort of problems do you envisage?

Well MADV_FREE pages aren't technically free, are they? So it might be
possible for a significant number of them to build up and prevent
swap prefetch from working. Maybe.


 >>...) I had a few issues with implementation, like interaction with
 >>    cpusets. Don't know if these are all fixed or not. I sort of gave
 >>    up looking at it.
 >
 >
 > Ah yes, I remember some mention of cpusets.  I forget what it was though.

I could be wrong, but IIRC there is no good way to know which cpuset to
bring the page back into, (and I guess similarly it would be hard to know
what container to account it to, if doing account-on-allocate).

We could hope that users of these features would be mostly disjoint sets,
but that's an evil road to start heading down, where we have various core
bits of mm that don't play nice together.

-- 
SUSE Labs, Novell Inc.

--
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:[~2007-05-04  7:34 UTC|newest]

Thread overview: 180+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-30 23:20 Andrew Morton
2007-04-30 23:59 ` Bill Irwin
2007-05-01  0:09 ` nfsd/md patches " Neil Brown
2007-05-01  9:08   ` Christoph Hellwig
2007-05-01  9:15     ` Andrew Morton
2007-05-01  9:21       ` Christoph Hellwig
2007-05-01  9:52     ` Neil Brown
2007-05-01 10:15       ` Christoph Hellwig
2007-05-01 14:34         ` Trond Myklebust
2007-05-01  0:54 ` MADV_FREE functionality Rik van Riel
2007-05-01  1:18   ` Andrew Morton
2007-05-01  1:23     ` Rik van Riel
2007-05-01  7:13     ` Jakub Jelinek
2007-05-01  1:23   ` Ulrich Drepper
2007-05-01  1:39 ` 2.6.22 -mm merge plans Stefan Richter
2007-05-01  2:30 ` 2.6.22 -mm merge plans (RE: input) Dmitry Torokhov
2007-05-01  8:11 ` 2.6.22 -mm merge plans -- pfn_valid_within Andy Whitcroft
2007-05-01  8:19   ` Andrew Morton
2007-05-01  8:44 ` 2.6.22 -mm merge plans -- vm bugfixes Nick Piggin
2007-05-01  8:54   ` Andrew Morton
2007-05-01 19:31   ` Hugh Dickins
2007-05-02  3:08     ` Nick Piggin
2007-05-02  9:15       ` Nick Piggin
2007-05-02 14:00       ` Hugh Dickins
2007-05-03  1:32         ` Nick Piggin
2007-05-03 10:37           ` Christoph Hellwig
2007-05-03 12:56             ` Nick Piggin
2007-05-04  9:23               ` Nick Piggin
2007-05-04  9:43                 ` Nick Piggin
2007-05-08  3:03                 ` Benjamin Herrenschmidt
2007-05-03 12:24           ` Hugh Dickins
2007-05-03 12:43             ` Nick Piggin
2007-05-03 12:58               ` Hugh Dickins
2007-05-03 13:08                 ` Nick Piggin
2007-05-03 16:52           ` Andrew Morton
2007-05-04  4:16             ` Nick Piggin
2007-05-09 12:34         ` Nick Piggin
2007-05-09 14:28           ` Hugh Dickins
2007-05-09 14:45             ` Nick Piggin
2007-05-09 15:38               ` Hugh Dickins
2007-05-09 22:24                 ` Nick Piggin
2007-05-01  8:46 ` pcmcia ioctl removal Christoph Hellwig
2007-05-01  8:56   ` Russell King
2007-05-01  8:57   ` Willy Tarreau
2007-05-01  9:08     ` Andrew Morton
2007-05-01 14:46       ` Adrian Bunk
2007-05-01  9:16   ` Robert P. J. Day
2007-05-01  9:44     ` Willy Tarreau
2007-05-01 10:16       ` Robert P. J. Day
2007-05-01 10:26       ` Gabriel C
2007-05-01 10:52         ` Willy Tarreau
2007-05-01 10:12     ` Jan Engelhardt
2007-05-01 11:00       ` Willy Tarreau
2007-05-01 12:06         ` Konstantin Münning
2007-05-01 13:56         ` Rogan Dawes
2007-05-01 19:10       ` Russell King
2007-05-01 20:41         ` Jan Engelhardt
2007-05-09 12:54   ` Pavel Machek
2007-05-09 13:00     ` Robert P. J. Day
2007-05-09 13:03     ` Adrian Bunk
2007-05-09 19:11       ` Romano Giannetti
2007-05-10 12:40         ` Adrian Bunk
2007-05-01  8:48 ` pci hotplug patches Christoph Hellwig
2007-05-02  3:57   ` Greg KH
2007-05-13 20:59     ` Christoph Hellwig
2007-05-14 11:48       ` Greg KH
2007-05-01  8:54 ` cache-pipe-buf-page-address-for-non-highmem-arch.patch Christoph Hellwig
2007-05-01  9:04   ` cache-pipe-buf-page-address-for-non-highmem-arch.patch Andrew Morton
2007-05-01 11:31     ` cache-pipe-buf-page-address-for-non-highmem-arch.patch Andi Kleen
2007-05-03  3:48     ` cache-pipe-buf-page-address-for-non-highmem-arch.patch Ken Chen
2007-05-01  8:55 ` consolidate-generic_writepages-and-mpage_writepages.patch Christoph Hellwig
2007-05-01  9:17 ` 2.6.22 -mm merge plans Pekka Enberg
2007-05-01  9:24   ` Christoph Hellwig
2007-05-01  9:37   ` Peter Zijlstra
2007-05-01 12:19   ` Andi Kleen
2007-05-01 17:12     ` Pekka Enberg
2007-05-01 10:16 ` fragmentation avoidance " Mel Gorman
2007-05-01 13:02   ` 2.6.22 -mm merge plans -- lumpy reclaim Andy Whitcroft
2007-05-01 18:03     ` Peter Zijlstra
2007-05-01 19:00     ` Andrew Morton
2007-05-01 14:54   ` fragmentation avoidance Re: 2.6.22 -mm merge plans Christoph Lameter
2007-05-01 19:00     ` Mel Gorman
2007-05-01 18:57   ` Andrew Morton
2007-05-07 13:07   ` Yasunori Goto
2007-05-01 14:31 ` 2.6.22 -mm merge plans: mm-more-rmap-checking Hugh Dickins
2007-05-02  1:42   ` Nick Piggin
2007-05-02 13:17     ` Hugh Dickins
2007-05-03  0:18       ` Nick Piggin
2007-05-01 16:56 ` 2.6.22 -mm merge plans Zan Lynx
2007-05-01 17:06 ` 2.6.22 -mm merge plans: mm-detach_vmas_to_be_unmapped-fix Hugh Dickins
2007-05-01 18:10 ` 2.6.22 -mm merge plans: slub Hugh Dickins
2007-05-01 19:25   ` Christoph Lameter
2007-05-01 19:55   ` Andrew Morton
2007-05-01 20:19     ` Hugh Dickins
2007-05-01 20:36       ` Andrew Morton
2007-05-01 20:46         ` Christoph Lameter
2007-05-01 21:09           ` Andrew Morton
2007-05-02 12:54         ` Hugh Dickins
2007-05-02 17:03           ` Christoph Lameter
2007-05-02 19:11             ` Andrew Morton
2007-05-02 19:42               ` Christoph Lameter
2007-05-02 19:54                 ` Sam Ravnborg
2007-05-02 20:14                   ` Christoph Lameter
2007-05-02 18:52           ` Siddha, Suresh B
2007-05-02 18:58             ` Christoph Lameter
2007-05-01 21:08       ` Christoph Lameter
2007-05-02 12:45         ` Hugh Dickins
2007-05-02 17:01           ` Christoph Lameter
2007-05-02 18:08             ` Hugh Dickins
2007-05-02 18:28               ` Christoph Lameter
2007-05-02 18:42                 ` Andrew Morton
2007-05-02 18:53                   ` Christoph Lameter
2007-05-02 17:25           ` Christoph Lameter
2007-05-02 18:36             ` Hugh Dickins
2007-05-02 18:39               ` Christoph Lameter
2007-05-02 18:57                 ` Andrew Morton
2007-05-02 19:01                   ` Christoph Lameter
2007-05-02 19:18                     ` Pekka Enberg
2007-05-02 19:34                       ` Christoph Lameter
2007-05-02 19:43                       ` Christoph Lameter
2007-05-03  8:15             ` Andrew Morton
2007-05-03  8:27               ` William Lee Irwin III
2007-05-03 16:30                 ` Christoph Lameter
2007-05-03  8:46               ` Hugh Dickins
2007-05-03  8:57                 ` Andrew Morton
2007-05-03  9:15                   ` Hugh Dickins
2007-05-03 21:04                     ` 2.6.22 -mm merge plans: slub on PowerPC Hugh Dickins
2007-05-03 21:15                       ` Christoph Lameter
2007-05-03 22:41                         ` Hugh Dickins
2007-05-04  0:25                       ` Benjamin Herrenschmidt
2007-05-04  0:54                         ` Christoph Lameter
2007-05-03 16:45                   ` 2.6.22 -mm merge plans: slub Christoph Lameter
2007-05-03 15:54 ` swap-prefetch: 2.6.22 -mm merge plans Ingo Molnar
2007-05-03 16:15   ` Michal Piotrowski
2007-05-03 16:23     ` Michal Piotrowski
2007-05-03 22:14   ` Con Kolivas
2007-05-04  7:34   ` Nick Piggin [this message]
2007-05-04  8:52     ` Ingo Molnar
2007-05-04  9:09       ` Nick Piggin
2007-05-04 12:10       ` Con Kolivas
2007-05-05  8:42         ` Con Kolivas
2007-05-06 10:13           ` [ck] " Antonino Ingargiola
2007-05-06 18:22           ` Jory A. Pratt
2007-05-09 23:28           ` Con Kolivas
2007-05-10  0:05             ` Nick Piggin
2007-05-10  1:34               ` Con Kolivas
2007-05-10  1:56                 ` Nick Piggin
2007-05-10  3:48                   ` Ray Lee
2007-05-10  3:56                     ` Nick Piggin
2007-05-10  5:52                       ` Ray Lee
2007-05-10  7:04                         ` Nick Piggin
2007-05-10  7:20                           ` William Lee Irwin III
2007-05-10 12:34                           ` Ray Lee
2007-05-12  4:46                           ` [PATCH] mm: swap prefetch improvements Con Kolivas
2007-05-12  5:03                             ` Paul Jackson
2007-05-12  5:15                               ` Con Kolivas
2007-05-12  5:51                                 ` Paul Jackson
2007-05-12  7:28                                   ` Con Kolivas
2007-05-12  8:14                                     ` Paul Jackson
2007-05-12  8:21                                       ` Con Kolivas
2007-05-12  8:37                                         ` Paul Jackson
2007-05-12  8:57                                           ` [PATCH respin] " Con Kolivas
2007-05-21 10:03                             ` [PATCH] " Ingo Molnar
2007-05-21 13:44                               ` Con Kolivas
2007-05-21 16:00                                 ` Ingo Molnar
2007-05-22 10:15                                   ` Antonino Ingargiola
2007-05-22 10:20                                     ` Con Kolivas
2007-05-22 10:25                                       ` Ingo Molnar
2007-05-22 10:37                                         ` Con Kolivas
2007-05-22 10:46                                           ` Ingo Molnar
2007-05-22 10:54                                             ` Con Kolivas
2007-05-22 10:57                                               ` Ingo Molnar
2007-05-22 11:04                                                 ` Con Kolivas
     [not found]                                                   ` <20070522111104.GA14950@elte.hu>
2007-05-22 11:12                                                     ` Ingo Molnar
2007-05-22 20:18                                             ` [ck] " Michael Chang
2007-05-22 20:31                                               ` Ingo Molnar
2007-05-10  3:58                     ` swap-prefetch: 2.6.22 -mm merge plans Con Kolivas
2007-05-07 14:28         ` Bill Davidsen
2007-05-07 14:18       ` Bill Davidsen
2007-05-07 17:47 ` Josef Sipek

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=463AE1EB.1020909@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@linux-foundation.org \
    --cc=kernel@kolivas.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@elte.hu \
    /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