Skip to contentSkip to conversation

Shared memory quantity not being reflected by /proc/meminfo

DISCUSSION Allan Duncan 3 participants 6 messages Jun 23, 2001 – Jun 25, 2001

lore
Share & tools
lore
#0 lore raw

Since the 2.4.x advent of shm as tmpfs or thereabouts, /proc/meminfo shows shared memory as 0. It is in reality not zero, and is being allocated, and shows up in /proc/sysvipc/shm and /proc/sys/kernel/shmall etc..
Neither 2.4.6-pre5 nor 2.4.5-ac17 have the correct display.

#1 lore raw
Quoted 7 lines · Allan Duncan

Since the 2.4.x advent of shm as tmpfs or thereabouts, /proc/meminfo shows shared memory as 0. It is in reality not zero, and is being allocated, and shows up in /proc/sysvipc/shm and /proc/sys/kernel/shmall etc..
Neither 2.4.6-pre5 nor 2.4.5-ac17 have the correct display.

You misunderstood what 2.2.xx kernels were reporting. The "shared" memory in /proc/meminfo refers to something completely unrelated to SysV shared memory. This is no longer calculated because the computation was too costly.

#2 lore raw

Hi Albert,

Quoted 4 lines · Albert D. Cahalan

You misunderstood what 2.2.xx kernels were reporting. The "shared" memory in /proc/meminfo refers to something completely unrelated to SysV shared memory. This is no longer calculated because the computation was too costly.

But the load of misinterpretations and the missing value led me to export the number of shmem pages in later -ac kernels exactly in this field.

I know it is a change of semantics and because of this both Alan and me asked for comments if this change is appreciated. I am still waiting for responses though.

Greetings
Christoph

#3 lore raw
In reply to Albert D. Cahalan

OK, it's fine by me if the "shared" under 2.2.x is not the same, however in that case the field should not appear at all in meminfo, rather than the current zero value, which leads lesser kernel hackers like me up the garden path.

#4 lore raw
In reply to Albert D. Cahalan

Hi Allan,

Quoted 4 lines · Allan Duncan

OK, it's fine by me if the "shared" under 2.2.x is not the same, however in that case the field should not appear at all in meminfo, rather than the current zero value, which leads lesser kernel hackers like me up the garden path.

This would probably break a lot of user space apps.

Greetings
Christoph

#5 lore raw
In reply to Albert D. Cahalan
Quoted 10 lines · Christoph Rohland

Hi Allan,

Quoted 4 lines · Allan Duncan

OK, it's fine by me if the "shared" under 2.2.x is not the same, however in that case the field should not appear at all in meminfo, rather than the current zero value, which leads lesser kernel hackers like me up the garden path.

This would probably break a lot of user space apps.

Then only break those that do a lousy parsing of meminfo and change the heading line to "shared_is_not_real:" or somesuch?
Anyway, aren't the user apps being led up the garden path with the wrong answer?