login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
September
»
29
Re: [PATCH 1/4] memcg: account swap cache under lock
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Daisuke Nishimura
Subject:
Re: [PATCH 1/4] memcg: account swap cache under lock
Date: Monday, September 29, 2008 - 4:33 am
On Mon, 29 Sep 2008 19:21:23 +0900, KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
quoted text
> While page-cache's charge/uncharge is done under page_lock(), swap-cache > isn't. (anonymous page is charged when it's newly allocated.) > > This patch moves do_swap_page()'s charge() call under lock. > I don't see any bad problem *now* but this fix will be good for future > for avoiding unneccesary racy state. > > > Changelog: (v5) -> (v6) > - mark_page_accessed() is moved before lock_page(). > - fixed missing unlock_page() > (no changes in previous version) > > Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> >
Looks good to me. Reviewed-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
quoted text
> mm/memory.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > Index: mmotm-2.6.27-rc7+/mm/memory.c > =================================================================== > --- mmotm-2.6.27-rc7+.orig/mm/memory.c > +++ mmotm-2.6.27-rc7+/mm/memory.c > @@ -2326,16 +2326,17 @@ static int do_swap_page(struct mm_struct > count_vm_event(PGMAJFAULT); > } > > + mark_page_accessed(page); > + > + lock_page(page); > + delayacct_clear_flag(DELAYACCT_PF_SWAPIN); > + > if (mem_cgroup_charge(page, mm, GFP_KERNEL)) { > - delayacct_clear_flag(DELAYACCT_PF_SWAPIN); > ret = VM_FAULT_OOM; > + unlock_page(page); > goto out; > } > > - mark_page_accessed(page); > - lock_page(page); > - delayacct_clear_flag(DELAYACCT_PF_SWAPIN); > - > /* > * Back out if somebody else already faulted in this pte. > */ >
--
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:
[PATCH 0/4] memcg: ready-to-go series (was memcg update v6)
, KAMEZAWA Hiroyuki
, (Mon Sep 29, 3:19 am)
[PATCH 1/4] memcg: account swap cache under lock
, KAMEZAWA Hiroyuki
, (Mon Sep 29, 3:21 am)
[PATCH 2/4] memcg: set page->mapping NULL before uncharge
, KAMEZAWA Hiroyuki
, (Mon Sep 29, 3:22 am)
[PATCH 3/4] memcg: avoid account not-on-LRU pages
, KAMEZAWA Hiroyuki
, (Mon Sep 29, 3:23 am)
[PATCH 4/4] memcg: optimze cpustat
, KAMEZAWA Hiroyuki
, (Mon Sep 29, 3:24 am)
Re: [PATCH 3/4] memcg: avoid account not-on-LRU pages
, Daisuke Nishimura
, (Mon Sep 29, 4:19 am)
Re: [PATCH 1/4] memcg: account swap cache under lock
, Daisuke Nishimura
, (Mon Sep 29, 4:33 am)
Re: [PATCH 2/4] memcg: set page->mapping NULL before uncharge
, Daisuke Nishimura
, (Mon Sep 29, 4:39 am)
Re: [PATCH 4/4] memcg: optimze cpustat
, Daisuke Nishimura
, (Mon Sep 29, 4:44 am)
Re: Re: [PATCH 3/4] memcg: avoid account not-on-LRU pages
, kamezawa.hiroyu
, (Mon Sep 29, 4:59 am)
[PATCH/stylefix 3/4] memcg: avoid account not-on-LRU pages
, KAMEZAWA Hiroyuki
, (Mon Sep 29, 6:17 pm)
Re: [PATCH 1/4] memcg: account swap cache under lock
, Balbir Singh
, (Tue Sep 30, 1:05 am)
Re: [PATCH 3/4] memcg: avoid account not-on-LRU pages
, Balbir Singh
, (Tue Sep 30, 1:14 am)
Re: [PATCH/stylefix 3/4] memcg: avoid account not-on-LRU pages
, Balbir Singh
, (Tue Sep 30, 8:49 pm)
Re: [PATCH 2/4] memcg: set page->mapping NULL before uncharge
, Balbir Singh
, (Tue Sep 30, 8:50 pm)
Re: [PATCH/stylefix 3/4] memcg: avoid account not-on-LRU pages
, KAMEZAWA Hiroyuki
, (Tue Sep 30, 9:50 pm)
Re: [PATCH 0/4] memcg: ready-to-go series (was memcg updat ...
, Balbir Singh
, (Mon Oct 6, 10:15 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg Kroah-Hartman
[PATCH 17/36] sysdev: detect multiple driver registrations
Greg Kroah-Hartman
[PATCH 22/36] PM: Make wakeup flags available whenever CONFIG_PM is set
Greg Kroah-Hartman
[PATCH 20/36] Driver core: Call device_pm_add() after bus_add_device() in device_a...
Greg Kroah-Hartman
[PATCH 26/36] Kobject: Replace list_for_each() with list_for_each_entry().
Robert P. J. Day
Re: [uml-devel] User Mode Linux still doesn't build in 2.6.23-final.
git
:
Johannes Schindelin
Re: [PATCH 2/2] git-svn: support fetch with autocrlf on
Mark Burton
Re: [PATCH] builtin-branch: highlight current remote branches with an asterisk
Pieter de Bie
Re: Using url.insteadOf in git-clone
Junio C Hamano
Re: [PATCH 6/6] Teach core object handling functions about gitlinks
Teemu Likonen
Re: [PATCH] gc --aggressive: make it really aggressive
linux-netdev
:
Lennert Buytenhek
Re: Distributed Switch Architecture(DSA)
Pavel Emelyanov
Re: [RFC][PATCH] ns: Syscalls for better namespace sharing control.
Daniel Schaffrath
Re: tcp bw in 2.6
Guo-Fu Tseng
Re: jme: UDP checksum error, and lots of them
Gerrit Renker
[PATCH 37/37] dccp: Debugging functions for feature negotiation
openbsd-misc
:
Conor
Re: RFID Reader
Josh Grosse
ssh/sshd challenge-response seems to have stopped working in -current
Pieter Verberne
File collision while using pkg_add
Stuart Henderson
Re: SquidGuard problem
Western Union
Online account has been suspended
git-commits-head
:
Linux Kernel Mailing List
ath9k_htc: Allocate URBs properly
Linux Kernel Mailing List
ath9k: Added get_survey callback in order to get channel noise
Linux Kernel Mailing List
ALSA: snd-usb-caiaq: Do not expose hardware input mode 0 of A4DJ
Linux Kernel Mailing List
tracing: protect reader of cmdline output
Linux Kernel Mailing List
kconfig: recalc symbol value before showing search results
Colocation donated by:
Syndicate