login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
April
»
24
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: KAMEZAWA Hiroyuki
Subject:
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
Date: Friday, April 23, 2010 - 7:02 pm
On Fri, 23 Apr 2010 16:58:01 +0100 Mel Gorman <mel@csn.ul.ie> wrote:
quoted text
> > I had considered this idea as well as it is vaguely similar to how zones get > > resized with a seqlock. I was hoping that the existing locking on anon_vma > > would be usable by backing off until uncontended but maybe not so lets > > check out this approach. > > > > A possible combination of the two approaches is as follows. It uses the > anon_vma lock mostly except where the anon_vma differs between the page > and the VMAs being walked in which case it uses the seq counter. I've > had it running a few hours now without problems but I'll leave it > running at least 24 hours. >
ok, I'll try this, too.
quoted text
> ==== CUT HERE ==== > mm,migration: Prevent rmap_walk_[anon|ksm] seeing the wrong VMA information by protecting against vma_adjust with a combination of locks and seq counter > > vma_adjust() is updating anon VMA information without any locks taken. > In constract, file-backed mappings use the i_mmap_lock. This lack of > locking can result in races with page migration. During rmap_walk(), > vma_address() can return -EFAULT for an address that will soon be valid. > This leaves a dangling migration PTE behind which can later cause a > BUG_ON to trigger when the page is faulted in. > > With the recent anon_vma changes, there is no single anon_vma->lock that > can be taken that is safe for rmap_walk() to guard against changes by > vma_adjust(). Instead, a lock can be taken on one VMA while changes > happen to another. > > What this patch does is protect against updates with a combination of > locks and seq counters. First, the vma->anon_vma lock is taken by > vma_adjust() and the sequence counter starts. The lock is released and > the sequence ended when the VMA updates are complete. > > The lock serialses rmap_walk_anon when the page and VMA share the same > anon_vma. Where the anon_vmas do not match, the seq counter is checked. > If a change is noticed, rmap_walk_anon drops its locks and starts again > from scratch as the VMA list may have changed. The dangling migration > PTE bug was not triggered after several hours of stress testing with > this patch applied. > > [kamezawa.hiroyu@jp.fujitsu.com: Use of a seq counter] > Signed-off-by: Mel Gorman <mel@csn.ul.ie>
I think this patch is nice! Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[BUGFIX][mm][PATCH] fix migration race in rmap_walk
, KAMEZAWA Hiroyuki
, (Thu Apr 22, 8:01 pm)
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
, Minchan Kim
, (Thu Apr 22, 10:11 pm)
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
, KAMEZAWA Hiroyuki
, (Thu Apr 22, 10:27 pm)
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
, Minchan Kim
, (Fri Apr 23, 12:00 am)
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
, KAMEZAWA Hiroyuki
, (Fri Apr 23, 12:17 am)
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
, Minchan Kim
, (Fri Apr 23, 12:53 am)
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
, KAMEZAWA Hiroyuki
, (Fri Apr 23, 12:55 am)
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
, Mel Gorman
, (Fri Apr 23, 2:59 am)
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
, Mel Gorman
, (Fri Apr 23, 8:58 am)
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
, KAMEZAWA Hiroyuki
, (Fri Apr 23, 7:02 pm)
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
, Mel Gorman
, (Sat Apr 24, 3:43 am)
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
, KAMEZAWA Hiroyuki
, (Sun Apr 25, 4:49 pm)
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
, KAMEZAWA Hiroyuki
, (Sun Apr 25, 7:53 pm)
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
, Minchan Kim
, (Sun Apr 25, 9:00 pm)
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
, Minchan Kim
, (Sun Apr 25, 9:06 pm)
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
, Minchan Kim
, (Sun Apr 25, 9:31 pm)
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
, KAMEZAWA Hiroyuki
, (Mon Apr 26, 2:28 am)
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
, Minchan Kim
, (Mon Apr 26, 2:48 am)
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
, KAMEZAWA Hiroyuki
, (Mon Apr 26, 2:49 am)
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
, Minchan Kim
, (Mon Apr 26, 3:07 am)
Re: [BUGFIX][mm][PATCH] fix migration race in rmap_walk
, Mel Gorman
, (Mon Apr 26, 4:36 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Ken Chen
[patch] sched: fix inconsistency when redistribute per-cpu tg->cfs_rq shares.
Ingo Molnar
Re: [PATCH v3] x86: merge the simple bitops and move them to bitops.h
Jan Engelhardt
Re: [PATCH] Allow Kconfig to set default mmap_min_addr protection
Dmitry Torokhov
Re: [2.6 patch] input/serio/hp_sdc.c section fix
Rafael J. Wysocki
[Bug #16380] Loop devices act strangely in 2.6.35
git
:
Steven Grimm
Using git as a general backup mechanism (was Re: Using GIT to store /etc)
Jeff King
Re: [PATCH] git-reset: allow --soft in a bare repo
Johannes Sixt
Re: [PATCH 01/14] msvc: Fix compilation errors in compat/win32/sys/poll.c
Johannes Schindelin
Re: [PATCH] Uninstall rule for top level Makefile
Shawn O. Pearce
Re: [PATCH v2] Speed up bash completion loading
git-commits-head
:
Linux Kernel Mailing List
cgroups: clean up cgroup_pidlist_find() a bit
Linux Kernel Mailing List
sony-laptop: Add support for extended hotkeys
Linux Kernel Mailing List
IB/core: Add support for masked atomic operations
Linux Kernel Mailing List
V4L/DVB (8939): cx18: fix sparse warnings
Linux Kernel Mailing List
ipv6 mcast: Check address family of gf_group in getsockopt(MS_FILTER).
linux-netdev
:
Inaky Perez-Gonzalez
[PATCH 40/40] wimax/i2400m: add CREDITS and MAINTAINERS entries
Karsten Keil
[mISDN PATCH v2 05/19] Reduce stack size in dsp_cmx_send()
linux
Re: 2.6.23-rc8 network problem. Mem leak? ip1000a?
David Miller
Re: tun: Use netif_receive_skb instead of netif_rx
David Miller
Re: [net-next PATCH v2] llc enhancements
freebsd-current
:
Matthew Fleming
Re: [RFC] Outline of USB process integration in the kernel taskqueue system
illoai@gmail.com
Re: OT: 2d password
Hartmut Brandt
Re: problem with nss_ldap
Andrew Reilly
Re: FreeBSD's problems as seen by the BSDForen.de community
Max Laier
Re: Upcoming ABI Breakage in RELENG_7
Colocation donated by:
Syndicate