linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Shaohua Li <shli@kernel.org>
To: Hugh Dickins <hughd@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Sasha Levin <sasha.levin@oracle.com>,
	Shaohua Li <shli@fusionio.com>, Rik van Riel <riel@redhat.com>,
	Minchan Kim <minchan@kernel.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH next/mmotm] swap: add per-partition lock for swapfile fix
Date: Mon, 28 Jan 2013 08:07:05 +0800	[thread overview]
Message-ID: <20130128000705.GA1306@kernel.org> (raw)
In-Reply-To: <alpine.LNX.2.00.1301271341030.16981@eggly.anvils>

On Sun, Jan 27, 2013 at 01:47:01PM -0800, Hugh Dickins wrote:
> I had all cpus spinning in swap_info_get(), for the lock on an area
> being swapped off: probably because get_swap_page() forgot to unlock.
> 
> Signed-off-by: Hugh Dickins <hughd@google.com>

Good catch. Thanks!

> ---
> 
>  mm/swapfile.c |    5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> --- mmotm.orig/mm/swapfile.c	2013-01-23 17:55:39.132447115 -0800
> +++ mmotm/mm/swapfile.c	2013-01-27 10:41:45.000000000 -0800
> @@ -470,10 +470,9 @@ swp_entry_t get_swap_page(void)
>  		spin_unlock(&swap_lock);
>  		/* This is called for allocating swap entry for cache */
>  		offset = scan_swap_map(si, SWAP_HAS_CACHE);
> -		if (offset) {
> -			spin_unlock(&si->lock);
> +		spin_unlock(&si->lock);
> +		if (offset)
>  			return swp_entry(type, offset);
> -		}
>  		spin_lock(&swap_lock);
>  		next = swap_list.next;
>  	}

--
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:[~2013-01-28  0:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-25  3:45 boot warnings due to swap: make each swap partition have one address_space Sasha Levin
2013-01-25  4:25 ` Shaohua Li
2013-01-25 23:37   ` Sasha Levin
2013-01-27  2:16   ` Hugh Dickins
2013-01-27 14:12     ` Shaohua Li
2013-01-27 21:40       ` Hugh Dickins
2013-01-29 15:56         ` Valdis.Kletnieks
2013-01-30  9:59         ` Shaohua Li
2013-02-04  5:12           ` Hugh Dickins
2013-01-27 21:47       ` [PATCH next/mmotm] swap: add per-partition lock for swapfile fix Hugh Dickins
2013-01-28  0:07         ` 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=20130128000705.GA1306@kernel.org \
    --to=shli@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=riel@redhat.com \
    --cc=sasha.levin@oracle.com \
    --cc=shli@fusionio.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).