lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110111114453.GC11932@csn.ul.ie>
Date:	Tue, 11 Jan 2011 11:44:54 +0000
From:	Mel Gorman <mel@....ul.ie>
To:	Hugh Dickins <hughd@...gle.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Rik van Riel <riel@...hat.com>,
	Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
	Jun'ichi Nomura <j-nomura@...jp.nec.com>,
	Andi Kleen <ak@...ux.intel.com>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: fix migration hangs on anon_vma lock

On Mon, Jan 10, 2011 at 11:08:04PM -0800, Hugh Dickins wrote:
> Increased usage of page migration in mmotm reveals that the anon_vma
> locking in unmap_and_move() has been deficient since 2.6.36 (or even
> earlier). 

Hmm, a certain amount of the compaction work was spent fixing migration
bugs. I wonder if there are mysterious bug reports out there related to the
use of move_pages() that are only getting fixed now.

> Review at the time of f18194275c39835cb84563500995e0d503a32d9a
> "mm: fix hang on anon_vma->root->lock" missed the issue here: the anon_vma
> to which we get a reference may already have been freed back to its slab
> (it is in use when we check page_mapped, but that can change), and so its
> anon_vma->root may be switched at any moment by reuse in anon_vma_prepare.
> 
> Perhaps we could fix that with a get_anon_vma_unless_zero(), but let's not:
> just rely on page_lock_anon_vma() to do all the hard thinking for us, then
> we don't need any rcu read locking over here.
> 
> In removing the rcu_unlock label: since PageAnon is a bit in page->mapping,
> it's impossible for a !page->mapping page to be anon; but insert VM_BUG_ON
> in case the implementation ever changes.
> 
> Signed-off-by: Hugh Dickins <hughd@...gle.com>
> Cc: stable@...nel.org [2.6.37, 2.6.36]

Reasoning and patch look correct. Light testing did not show up any
obvious problems.

Reviewed-by: Mel Gorman <mel@....ul.ie>

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