* Need clarification regarding sharedram in sysinfo()
@ 2001-04-09 11:38 Rashmi Agrawal
0 siblings, 0 replies; only message in thread
From: Rashmi Agrawal @ 2001-04-09 11:38 UTC (permalink / raw)
To: linux-mm
Hi All,
For system call sysinfo() in linux 2.2.14, it calculates the total
sharedram using si_meminfo(). Here from high_memory i it tries to do the
following
while (i-- > 0) {
if (PageReserved(mem_map+i))
continue;
val->totalram++;
if (!atomic_read(&mem_map[i].count))
continue;
val->sharedram += atomic_read(&mem_map[i].count) - 1;
}
Here except for the reserved page all the pages increase totalram. And
after that if the value of "atomic_read(&mem_map[i].count)" is zero which
means, I suppose nobody is referencing it, it continues. Otherwise it adds
to the sharedram, for that it does
val->sharedram += atomic_read(&mem_map[i].count) - 1
What atomic_read(&mem_map[i].count) does is simply reading the
count which is atomic_t datatype. This value gets increased when the
reference to that page gets increased. So if there are 3 processes which
are accessing the same page the count will be 3. And my understanding is 1
shared page and 3 references here. But here, the way its calculating the
sharedram is, sharedram += no_of_references -1. Which is slightly
confusing.
So can anybody clarify, what exactly the sharedram supposed to be in this?
Please reply to my id rashmi.agrawal@wipro.com
Regards
Rashmi Agrawal
Wipro Global R & D
Ph : 080-5732296(5236)
=====================
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-04-09 11:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-09 11:38 Need clarification regarding sharedram in sysinfo() Rashmi Agrawal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox