From: Hugh Dickins <hugh@veritas.com>
To: Kamran Karimi <kamrankarimi@hotmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: How to find all the tasks with a Sys V shm?
Date: Tue, 7 Mar 2006 21:14:02 +0000 (GMT) [thread overview]
Message-ID: <Pine.LNX.4.61.0603072053550.3626@goblin.wat.veritas.com> (raw)
In-Reply-To: <BAY104-F1181301637BB5A23C2C731C0EE0@phx.gbl>
On Tue, 7 Mar 2006, Kamran Karimi wrote:
>
> id = ipc_findkey(&shm_ids, key);
> shp = shm_lock(id);
> ...
>
> But here we only get the vma of the task that created the shm, and not any
> other task who has attached it.
>
> How can we find all the vma structures that represent a shm?
The simplest example to follow would be reset_vma_truncate_counts() in
mm/memory.c: shp->shm_file->f_mapping gives you the struct address_space *
mapping to pass to vma_prio_tree_foreach(). Ignore the i_mmap_nonlinear
lines, you can't get nonlinear shm (because shm_vm_ops lacks .populate).
You'll need to spin_lock(&mapping->i_mmap_lock) first, spin_unlock after.
Hugh
prev parent reply other threads:[~2006-03-07 21:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-07 18:41 Kamran Karimi
2006-03-07 21:14 ` Hugh Dickins [this message]
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=Pine.LNX.4.61.0603072053550.3626@goblin.wat.veritas.com \
--to=hugh@veritas.com \
--cc=kamrankarimi@hotmail.com \
--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®