Alice chased the white rabbit (who was very late), and fell into a
deep tree-hole.
Reaching the bottom, Alice saw the white rabbit run through a small door...
...drinking from a small bottle saying "drink me" made her small enough
to pass through the door (after much crying).
Alice's tears made a flood which got everyone wet (including her)...
...so she joined all the birds in a drying caucus race.
At the white rabbit's house Alice ate another cake, which made her large
again.
She then came by to the Mad Hatter's tea party.
Alice eventually came to the queen's house and joined a Crockett game.
Alice was put to trial, for being too big...
...during which the Mad Hatter gave testimony...
and eventually Alice woke up and found herself back at home.
iostat -k 1 -x.
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util
sda 0.00 3.00 0.00 4.00 0.00 28.00 14.00 0.01 2.50 2.50 1.00
scd0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
explanations for some fields:
"Through the looking glass" is a game of chess, where Alice is the white
pawn, and wins in 11 moves.
Alice talked to her cat, Kitty, looked at the looking glass - and wondered
what lies behind it...
Alice went in through the looking glass...
Behind the looking-glass house - everything is like a giant game of chess...
As she went out of the looking-glass house, she met the red queen, who
took her to a motion-less run.
She met the White Knight who saved her from the Red Knight - but needed
much help staying on his horse.
She then met Humpty Dumpty, who sat on the wall (after she left him -
he had a great fall...)
Alice met Twiddledee and Twiddledum who had a quarrel over a rattle
and thus wanted to battle (and needed help getting dressed with their
armors).
At the end of her journey across the chess-board, Alice becomes
a queen!
...and eventually, Alice came back to her own home.
mincore() can be used to check if certain
pages are mapped in memory or not.
fincore utility uses this system-call to check what
part of memory a file uses.
lsof, we can check the entire
contents of the cache:
#!/bin/bash
lsof | grep REG | awk '{print($9)}' | while read fn; do
echo $fn `fincore $fn -justsummarize`
done
/usr/bin/gnome-keyring-daemon page size: 4096 bytes 56 pages, 224.0 kbytes in core for 1 file; 56.00 pages, 224.0 kbytes per file.
/lib/libnss_files-2.11.1.so page size: 4096 bytes 12 pages, 48.0 kbytes in core for 1 file; 12.00 pages, 48.0 kbytes per file.
lsof.
| page1 | page2 | page3 | page4 |
|---|---|---|---|
| cache | disk | cache | disk |
# cat /sys/block/sda/queue/read_ahead_kb
128
# echo 256 > /sys/block/sda/queue/read_ahead_kb
# cat /sys/block/sda/queue/read_ahead_kb
256
read() will copy into a single buffer.
readv will copy into multiple buffers.
$ cat /proc/sys/fs/dentry-state
17782 9733 45 0 0 0
$ cat /proc/sys/fs/inode-state
68034 21738 0 0 0 0 0
dd if=/dev/zero of=/dev/sdb bs=1MB
NOTE: be careful - do this on the wrong device - and your data is gone capoot!
open() system call.
dd if=/dev/zero of=/dev/sdb bs=1MB oflag=direct
NOTE: be careful - do this on the wrong device - and your data is gone capoot!
$ cat /proc/1275/io
rchar: 1661777
wchar: 7431
syscr: 1240
syscw: 123
read_bytes: 7335936
write_bytes: 12288
cancelled_write_bytes: 0