From: Shaohua Li <shli@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, riel@redhat.com, minchan@kernel.org,
kmpark@infradead.org, hughd@google.com, aquini@redhat.com
Subject: Re: [patch 4/4 v4]swap: make cluster allocation per-cpu
Date: Thu, 13 Jun 2013 19:50:35 +0800 [thread overview]
Message-ID: <20130613115035.GC26947@kernel.org> (raw)
In-Reply-To: <20130612152231.d342ac905d8982db6935b739@linux-foundation.org>
On Wed, Jun 12, 2013 at 03:22:31PM -0700, Andrew Morton wrote:
> On Tue, 26 Mar 2013 13:38:43 +0800 Shaohua Li <shli@kernel.org> wrote:
>
> > swap cluster allocation is to get better request merge to improve performance.
> > But the cluster is shared globally, if multiple tasks are doing swap, this will
> > cause interleave disk access. While multiple tasks swap is quite common, for
> > example, each numa node has a kswapd thread doing swap or multiple
> > threads/processes do direct page reclaim.
> >
> > We makes the cluster allocation per-cpu here. The interleave disk access issue
> > goes away. All tasks will do sequential swap.
>
> Why per-cpu rather than, say, per-mm or per-task?
Good question. per-cpu is easier to implement :). per-mm or per-task is likely
to be more readahead friendly for sequential workload. per-cpu is better in
swapout side for random workload. Not sure which is more important. I choose to
solve the swapout issue. Definitely this should be revisit if we want a better
swapin readahead. But if you dislike this patch, I'm ok to drop it in next
post.
> > If one CPU can't get its per-cpu cluster, it will fallback to scan swap_map.
>
> Under what circumstances can a cpu "not get its per-cpu cluster"? A
> cpu can always "get" its per-cpu data, by definition (unless perhaps
> interrupts are involved). Perhaps this description needs some
> expanding upon.
the circumstance is there is no free cluster. I'll rewrite the description.
Thanks,
Shaohua
--
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>
prev parent reply other threads:[~2013-06-13 11:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-26 5:38 [patch 4/4 v4]swap: make cluster allocation per-cpu Shaohua Li
2013-03-29 3:14 ` Rafael Aquini
2013-06-12 22:22 ` Andrew Morton
2013-06-13 11:50 ` Shaohua Li [this message]
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=20130613115035.GC26947@kernel.org \
--to=shli@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=aquini@redhat.com \
--cc=hughd@google.com \
--cc=kmpark@infradead.org \
--cc=linux-mm@kvack.org \
--cc=minchan@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;
as well as URLs for NNTP newsgroup(s).