public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave@linux.vnet.ibm.com>
To: Andrea Righi <righi.andrea@gmail.com>
Cc: balbir@linux.vnet.ibm.com, linux-kernel@vger.kernel.org,
	kosaki.motohiro@jp.fujitsu.com, containers@lists.osdl.org,
	menage@google.com, xemul@openvz.org
Subject: Re: [RFC PATCH 5/5] refresh VM committed space after a task migration
Date: Tue, 10 Jun 2008 10:41:28 -0700	[thread overview]
Message-ID: <1213119688.13882.13.camel@nimitz> (raw)
In-Reply-To: <1213054383-18137-6-git-send-email-righi.andrea@gmail.com>

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


  reply	other threads:[~2008-06-10 17:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-09 23:33 [RFC PATCH 5/5] refresh VM committed space after a task migration Andrea Righi
2008-06-10 17:41 ` Dave Hansen [this message]
2008-06-11 10:37   ` Andrea Righi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1213119688.13882.13.camel@nimitz \
    --to=dave@linux.vnet.ibm.com \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=containers@lists.osdl.org \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=menage@google.com \
    --cc=righi.andrea@gmail.com \
    --cc=xemul@openvz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox