linux-numa.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Ananya Muddukrishna <ananya@kth.se>
Cc: linux-numa@vger.kernel.org
Subject: Re: How to make get_mempolicy return a node id list for an address range?
Date: Tue, 10 Jan 2012 23:04:12 +0100	[thread overview]
Message-ID: <20120110220412.GA11715@one.firstfloor.org> (raw)
In-Reply-To: <loom.20120109T094056-260@post.gmane.org>

On Mon, Jan 09, 2012 at 09:09:30AM +0000, Ananya Muddukrishna wrote:
> Hi,
> 
> Given a range of virtual addresses (begin and end) which are allocated using 
> MPOL_INTERLEAVE, is there a quick way to know how this range is mapped to 
> different NUMA nodes? In particular, I would like to have a weighted node-id 
> list, where each node id in the list indicates how many address (or pages) are 
> mapped to it, similar to what is seen in /proc/<proc_id>/numa_maps.

You could just parse that?

> 
> I am thinking of doing this by using get_mempolicy(MPOL_F_NODE|MPOL_F_ADDR) for 
> every address in the range. This can be optimized for full correctness if I know 
> the starting address of all pages contained in the range. Can you give me some 
> tips on how to obtain that?

You could use mincore(), but it won't handle the case of the memory being
swapped out.

-Andi

      reply	other threads:[~2012-01-10 22:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-09  9:09 How to make get_mempolicy return a node id list for an address range? Ananya Muddukrishna
2012-01-10 22:04 ` Andi Kleen [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=20120110220412.GA11715@one.firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=ananya@kth.se \
    --cc=linux-numa@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;
as well as URLs for NNTP newsgroup(s).