linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rashmi Agrawal <rashmi.agrawal@wipro.com>
To: linux-mm@kvack.org
Subject: Need clarification regarding sharedram in sysinfo()
Date: Mon, 9 Apr 2001 17:08:26 +0530 (IST)	[thread overview]
Message-ID: <Pine.PTX.3.96.1010409165638.3805T-100000@wipro.wipsys.sequent.com> (raw)

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/

                 reply	other threads:[~2001-04-09 11:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.PTX.3.96.1010409165638.3805T-100000@wipro.wipsys.sequent.com \
    --to=rashmi.agrawal@wipro.com \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox