measuring the number of times each page is read

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, all,

I am trying to instrument linux-2.2.19 kernel to measure the number of
times each page is read. That is, for each page that is read by each
process from disk, there should be a counter. Once the measurement started,
the number of times a page is read from disk by a process should be counted;
if page is written out to swap space and brought back in, this should be
included in the count.

Intially, it occured to me that maintaining the information needed to
asscociate disk locations with virtual addresses within the kernel will be
difficult.(possibly requiring the use of has tables, etc.) and I was afraid
to change things in obscure ways. Instead, I was using another approach, namely
to let kernel only output a log of all the swap-ins and address mappings it
performs, and leave it to a user program to complete the missing links.

However, in this way, logging(using "syslogd" and "klogd") seriously gets 
in the way of measuring reads. It would increase disk I/O or disturb the 
workload. Especially, when workload is large, log file is also very big.
This needs insance sized kernel log buffer. However when I modified the printk
buffer to 4Mb, system can't even boot up. Also sometimes, I got garbled lines
in log, which may due to differences in processor speed and harddisk speed.

I was considering to invent a new logging facility, which is more optimized
than "klogd". But it seemed that to reduce interference, I may need to redirect
logs to a harddisk situated on a different harddisk controller, like SCSI.
This requires additional hardware...very troublesome.

Right now, I am stuck here and deciding whether to improve logging approach,
or try another new way. That's why I am here to ask you to give me some
suggestions. The aim is just to measure the number of each page is read when
runing a process.

Btw, is it feasible to use or introduce some additional bits in process
page-table to accomplish this? If so, could you show me some pointers??

Thanks in advance!

-- 
Cheers!

Zou Min 
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux