login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
August
»
24
Re: [PATCH] memcg: use ID in page_cgroup
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: KAMEZAWA Hiroyuki
Subject:
Re: [PATCH] memcg: use ID in page_cgroup
Date: Tuesday, August 24, 2010 - 1:38 am
On Tue, 24 Aug 2010 01:35:37 -0700 Greg Thelen <gthelen@google.com> wrote:
quoted text
> > rcu_read_lock() is just for delaying to discard object, not for avoiding > > racy updates. All _updates_ requires proper lock or speculative logic as > > atomic_inc_not_zero() etc... Basically, RCU is for avoiding use-after-free. > > > Thanks for the info. Referring to your original patch: > > @@ -2014,11 +2025,11 @@ static int mem_cgroup_move_account(struc > > { > > int ret = -EINVAL; > > lock_page_cgroup(pc); > > - if (PageCgroupUsed(pc) && pc->mem_cgroup == from) { > > + if (PageCgroupUsed(pc) && id_to_memcg(pc->mem_cgroup, true) == from) { > > __mem_cgroup_move_account(pc, from, to, uncharge); > > ret = 0; > > } > > - unlock_page_cgroup(pc); > > + rcu_read_unlock(); > > > > It seems like mem_cgroup_move_account() is not balanced. Why is > lock_page_cgroup(pc) used to lock but rcu_read_unlock() used to unlock? >
Nice catch. It's bug. It seems my eyes were corrupted.. Will be fixed in the next version. Sorry for bad code. Thanks, -Kame --
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] memcg: towards I/O aware memcg v5
, KAMEZAWA Hiroyuki
, (Fri Aug 20, 2:55 am)
[PATCH 1/5] cgroup: ID notification call back
, KAMEZAWA Hiroyuki
, (Fri Aug 20, 2:58 am)
[PATCH 2/5] memcg: use array and ID for quick look up
, KAMEZAWA Hiroyuki
, (Fri Aug 20, 2:59 am)
[PATCH] memcg: use ID in page_cgroup
, KAMEZAWA Hiroyuki
, (Fri Aug 20, 3:01 am)
[PATCH 4/5] memcg: lockless update of file_mapped
, KAMEZAWA Hiroyuki
, (Fri Aug 20, 3:02 am)
[PATCH 5/5] memcg: generic file accounting update function
, KAMEZAWA Hiroyuki
, (Fri Aug 20, 3:03 am)
Re: [PATCH] memcg: use ID in page_cgroup
, KAMEZAWA Hiroyuki
, (Fri Aug 20, 3:05 am)
Re: [PATCH 2/5] memcg: use array and ID for quick look up
, Daisuke Nishimura
, (Sun Aug 22, 8:35 pm)
Re: [PATCH] memcg: use ID in page_cgroup
, Daisuke Nishimura
, (Sun Aug 22, 10:32 pm)
Re: [PATCH 4/5] memcg: lockless update of file_mapped
, Daisuke Nishimura
, (Mon Aug 23, 1:50 am)
Re: [PATCH 4/5] memcg: lockless update of file_mapped
, KAMEZAWA Hiroyuki
, (Mon Aug 23, 4:49 pm)
Re: [PATCH 2/5] memcg: use array and ID for quick look up
, KAMEZAWA Hiroyuki
, (Mon Aug 23, 4:51 pm)
Re: [PATCH] memcg: use ID in page_cgroup
, KAMEZAWA Hiroyuki
, (Mon Aug 23, 4:52 pm)
Re: [PATCH 2/5] memcg: use array and ID for quick look up
, Daisuke Nishimura
, (Mon Aug 23, 5:19 pm)
Re: [PATCH 4/5] memcg: lockless update of file_mapped
, Daisuke Nishimura
, (Mon Aug 23, 5:19 pm)
Re: [PATCH] memcg: use ID in page_cgroup
, Daisuke Nishimura
, (Mon Aug 23, 6:14 pm)
Re: [PATCH] memcg: use ID in page_cgroup
, KAMEZAWA Hiroyuki
, (Mon Aug 23, 6:54 pm)
Re: [PATCH] memcg: use ID in page_cgroup
, Daisuke Nishimura
, (Mon Aug 23, 9:04 pm)
Re: [PATCH] memcg: use ID in page_cgroup
, KAMEZAWA Hiroyuki
, (Mon Aug 23, 11:05 pm)
Re: [PATCH 1/5] cgroup: ID notification call back
, KAMEZAWA Hiroyuki
, (Tue Aug 24, 12:18 am)
Re: [PATCH 1/5] cgroup: ID notification call back
, Greg Thelen
, (Tue Aug 24, 12:19 am)
Re: [PATCH 2/5] memcg: use array and ID for quick look up
, KAMEZAWA Hiroyuki
, (Tue Aug 24, 12:42 am)
Re: [PATCH 2/5] memcg: use array and ID for quick look up
, Greg Thelen
, (Tue Aug 24, 12:44 am)
Re: [PATCH] memcg: towards I/O aware memcg v5
, Balbir Singh
, (Tue Aug 24, 12:46 am)
Re: [PATCH] memcg: use ID in page_cgroup
, Greg Thelen
, (Tue Aug 24, 12:47 am)
Re: [PATCH] memcg: use ID in page_cgroup
, KAMEZAWA Hiroyuki
, (Tue Aug 24, 12:51 am)
Re: [PATCH] memcg: towards I/O aware memcg v5
, KAMEZAWA Hiroyuki
, (Tue Aug 24, 12:59 am)
Re: [PATCH] memcg: use ID in page_cgroup
, Greg Thelen
, (Tue Aug 24, 1:35 am)
Re: [PATCH] memcg: use ID in page_cgroup
, KAMEZAWA Hiroyuki
, (Tue Aug 24, 1:38 am)
Re: [PATCH 1/5] cgroup: ID notification call back
, Li Zefan
, (Tue Aug 24, 2:04 am)
Re: [PATCH 1/5] cgroup: ID notification call back
, KAMEZAWA Hiroyuki
, (Tue Aug 24, 4:58 pm)
Re: [PATCH 1/5] cgroup: ID notification call back
, Paul Menage
, (Tue Aug 24, 5:09 pm)
Re: [PATCH 1/5] cgroup: ID notification call back
, Paul Menage
, (Tue Aug 24, 5:11 pm)
Re: [PATCH 1/5] cgroup: ID notification call back
, KAMEZAWA Hiroyuki
, (Tue Aug 24, 5:17 pm)
Re: [PATCH 1/5] cgroup: ID notification call back
, KAMEZAWA Hiroyuki
, (Tue Aug 24, 5:20 pm)
Re: [PATCH 1/5] cgroup: ID notification call back
, Paul Menage
, (Tue Aug 24, 5:25 pm)
Re: [PATCH 1/5] cgroup: ID notification call back
, Paul Menage
, (Tue Aug 24, 5:34 pm)
Re: [PATCH 1/5] cgroup: ID notification call back
, KAMEZAWA Hiroyuki
, (Tue Aug 24, 5:37 pm)
Re: [PATCH 1/5] cgroup: ID notification call back
, Paul Menage
, (Tue Aug 24, 5:46 pm)
Re: [PATCH 1/5] cgroup: ID notification call back
, KAMEZAWA Hiroyuki
, (Tue Aug 24, 6:03 pm)
Re: [PATCH 1/5] cgroup: ID notification call back
, Paul Menage
, (Tue Aug 24, 6:35 pm)
Re: [PATCH 1/5] cgroup: ID notification call back
, KAMEZAWA Hiroyuki
, (Tue Aug 24, 6:42 pm)
Re: [PATCH 1/5] cgroup: ID notification call back
, Paul Menage
, (Tue Aug 24, 6:52 pm)
Re: [PATCH 1/5] cgroup: ID notification call back
, KAMEZAWA Hiroyuki
, (Tue Aug 24, 7:29 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Kay Sievers
Re: char/tpm: tpm_infineon no longer loaded for HP 2510p laptop
Eric W. Biederman
[PATCH 8/8] sysfs: user namespaces: fix bug with clone(CLONE_NEWUSER) with fairsched
S K
Re: cpufreq doesn't seem to work in Intel Q9300
Bart Van Assche
Re: Is gcc thread-unsafe?
Greg Kroah-Hartman
[PATCH 20/36] Driver core: Call device_pm_add() after bus_add_device() in device_a...
git
:
Junio C Hamano
Re: git-svnimport
Junio C Hamano
Re: [PATCH] git-mv: Keep moved index entries inact
Johannes Schindelin
Re: [PATCH] Fix approxidate("never") to always return 0
A Large Angry SCM
Re: [RFC] origin link for cherry-pick and revert
Gabriel
[PATCH] When a remote is added but not fetched, tell the user.
linux-netdev
:
Daniel Lezcano
getsockopt(TCP_DEFER_ACCEPT) value change
David Miller
Re: 2.6.27.18: bnx2/tg3: BUG: "scheduling while atomic" trying to ifenslave a seco...
Ingo Molnar
Re: [regression] nf_iterate(), BUG: unable to handle kernel NULL pointer dereference
Eric W. Biederman
[PATCH 14/20] net: Simplify pppol2tp pernet operations.
Jeff Kirsher
[net-2.6 PATCH 2/5] e1000e: increase swflag acquisition timeout for ICHx/PCH
git-commits-head
:
Linux Kernel Mailing List
ath9k_htc: Allocate URBs properly
Linux Kernel Mailing List
sm501: add power control callback
Linux Kernel Mailing List
MIPS: Cavium: Remove unused watchdog code.
Linux Kernel Mailing List
V4L/DVB (8976): af9015: Add USB ID for AVerMedia A309
Linux Kernel Mailing List
ARM: 5670/1: bcmring: add default configuration for bcmring arch
openbsd-misc
:
daniele.pilenga
snmpd hangs on 4.1 looking up hrSWRunTable
Jason Dixon
Re: any web management gui for pf ?
Christophe Rioux
Implementation example of snmp
Nick Holland
Re: booting openbsd on eee without cd-rom
Bryan Irvine
Re: OpenBSD 4.7 Released, May 19 2010
Colocation donated by:
Syndicate