mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: linux-kernel@vger.kernel.org
Subject: What should pgpgin and pgpgout actually measure?
Date: Sun, 20 Sep 2009 15:26:07 -0400	[thread overview]
Message-ID: <E1MpS2x-0002SR-KT@closure.thunk.org> (raw)

While creating some slides for a Linux Performance Tuning class, I was
seized with a curiosity about what exactly the pgpgin/s and pgpgout/s
columns reported by sar actually means.  According to the sar man page:

              pgpgin/s
                     Total number of kilobytes the system paged in  from  disk
                     per second.  Note: With old kernels (2.2.x) this value is
                     a number of blocks per second (and not kilobytes).

              pgpgout/s
                     Total number of kilobytes the system paged  out  to  disk
                     per second.  Note: With old kernels (2.2.x) this value is
                     a number of blocks per second (and not kilobytes).

However, from what I can tell, this is coming from the pgpgin and
pgpgout from /proc/vmstats, and that in turn seems to be accounted for
from submit_bio() in blk/blk-core.c:

	if (bio_has_data(bio)) {
		if (rw & WRITE) {
			count_vm_events(PGPGOUT, count);
		} else {
			task_io_account_read(bio->bi_size);
			count_vm_events(PGPGIN, count);
		}

What this seems to imply is that curently *any* I/O, from ext3 journal
activity, or reading an inode table block, is considered "page in" and
"page out" activity.  This seems.... counter-intuitive at best.  Maybe
someone will tell that this is what sar has always done, but I'm
guessing this is something new, that was introduced in Linux 2.6 when
the buffer cache was implemented in terms of the page cache.

I'm not sure what would be a better definitions of these counters.  We
already have "pgmajfault" and "pgfault", so it's not clear what would be
a better thing to measure for "pgpgin".  However, we don't seem to have
a counter which measures number of pages cleaned; it seems though it
might be better to define a new "pgclean" field for /proc/vmstats rather
than redefining "pgpgout".

What do people think?

						- Ted

                 reply	other threads:[~2009-09-20 20:14 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=E1MpS2x-0002SR-KT@closure.thunk.org \
    --to=tytso@mit.edu \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®