LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 07-03-2015, 04:34 AM   #1
Nakajima
LQ Newbie
 
Registered: Jul 2015
Posts: 2

Rep: Reputation: Disabled
Question about /proc/PID/pagemap, /proc/kpageflags


I have 2 questions.

////////////////////////////////////////////////////////////
1. Why physical address is greater than the installed memory?
////////////////////////////////////////////////////////////

-- Installed memory is 8GB

RHEL7# grep MemTotal /proc/meminfo
MemTotal: 7840900 kB

RHEL7# dmidecode | grep -A 5 'Memory Device' | grep Size
Size: 4096 MB
Size: No Module Installed
Size: 4096 MB
Size: No Module Installed


-- Physical address is greater than 8GB

RHEL7# wc -c /proc/kpageflags
19136504 /proc/kpageflags

19136504 / 8Bytes x 4KB = 9.125GB


-- My program which is using pagemap shows following.

Phy_addr : 247f1e000 Virt_addr : 7f177ce2e000 systemd-journal(PID:514)


-- crash shows same physical address above 8GB!!.

crash> vtop -c 514 7f177ce2e000
VIRTUAL PHYSICAL
7f177ce2e000 247f1e000

247f1e000 = 9G 127M 120K


Why physical address is greater than installed memory?
Why is it possible?



////////////////////////////////////////////////////////////
2. What is convenient use of pagemap for troubleshooting?
////////////////////////////////////////////////////////////

For example, we can use the USS(Unique Set Size) to invest process memory leak.

Calculating USS by using pagemap
/proc/PID/pagemap has physical address and kpagecount is 1.
USS = Total of above condition pages x 4KB.

But, we can do the same thing by using smaps.
cat /proc/PID/smaps | awk '/^Private/{sum += $2}END{print sum}'



What is convenient use of pagemap for troubleshooting? (It's difficult by smaps)
 
Old 07-06-2015, 08:41 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
1) Computers have advanced a little since 8-bit microprocessor days. Physical memory is made up of multiple segments. You can see them being enumerated by doing:

Code:
dmesg |grep e820
2) I've been doing kernel and driver development for quite a while and have never used pagemap, but I guess you can always learn new things. The only time I ever cared about a physical address was debugging a DMA problem on fibre channel cards (32-bit wraparound problem). You don't like virtual addresses for some reason?
 
1 members found this post helpful.
Old 07-07-2015, 03:37 AM   #3
Nakajima
LQ Newbie
 
Registered: Jul 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks for reply.

1) e820 became very study for me.
Intel Memory Reclaiming function maps Hardware address at Memory Hole(around 3GB - 4GB), and remaps this RAM above 4GB.
My question was solved.

2) I'm sorry for less words.
I am excited that it is possible to know the physical address.
But my boss said what can this use for? Because my job is a trouble shooting for SIer departments within a company.
I am searching convenient use for memory troubleshooting.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] What does /proc/PID/auxv mean exactly? corone Linux - Kernel 3 08-15-2012 09:28 AM
pmap or /proc/<pid>smap or /proc/<pid>/status iQoder Linux - Newbie 1 07-16-2009 06:32 PM
/proc/pid/maps Moraxus Linux - General 0 02-11-2009 08:49 AM
Boot hang after 'proc on /proc type proc (rw)' Hagoromo Slackware 13 10-05-2007 05:03 PM
/proc/pid/io seems not to work kornelix Linux - Server 5 06-17-2007 02:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 11:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration