linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@redhat.com>
To: Kelley Nielsen <kelleynnn@gmail.com>, jamieliu@google.com
Cc: linux-mm@kvack.org, riel@surriel.com,
	opw-kernel@googlegroups.com, hughd@google.com,
	akpm@linux-foundation.org, sarah.a.sharp@intel.com
Subject: Re: [RFC v5] mm: prototype: rid swapoff of quadratic complexity
Date: Tue, 01 Apr 2014 15:25:26 -0400	[thread overview]
Message-ID: <533B12A6.9020403@redhat.com> (raw)
In-Reply-To: <20140401051638.GA13715@kelleynnn-virtual-machine>

On 04/01/2014 01:16 AM, Kelley Nielsen wrote:
> The function try_to_unuse() is of quadratic complexity, with a lot of
> wasted effort. It unuses swap entries one by one, potentially iterating
> over all the page tables for all the processes in the system for each
> one.
> 
> This new proposed implementation of try_to_unuse simplifies its
> complexity to linear. It iterates over the system's mms once, unusing
> all the affected entries as it walks each set of page tables. It also
> makes similar changes to shmem_unuse.
> 
> Improvement
> 
> Time took by swapoff on a swap partition containing about 240M of data,
> with about 1.1G free memory and about 520M swap available. Swap
> partition was on a laptop with a hard disk drive (not SSD).
> 
> Present implementation....about 13.8s
> Prototype.................about  5.5s

> TODO
> 
> * Handle count of unused pages for frontswap.

That should probably wait for a follow-up patch. This patch is big
enough as is.

> Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>

Acked-by: Rik van Riel <riel@redhat.com>

-- 
All rights reversed

--
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:[~2014-04-01 20:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-01  5:16 [RFC v5] mm: prototype: rid swapoff of quadratic complexity Kelley Nielsen
2014-04-01 19:25 ` Rik van Riel [this message]
2014-04-09 23:22 ` Hugh Dickins

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=533B12A6.9020403@redhat.com \
    --to=riel@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=jamieliu@google.com \
    --cc=kelleynnn@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=opw-kernel@googlegroups.com \
    --cc=riel@surriel.com \
    --cc=sarah.a.sharp@intel.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).