LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-16-2012, 09:36 PM   #1
engr04
LQ Newbie
 
Registered: Mar 2012
Posts: 21

Rep: Reputation: Disabled
/proc/meminfo - Active(file)


cat /proc/meminfo produces the output below. I haven't been able to find any documenation explaining what the Active(File) field is? Can somebody please point me in the right direction?

Quote:
MemTotal: 4037732 kB
MemFree: 1118548 kB
Buffers: 1063920 kB
Cached: 1208564 kB
SwapCached: 0 kB
Active: 594980 kB
Inactive: 2127056 kB
Active(anon): 450396 kB
Inactive(anon): 816 kB
Active(file): 144584 kB
Inactive(file): 2126240 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 262136 kB
SwapFree: 262136 kB
Dirty: 68 kB
Writeback: 0 kB
AnonPages: 449476 kB
Mapped: 135856 kB
Shmem: 1664 kB
Slab: 78900 kB
SReclaimable: 54868 kB
SUnreclaim: 24032 kB
KernelStack: 3272 kB
PageTables: 24260 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 2281000 kB
Committed_AS: 2789760 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 123136 kB
VmallocChunk: 34359605244 kB
HardwareCorrupted: 0 kB
AnonHugePages: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 100676 kB
DirectMap2M: 4081664 kB
 
Old 10-16-2012, 11:28 PM   #2
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,831
Blog Entries: 36

Rep: Reputation: 451Reputation: 451Reputation: 451Reputation: 451Reputation: 451
Active appears to be equal to the sum of Active(anon) and Active(file). I know it's not what you're currently looking for but it's an observation that brings us a little closer to understanding.

The latest kernel Ubuntu 12.04 is Linux Kernel 3.2.x. According to the documentation in the kernel source under Documentation/filesystems/proc.txt there doesn't appear to be Active(anon) nor Active(file) listed. So I'm not sure if this is a case of missing documentation on the subject without actually diving into the source code.

Last edited by sag47; 10-17-2012 at 12:18 AM.
 
Old 10-17-2012, 12:17 AM   #3
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,415

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
I think Active(anon) shows anonymous pages counts and Active(file) shows page/swap cache i.e., cached and swap cache file counts.
 
Old 10-17-2012, 12:35 AM   #4
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,831
Blog Entries: 36

Rep: Reputation: 451Reputation: 451Reputation: 451Reputation: 451Reputation: 451
anon in Active(anon) is likely referring to anonymous memory which is essentially heap/stack memory which is allocated by programs using malloc. It basically is memory with no filesystem associations.

file in Active(file) is likely referring to the File Cache which contains disk and network filesystem data and metadata (can include files loaded into memory and possibly execution code from disk?).

I'm still not trying to answer what exactly Active(anon) and Active(file) fields actually mean (though I could make an educated guess by adding the definition of Active memory to the terms discussed). I'd rather know for sure before giving a final answer. I've asked about it in the #kernel channel on freenode so we'll see if anyone replies over the next couple of days with (hopefully) reliable sources.

Here's some additional reading I found while looking into the subject...

Last edited by sag47; 10-17-2012 at 12:59 AM.
 
Old 10-17-2012, 03:15 AM   #5
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
I did search for answers on this one but couldn't find a direct one, although I found some related info that might be interesting to read:
http://lxr.free-electrons.com/source...=2.6.36;a=mips
http://linux.die.net/man/5/proc

Regards
 
Old 10-17-2012, 12:05 PM   #6
engr04
LQ Newbie
 
Registered: Mar 2012
Posts: 21

Original Poster
Rep: Reputation: Disabled
I'm asking because I'm trying to understand if my embedded design is swapping memory or not. The output below is from my board running 2.6.30. All of the swap fields report 0, however, I'm not convinced.

Quote:
MemTotal: 61068 kB
MemFree: 1500 kB
Buffers: 0 kB
Cached: 29688 kB
SwapCached: 0 kB
Active: 23468 kB
Inactive: 28164 kB
Active(anon): 10760 kB
Inactive(anon): 11240 kB
Active(file): 12708 kB
Inactive(file): 16924 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 21972 kB
Mapped: 18844 kB
Slab: 5140 kB
SReclaimable: 660 kB
SUnreclaim: 4480 kB
PageTables: 284 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 30532 kB
Committed_AS: 94616 kB
VmallocTotal: 956416 kB
VmallocUsed: 264080 kB
VmallocChunk: 686076 kB
I've posted this scenario in another topic in the embedded forum, but I'll describe it here as well since the question is really platform independent.

