[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6599ad830707201409s30badabage2518dad09f17ae4@mail.gmail.com>
Date: Fri, 20 Jul 2007 14:09:09 -0700
From: "Paul Menage" <menage@...gle.com>
To: "Balbir Singh" <balbir@...ux.vnet.ibm.com>
Cc: "Andrew Morton" <akpm@...ux-foundation.org>,
"Peter Zijlstra" <a.p.zijlstra@...llo.nl>,
"Linux Containers" <containers@...ts.osdl.org>,
"YAMAMOTO Takashi" <yamamoto@...inux.co.jp>,
"Eric W Biederman" <ebiederm@...ssion.com>,
"Linux MM Mailing List" <linux-mm@...ck.org>,
"Vaidyanathan Srinivasan" <svaidy@...ux.vnet.ibm.com>,
"Pavel Emelianov" <xemul@...nvz.org>,
"Dave Hansen" <haveblue@...ibm.com>,
"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC][-mm PATCH 4/8] Memory controller memory accounting (v3)
On 7/20/07, Paul Menage <menage@...gle.com> wrote:
> > + mem = rcu_dereference(mm->mem_container);
> > + /*
> > + * For every charge from the container, increment reference
> > + * count
> > + */
> > + css_get(&mem->css);
> > + rcu_read_unlock();
>
> It's not clear to me that this is safe.
>
Sorry, didn't finish this thought.
Right after the rcu_dereference() the mm could be moved to another
container by some other process.
Since there's an rcu_synchronize() after the movement, and the
rcu_synchronize() caller holds container_mutex then I guess it's not
possible for a third process to delete the container during the RCU
section, since it won't be able to acquire the mutex until after the
RCU read section completes. So OK, it is safe, at least based on the
guarantees made by the current implementation.
Paul
-
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