Kernel Newbies archive mirror
 help / color / mirror / Atom feed
From: Arun chandran <arun.edarath@gmail.com>
To: kernelnewbies@kernelnewbies.org
Subject: unable to find the virtual to physical mapping
Date: Tue, 6 Dec 2022 12:13:16 +0530	[thread overview]
Message-ID: <CAL9taR12ceM=LE7U0cLNp3AuHXddW83_HcPmG1i6LgjTAe15Tg@mail.gmail.com> (raw)

Hi,

I am trying to find the virtual to physical memory mapping of a
process with kernel/linux-4.18.0-348.7.1.el8_5/tools/vm/page-types.c

a) It gives the below output for a process with pid 19721

# ./page-types -p 19721 -l | head
voffset offset  len     flags
400     108bf36 1       __RU_lA____M_______________________________
600     135bf80 1       ___U_l_____Ma_b____________________________
601     1258e11 1       ___U_l_____Ma_b____________________________
6aa     110075a 1       ___U_l_____Ma_b____________________________
7f335f72c       2741b88 4       __RU_lA____M_______________________________
7f335f730       20546b1 3       __RU_lA____M_______________________________
7f335f733       2741b3e 2       __RU_lA____M_______________________________
7f335f735       2741a20 1e      __RU_lA____M_______________________________
7f335f753       2054690 1d      __RU_lA____M_______________________________

Here the physical offsets are 28 bits. By adjusting for the 4k
pagesize I can derive a meaningful 40 bit physical address.

b) for another process it is giving
 # ./page-types -p 19694 -l | head
voffset offset  len     flags
400     3f0366  1       __RU_lA____M_______________________________
401     19a32b  1       __RU_lA____M_______________________________
402     18d702  1       __RU_lA____M_______________________________
403     3f3fe5  1       __RU_lA____M_______________________________
404     1fbaa8  1       __RU_lA____M_______________________________
405     3f3cea  1       __RU_lA____M_______________________________
406     110455  1       __RU_lA____M_______________________________
407     30a7a8  1       __RU_lA____M_______________________________
408     2eaaee  1       __RU_lA____M_______________________________

In this, all the physical offsets are only 24 bits. Why is it like that?
The flags are not showing it as a huge page also.

RAM is mapped as

 # cat /proc/iomem | grep -i ram
00001000-0009ffff : System RAM
00100000-03ffffff : System RAM
04047000-75ceffff : System RAM
76000000-9fdbb017 : System RAM
9fdbb018-9fdcc457 : System RAM
9fdcc458-9fdcd017 : System RAM
9fdcd018-9fddb857 : System RAM
9fddb858-a21f1fff : System RAM
a2245000-a2271fff : System RAM
a2273000-a66c2fff : System RAM
a99ff000-abffffff : System RAM
100000000-104fdfffff : System RAM
1050000000-204fefffff : System RAM
2050000000-304fefffff : System RAM
3050000000-404f2fffff : System RAM
4050000000-504fefffff : System RAM
5050000000-604fefffff : System RAM
6050000000-704fefffff : System RAM
7050000000-804fefffff : System RAM

How do I find out to which NUMA node's ram the physical address
"3f0366" belongs?

--Arun

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

             reply	other threads:[~2022-12-06  6:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-06  6:43 Arun chandran [this message]
2022-12-06  8:18 ` unable to find the virtual to physical mapping Arun chandran

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='CAL9taR12ceM=LE7U0cLNp3AuHXddW83_HcPmG1i6LgjTAe15Tg@mail.gmail.com' \
    --to=arun.edarath@gmail.com \
    --cc=kernelnewbies@kernelnewbies.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 read-only IMAP folder(s) and NNTP newsgroup(s).