1. An application thread reads from a device driver, passing in a pointer.
2. The device driver blocks until an interrupt occurs
3. While the device driver is blocking, the thread gets swapped out (what happens to the pointer from step one here, is it still valid?)
4. The driver gets an interrupt, and writes to the pointer. If the pointer is no longer valid, a kernel oops would occur.

Is this scenario possible? I'm having a problem where my application crashes at random intervals. I'm wondering if the scenario above is causing it. Here's the kernel output:

Quote:
Unable to handle kernel paging request at virtual address 45c4ec64
pgd = c3a48000
[45c4ec64] *pgd=23aad031, *pte=22ea034d, *ppte=00000000
Internal error: Oops: 817 [#1] PREEMPT
Modules linked in: atmel_pwm_bl backlight touchDriver mymodule owl
CPU: 0 Not tainted (2.6.30-ts-armv5l #241)
PC is at memcpy+0xa4/0x330
LR is at 0x0
pc : [<c0c1b984>] lr : [<00000000>] psr: 00000013
sp : c3a97f0c ip : 0000000c fp : 45c4ef9c
r10: 00000000 r9 : c3a96000 r8 : 00000000
r7 : 00000000 r6 : 00000000 r5 : 00000000 r4 : c382d220
r3 : 00000000 r2 : fffffff4 r1 : bf05d4ac r0 : 45c4ec64
Flags: nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: 0005317f Table: 23a48000 DAC: 00000015
Process webkit_qt (pid: 2181, stack limit = 0xc3a96268)
Stack: (0xc3a97f0c to 0xc3a98000)
7f00: bf05d468 45c4ec64 00000014 c3847960 45c4ec64
7f20: c382d220 bf05c820 c382da20 c0b5b960 45c4ef9c 00000000 c3847960 c0b15024
7f40: c3a97f40 c3a97f40 00000014 c382d220 45c4ec64 c3a97f80 00000014 c0b5ab4c
7f60: c382d220 45c4ec64 00000014 c382d220 45c4ec64 00000000 00000000 c0b5ac10
7f80: 00000000 00000000 00000014 00000001 0005fb20 0002a888 0002aa54 00000003
7fa0: c0ae7f68 c0ae7dc0 0005fb20 0002a888 00000015 45c4ec64 00000014 00000002
7fc0: 0005fb20 0002a888 0002aa54 00000003 00000015 beca6a90 00000000 45c4ef9c
7fe0: 00000000 45c4ec58 41e499ec 41e4a1f4 80000010 00000015 20f2f031 20f2f431
Code: e1a00000 e1a00000 e4803004 e4804004 (e4805004)
---[ end trace 38ca3200f4180a0e ]---
 
Old 10-17-2012, 09:41 PM   #7
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,831
Blog Entries: 36

Rep: Reputation: 451Reputation: 451Reputation: 451Reputation: 451Reputation: 451
Perhaps this would be more useful. See also 2nd bullet. You didn't bother linking this "other topic" you posted this in. Seeing source code is many times useful to learning more about the problem. Time = wasted; please don't.

A good resource: Linux Device Drivers

Last edited by sag47; 10-17-2012 at 11:20 PM.
 
Old 10-19-2012, 08:47 AM   #8
engr04
LQ Newbie
 
Registered: Mar 2012
Posts: 21

Original Poster
Rep: Reputation: Disabled
I resolved the kernel oops. My application is crashing (still not resolved). When it crashes, a pointer sent to one of my drivers is used when cleaning up, causing the kernel oops. I was dereferencing the pointer in the driver, without using copy_to_user.

I appreciate your time regarding the active file information.
 
Old 10-19-2012, 07:42 PM   #9
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,831
Blog Entries: 36

Rep: Reputation: 451Reputation: 451Reputation: 451Reputation: 451Reputation: 451
That resource I referenced you is a good one for kernel debugging. I'd highly recommend reading through Ch 4 at least (if I recall that's the chapter on the debugging).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
/proc/meminfo VS /proc/kcore Fill Linux - Newbie 2 08-04-2011 05:13 AM
/proc/meminfo vkmgeek Linux - General 6 03-20-2008 01:12 AM
/proc/meminfo hiding some memory? elpy Linux - Hardware 3 07-28-2007 11:26 AM
/proc/meminfo gives wrong info jr8rdt Linux - Hardware 2 12-07-2006 07:37 PM
Define fields in /proc/meminfo ilnli Linux - General 1 05-17-2005 02:23 AM


All times are GMT -5. The time now is 06:52 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration