OpenVZ Forum


Home » Mailing lists » Devel » [RFC][-mm PATCH 0/8] Memory controller introduction (v3)
Re: [RFC][-mm PATCH 4/8] Memory controller memory accounting (v3) [message #19420 is a reply to message #19419] Fri, 20 July 2007 21:09 Go to previous messageGo to previous message
Paul Menage is currently offline  Paul Menage
Messages: 642
Registered: September 2006
Senior Member
On 7/20/07, Paul Menage <menage@google.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
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: [ckrm-tech] containers development plans
Next Topic: unexpected scsi timeout
Goto Forum:
  


Current Time: Sun Aug 24 05:08:18 GMT 2025

Total time taken to generate the page: 0.09307 seconds