Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Cong> It introduces a new fcntl command F_DROP_CACHES to drop
- Cong> file caches of a specific file. The reason is that currently
- Cong> we only have a system-wide drop caches interface, it could
- Cong> cause system-wide performance down if we drop all page caches
- Cong> when we actually want to drop the caches of some huge file.
- file_drop_caches(filp, arg);
- void file_drop_caches(struct file *filp, unsigned long which);
- $ dd if=ifile iflag=nocache count=0
- $ dd of=ofile oflag=nocache conv=notrunc,fdatasync count=0
- $ dd if=ifile iflag=nocache skip=10 count=10 of=/dev/null
- $ dd if=ifile of=ofile iflag=nocache oflag=nocache
- $ dd if=/dev/urandom of=sample.txt bs=100M count=1
- $ sudo fatrace | grep sample.txt
- $ top
- $ cat sample.txt > /dev/null
- $ sudo dd of=/home/saml/tst/162600/sample.txt
- oflag=nocache conv=notrunc,fdatasync count=0
- $ dd if=/dev/urandom of=sample.txt bs=100M count=1
- 1+0 records in
- 1+0 records out
- 104857600 bytes (105 MB) copied, 7.37996 s, 14.2 MB/s
- $ ls -l sample.txt
- -rw-rw-r--. 1 saml saml 104857600 Oct 17 22:54 sample.txt
- $ top
- ...
- KiB Mem: 7968336 total, 6900956 used, 1067380 free, 267080 buffers
- ...
- $ sudo fatrace | grep sample.txt
- $ cat sample.txt > /dev/null
- KiB Mem: 7968336 total, 7011896 used, 956440 free, 267336 buffers
- cat(25940): R /home/saml/tst/162600/sample.txt
- cat(25940): R /home/saml/tst/162600/sample.txt
- cat(25940): RC /home/saml/tst/162600/sample.txt
- $ sudo dd of=/home/saml/tst/162600/sample.txt
- oflag=nocache conv=notrunc,fdatasync count=0
- dd(26229): O /home/saml/tst/162600/sample.txt
- dd(26229): CW /home/saml/tst/162600/sample.txt
- KiB Mem: 7968336 total, 6908364 used, 1059972 free, 267364 buffers
- $ sudo pyadvise --help
- Usage:
- pyadvise [options] [FILE]..
- Options:
- -h, --help show this help message and exit
- -w, --willneed The specified files will be accessed in the near future
- -s, --sequential The application expects to access the specified files
- sequentially (with lower offsets read before higher ones)
- -d, --dontneed The specified files will not be accessed in the near
- future
- -r, --random The specified files will be accessed in random order
- -o, --noreuse The specified files will be accessed only once. Under
- Linux, this operation is a no-op; see contrib/copyfileobj-
- fadvise.py in the python-fadvise source tree for an
- example on how to achieve approximately the same effect
- -n, --normal Indicates that the application has no advice to give about
- its access pattern for the specified files. If no advice
- is given for an open file, this is the default assumption
- -v, --verbose Explain what is being done
- $ pyadvise -d /home/saml/tst/162600/sample.txt
Add Comment
Please, Sign In to add comment