linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Bob Liu <yjfpb04@gmail.com>, Bo Liu <bo-liu@hotmail.com>,
	linux-mm@kvack.org
Subject: Re: [PATCH] mm: remove incorrect swap_count() from try_to_unuse()
Date: Thu, 29 Oct 2009 08:38:01 +0900	[thread overview]
Message-ID: <20091029083801.c720b9d0.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0910282031470.19885@sister.anvils>

On Wed, 28 Oct 2009 20:34:38 +0000 (GMT)
Hugh Dickins <hugh.dickins@tiscali.co.uk> wrote:

> From: Bo Liu <bo-liu@hotmail.com>
> 
> In try_to_unuse(), swcount is a local copy of *swap_map, including the
> SWAP_HAS_CACHE bit; but a wrong comparison against swap_count(*swap_map),
> which masks off the SWAP_HAS_CACHE bit, succeeded where it should fail.
> 
Ah, okay...

> That had the effect of resetting the mm from which to start searching
> for the next swap page, to an irrelevant mm instead of to an mm in which
> this swap page had been found: which may increase search time by ~20%.
> But we're used to swapoff being slow, so never noticed the slowdown.
> 
> Remove that one spurious use of swap_count(): Bo Liu thought it merely
> redundant, Hugh rewrote the description since it was measurably wrong.
> 
> Signed-off-by: Bo Liu <bo-liu@hotmail.com>
> Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
> Cc: stable@kernel.org

Sorry for my misunderstanding.

Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

> ---
> 
>  mm/swapfile.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> --- 2.6.32-rc5/mm/swapfile.c	2009-10-05 04:20:31.000000000 +0100
> +++ linux/mm/swapfile.c	2009-10-28 19:31:43.000000000 +0000
> @@ -1151,8 +1151,7 @@ static int try_to_unuse(unsigned int typ
>  				} else
>  					retval = unuse_mm(mm, entry, page);
>  
> -				if (set_start_mm &&
> -				    swap_count(*swap_map) < swcount) {
> +				if (set_start_mm && *swap_map < swcount) {
>  					mmput(new_start_mm);
>  					atomic_inc(&mm->mm_users);
>  					new_start_mm = mm;

--
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-10-28 23:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-20  7:09 [PATCH] try_to_unuse : remove redundant swap_count() Bo Liu
2009-10-20 12:06 ` KAMEZAWA Hiroyuki
2009-10-21  1:12   ` Bo Liu
2009-10-21  1:25   ` Bob Liu
2009-10-28 20:31     ` Hugh Dickins
2009-10-28 20:34       ` [PATCH] mm: remove incorrect swap_count() from try_to_unuse() Hugh Dickins
2009-10-28 23:38         ` KAMEZAWA Hiroyuki [this message]
2009-11-02 16:50 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=20091029083801.c720b9d0.kamezawa.hiroyu@jp.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=bo-liu@hotmail.com \
    --cc=hugh.dickins@tiscali.co.uk \
    --cc=linux-mm@kvack.org \
    --cc=yjfpb04@gmail.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