Skip to contentSkip to conversation

sysinfo.sharedram not accounted for on i386 ?

DISCUSSION Brian Grossman 4 participants 5 messages Feb 12, 2001

lore
Share & tools
lore
#0 lore raw

On i386, sysinfo.sharedram is not accounted for, leading /proc/meminfo to always report MemShared as 0. Is this the intended behavior?

Brian
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#1 lore raw
Quoted 2 lines · Brian Grossman

On i386, sysinfo.sharedram is not accounted for, leading /proc/meminfo to always report MemShared as 0. Is this the intended behavior?

Yes.

Erik

Signature · 9 lines
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2783635  Fax: +31-15-2781843  Email: [email protected]
WWW: http://www-ict.its.tudelft.nl/~erik/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
#2 lore raw
Quoted 6 lines · Brian Grossman
Quoted 2 lines

On i386, sysinfo.sharedram is not accounted for, leading /proc/meminfo to always report MemShared as 0. Is this the intended behavior?

Yes.

Thanks. Is there a preferred way of getting the equivalent info as free(1) did under 2.2?

I've written a script to derive it from /proc/[0-9]*/statm, but that seems like an awkward approach. A related question: is the page size stored in /proc somewhere?

Is there a discussion of this somewhere? I couldn't find one when I searched the linux-kernel archives.

Brian
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#3 lore raw
Quoted 4 lines · Brian Grossman
Quoted 1 line

Yes.

Thanks. Is there a preferred way of getting the equivalent info as free(1) did under 2.2?

btw, this is not only x86 behaviour but is also true on all other architectures. I.e. Linux defines "shared memory" as a "integer constant with value 0". So, to say "zero" is just a shorter form of saying "Linux concept of shared memory". However, remember that if you are interested in shared _pages_, that information is available and is not identically 0. See the show_mem() function in arch/i386/mm/init.c.

Quoted 4 lines

I've written a script to derive it from /proc/[0-9]*/statm, but that seems like an awkward approach. A related question: is the page size stored in /proc somewhere?

No, PAGE_SIZE is known at compile time and cannot ever change (especially it cannot change ig you stay within i386 architecture). It is available to programs by including <asm/page.h> header.

Tigran

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#4 lore raw
Quoted 6 lines
Quoted 2 lines

like an awkward approach. A related question: is the page size stored in /proc somewhere?

No, PAGE_SIZE is known at compile time and cannot ever change (especially it cannot change ig you stay within i386 architecture). It is available to programs by including <asm/page.h> header.

Untrue. On many architectures page size is not fixed. You should use the getpagesize() function/syscall. glibc knows if its a syscall or a constant you dont

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://vger.kernel.org/lkml/