Skip to content

Instantly share code, notes, and snippets.

@labeneator
Created October 11, 2013 16:38
Show Gist options
  • Save labeneator/6937983 to your computer and use it in GitHub Desktop.
Save labeneator/6937983 to your computer and use it in GitHub Desktop.
# Results for https://gist.github.com/labeneator/6937753
# Show the mountpoint for the loopbacked fs
/tmp/zeros on /tmp/bah type ext2 (rw,loop=/dev/loop0)
# Meminfo stats before ddd
Cached: 1947592 kB
SwapCached: 0 kB
Dirty: 0 kB
**Sleeping for 10.. Waiting for I/O**
## Actual dd command
###
## $ dd if=blktrace of=/tmp/bah/blktrace oflag=sync
## 212+1 records in
## 212+1 records out
## 108740 bytes (109 kB) copied, 0.016489 seconds, 6.6 MB/s
##
##
# Meminfo stats after dd. Notice that the Cached value grows by the 'blktrace' size from above '108k'
# Also note that we now have some dirty blocks. I believe that these are made up of the blktrace content + ext3 metadata + any other OS dirty buffers
Cached: 1947700 kB
SwapCached: 0 kB
Dirty: 160 kB
****
# What does the world look like if we view the loopback fs via VFS (which effectively get it's results from the pagecache)
# This is an ls -alisa /tmp/bah
total 309
2 1 drwxr-xr-x 3 23142 xxxx 1024 Oct 11 17:30 .
8936929 188 drwxrwxrwt 12 root root 188416 Oct 11 17:01 ..
12 108 -rw-r--r-- 1 root root 108740 Oct 11 17:30 blktrace
11 12 drwx------ 2 root root 12288 Oct 9 14:42 lost+found
# What does the world look like if we view the loopbacking file via debugfs.
# This reflects what's actually on disk
# Note that blktrace file is missing....
debugfs 1.39 (29-May-2006)
debugfs: 2 40755 (2) 23142 100 1024 11-Oct-2013 17:30 .
2 40755 (2) 23142 100 1024 11-Oct-2013 17:30 ..
11 40700 (2) 0 0 12288 9-Oct-2013 14:42 lost+found
debugfs:
****
# And we can see that it's in the pagecache
filename size total_pages min_cached page cached_pages cached_size cached_perc
-------- ---- ----------- --------------- ------------ ----------- -----------
/tmp/zeros 1,048,576 256 0 37 151,552 14.45
---
total cached size: 151,552
# Running fadvise to evict /tmp/zeros from the page cache
****
Going to fadvise /tmp/zeros as mode POSIX_FADV_DONTNEED
offset: 0
length: 1048576
mode: POSIX_FADV_DONTNEED
WIN
# Post fadvise stats
Buffers: 522112 kB
Cached: 1947548 kB
SwapCached: 0 kB
Dirty: 12 kB
###### Running sync to awake pdflush and sleeping for 10 secs
# Page cache stats after eviction
filename size total_pages min_cached page cached_pages cached_size cached_perc
-------- ---- ----------- --------------- ------------ ----------- -----------
/tmp/zeros 1,048,576 256 0 4 16,384 1.56
---
total cached size: 16,384
## What the backing fs looks like after pagecache eviction
debugfs 1.39 (29-May-2006)
debugfs: 2 40755 (2) 23142 100 1024 11-Oct-2013 17:30 .
2 40755 (2) 23142 100 1024 11-Oct-2013 17:30 ..
11 40700 (2) 0 0 12288 9-Oct-2013 14:42 lost+found
12 100644 (1) 0 0 108740 11-Oct-2013 17:30 blktrace
debugfs:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment