OpenVZ Forum


Home » Mailing lists » Devel » [RFC PATCH 5/5] refresh VM committed space after a task migration
Re: [RFC PATCH 5/5] refresh VM committed space after a task migration [message #30924 is a reply to message #30901] Tue, 10 June 2008 17:41 Go to previous messageGo to previous message
Dave Hansen is currently offline  Dave Hansen
Messages: 240
Registered: October 2005
Senior Member
On Tue, 2008-06-10 at 01:33 +0200, Andrea Righi wrote:
> +       preempt_disable();
> +       committed = atomic_long_read(&p->vm_committed_space);
> +       atomic_long_sub(committed, &old_mem->vmacct.vm_committed_space);
> +       atomic_long_add(committed, &mem->vmacct.vm_committed_space);
> +       preempt_enable();
>  out:
>         mmput(mm);
>  }

Why bother with the preempt stuff here?  What does the actually protect
against?  I assume that you're trying to keep other tasks that might run
on this CPU from seeing weird, inconsistent numbers in here.  Is there
some other looks that keeps *other* cpus from seeing this?

In any case, I think it needs a big, fat comment.

-- Dave

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
 
Read Message
Read Message
Read Message
Previous Topic: [-mm] CPU controller statistics (v5)
Next Topic: [RFC PATCH 3/5] mgmcg VM overcommit interface
Goto Forum:
  


Current Time: Sun Aug 03 06:18:54 GMT 2025

Total time taken to generate the page: 0.69009 seconds