[Hotplug_sig] Reminder Hotplug SIG Con Call for 02/14 11am Pacific

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 13, 2006 at 01:23:33PM -0500, Silbermann, Martine wrote:
> * From memory hotplug test plan to scripts - discussion

Here's some answers to questions that came up today.



1.  What info is available from /proc/meminfo?

dev4-013 ~ # cat /proc/meminfo
MemTotal:     15919280 kB
MemFree:      10523152 kB
Buffers:       1300972 kB
Cached:          57528 kB
SwapCached:          0 kB
Active:        1136956 kB
Inactive:       229760 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:     15919280 kB
LowFree:      10523152 kB
SwapTotal:      508024 kB
SwapFree:       508024 kB
Dirty:              24 kB
Writeback:           0 kB
Mapped:          11628 kB
Slab:          4006412 kB
CommitLimit:   8467664 kB
Committed_AS:    22180 kB
PageTables:        356 kB
VmallocTotal: 2147483647 kB
VmallocUsed:      1128 kB
VmallocChunk: 2147482511 kB
HugePages_Total:     0
HugePages_Free:      0
Hugepagesize:    16384 kB

Here is a page defining what these parameters mean:
    http://www.redhat.com/advice/tips/meminfo.html



2.  How to determine what areas of memory a process is using?

I had remembered seeing a tool for this recently.  After digging around
a bit I found it - it was an article I read a couple weeks ago that
explained the Linux memory model:
    http://virtualthreads.blogspot.com/2006/02/understanding-memory-usage-on-linux.html

The command is `pmap`.  You specify a process ID and it displays the
memory usage for that process and all of its libraries.  For example:

aether /usr/src/linux    (636)$ pmap 29415
29415:   emacs -nw /tmp/mutt-aether-1000-22564-160
0000000000400000   1204K r-x--  /usr/bin/emacs.emacs-21
000000000062c000   4888K rw---  /usr/bin/emacs.emacs-21
0000000000af2000    284K rw---    [ anon ]
00002aaaaaaab000     84K r-x--  /lib64/ld-2.3.5.so
00002aaaaaac0000    188K rw---    [ anon ]
00002aaaaabbf000      4K r----  /lib64/ld-2.3.5.so
00002aaaaabc0000      4K rw---  /lib64/ld-2.3.5.so
00002aaaaabc1000    312K r-x--  /lib64/libncurses.so.5.4
......

That first column is the memory address.  (I guess this is its virtual
memory address but I don't really know.  The man page for pmap is pretty
anemic.)

Also, this looks interesting:
    http://mail.nl.linux.org/linux-mm/2003-03/msg00077.html



3.  How to enable/disable memory?

According to http://lhms.sourceforge.net/, this is done via:

# To boot a kernel with less than max memory, use the boot option "mem="
# and specify a smaller memory size than real.

# Identify new memory:
echo "(physical memory address)" > /sys/device/system/memory/probe

# Online memory
echo "online" > /sys/device/system/memory/memoryX/state

# Remove memory
echo "offline" > /sys/device/sysstem/memory/memoryX/state

I don't have a system with memory hotplug enabled presently, but I
notice that the above paths are incorrect at least in that it should be
/sys/devices/ not /sys/device/.  Also, there's a typo in that last
command - /sysstem/ should be /system/.



4.  How to control swapping

As a sysctl, the swappiness can be set at runtime with either of the
following commands:

    sysctl -w vm.swappiness=30 
    echo 30 >/proc/sys/vm/swappiness

For more info see the 'Swappiness' section on this page:
    http://gentoo-wiki.com/FAQ_Linux_Memory_Management



5.  What tools may be affected by changes in memory?

Several tools off the top of my head:

    top, sar, ps, top, free, vmstat, pmap

There's probably a lot more...

Bryce

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux