login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
August
»
24
Re: [PATCH 2/5] memcg: use array and ID for quick look up
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Daisuke Nishimura
Subject:
Re: [PATCH 2/5] memcg: use array and ID for quick look up
Date: Monday, August 23, 2010 - 5:19 pm
> > > @@ -2231,7 +2244,7 @@ __mem_cgroup_commit_charge_swapin(struct
quoted text
> > > > > > id = swap_cgroup_record(ent, 0); > > > rcu_read_lock(); > > > - memcg = mem_cgroup_lookup(id); > > > + memcg = id_to_memcg(id); > > > if (memcg) { > > > /* > > > * This recorded memcg can be obsolete one. So, avoid > > > @@ -2240,9 +2253,10 @@ __mem_cgroup_commit_charge_swapin(struct > > > if (!mem_cgroup_is_root(memcg)) > > > res_counter_uncharge(&memcg->memsw, PAGE_SIZE); > > > mem_cgroup_swap_statistics(memcg, false); > > > + rcu_read_unlock(); > > > mem_cgroup_put(memcg); > > > - } > > > - rcu_read_unlock(); > > > + } else > > > + rcu_read_unlock(); > > > } > > > /* > > > * At swapin, we may charge account against cgroup which has no tasks. > > > @@ -2495,7 +2509,7 @@ void mem_cgroup_uncharge_swap(swp_entry_ > > > > > > id = swap_cgroup_record(ent, 0); > > > rcu_read_lock(); > > > - memcg = mem_cgroup_lookup(id); > > > + memcg = id_to_memcg(id); > > > if (memcg) { > > > /* > > > * We uncharge this because swap is freed. > > > @@ -2504,9 +2518,10 @@ void mem_cgroup_uncharge_swap(swp_entry_ > > > if (!mem_cgroup_is_root(memcg)) > > > res_counter_uncharge(&memcg->memsw, PAGE_SIZE); > > > mem_cgroup_swap_statistics(memcg, false); > > > + rcu_read_unlock(); > > > mem_cgroup_put(memcg); > > > - } > > > - rcu_read_unlock(); > > > + } else > > > + rcu_read_unlock(); > > > } > > > > > > /** > > Could you explain why we need rcu_read_unlock() before mem_cgroup_put() ? > > I suspect that it's because mem_cgroup_put() can free the memcg, but do we > > need mem->valid then ? > > > mem_cgroup_put() may call synchronize_rcu(). So, we have to unlock before it. >
Ah, I see. Thank you for your explanation. Daisuke Nishimura. --
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
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
Paul Turner
[tg_shares_up rewrite v4 11/11] sched: update tg->shares after cpu.shares write
Andi Kleen
Re: - romsignature-checksum-cleanup-2.patch removed from -mm tree
Axel Lin
[PATCH] tc6393xb: fix wrong goto labels for error handling
git
:
Christian Jaeger
Re: Problem with Git.pm bidi_pipe methods
Linus Torvalds
Re: mingw, windows, crlf/lf, and git
Nicolas Pitre
Re: [PATCH 2/2] Implement a simple delta_base cache
Linus Torvalds
[PATCH 1/7] Make unpack_trees_options bit flags actual bitfields
Jeff King
[PATCH 1/4] t4012: use test_cmp instead of cmp
git-commits-head
:
Linux Kernel Mailing List
i2c-i801: Add Intel Cougar Point device IDs
Linux Kernel Mailing List
Staging: batman-adv: splitting /proc vis file into vis_server and vis_data
Linux Kernel Mailing List
drm/i915: Add information on pinning and fencing to the i915 list debug.
Linux Kernel Mailing List
ocfs2: Stop orphan scan as early as possible during umount
Linux Kernel Mailing List
x86, apic: clean up spurious vector sanity check
linux-netdev
:
Richard Cochran
Re: [PATCH v3 3/3] ptp: Added a clock that uses the eTSEC found on the MPC85xx.
Gerrit Renker
v2 [PATCH 1/4] dccp: Limit feature negotiation to connection setup phase
Lennert Buytenhek
Re: [PATCH 3/6] [NET] dsa: add support for original DSA tagging format
Inaky Perez-Gonzalez
[PATCH 40/40] wimax/i2400m: add CREDITS and MAINTAINERS entries
Pavel Emelyanov
[PATCH net-2.6.26 2/2][NETNS]: The generic per-net pointers.
freebsd-current
:
Boris Samorodov
Re: twa + dump = sbwait
John Baldwin
Re: Possible case of sched_ule never honoring cpu_set affinity?
韓家標 Bill Hacker
Re: ZFS honesty
samira
sata atapi on ich9r
Bjoern A. Zeeb
Re: Can not boot 7.0-BETA3 with IPSEC
Colocation donated by:
Syndicate