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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-16-2012, 08:36 PM
|
#1
|
LQ Newbie
Registered: Mar 2012
Posts: 21
Rep:
|
/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
|
|
|
|
10-16-2012, 10:28 PM
|
#2
|
Senior Member
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
|
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-16-2012 at 11:18 PM.
|
|
|
10-16-2012, 11:17 PM
|
#3
|
Senior Member
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420
|
I think Active(anon) shows anonymous pages counts and Active(file) shows page/swap cache i.e., cached and swap cache file counts.
|
|
|
10-16-2012, 11:35 PM
|
#4
|
Senior Member
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
|
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-16-2012 at 11:59 PM.
|
|
|
10-17-2012, 11:05 AM
|
#6
|
LQ Newbie
Registered: Mar 2012
Posts: 21
Original Poster
Rep:
|
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 ]---
|
|
|
|
10-17-2012, 08:41 PM
|
#7
|
Senior Member
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
|
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 10:20 PM.
|
|
|
10-19-2012, 07:47 AM
|
#8
|
LQ Newbie
Registered: Mar 2012
Posts: 21
Original Poster
Rep:
|
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.
|
|
|
10-19-2012, 06:42 PM
|
#9
|
Senior Member
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
|
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).
|
|
|
All times are GMT -5. The time now is 10:32 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|