mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jose Luis Marchetti <joseluismarchetti@yahoo.com.br>
To: linux-kernel@vger.kernel.org
Subject: What locks are needed to safely use vma->vm_file ?
Date: Mon, 10 May 2010 21:56:55 -0700 (PDT)	[thread overview]
Message-ID: <873867.32648.qm@web34405.mail.mud.yahoo.com> (raw)

Hi,

It appears that doing down_read(&mm->mmap_sem) is enough to safely use vma->vm_file, is it correct ?

Also in the lock subject, to get to all vm_files in the system, is the following correct or something is missing ?

read_lock(&tasklist_lock);
for_each_process(p)
{
    mm = get_task_mm(p);
    down_read(&mm->mmap_sem);

    // ... Here what I need to do with this mm vm_file objects

    up_read(&mm->mmap_sem);
    mmput(mm);
}
read_unlock(&tasklist_lock);

Thanks in advance for your answer
José Luís Marchetti


      

                 reply	other threads:[~2010-05-11  4:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=873867.32648.qm@web34405.mail.mud.yahoo.com \
    --to=joseluismarchetti@yahoo.com.br \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®