Re: fadvise doesn't work well.

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

 



On Wed, 2013-01-09 at 16:09 +0800, Fengguang Wu wrote:
> Hi Simon,
> 
> Try run "sync" before doing fadvise, because fadvise won't drop
> dirty/writeback/mapped pages.
> 

Hi Fengguang,

Thanks for your quick response. But the result is the same in
attachment. 

> Thanks,
> Fengguang
> 
> On Wed, Jan 09, 2013 at 02:05:21AM -0600, Simon Jeons wrote:
> > In attanchment.
> 
> > root@kernel:~/Documents/mm/tools/linux-ftools# dd if=../../../images/ubuntu-11.04-desktop-i386.iso of=/tmpfs

The pages of ../../../images/ubuntu-11.04-desktop-i386.iso is mapped or
unmapped?

> > 1403484+0 records in
> > 1403484+0 records out
> > 718583808 bytes (719 MB) copied, 19.5054 s, 36.8 MB/s
> > root@kernel:~/Documents/mm/tools/linux-ftools# ./linux-fincore -s ../../../images/ubuntu-11.04-desktop-i386.iso 
> > filename                                                                                       size        total_pages    min_cached page       cached_pages        cached_size        cached_perc
> > --------                                                                                       ----        -----------    ---------------       ------------        -----------        -----------
> > ../../../images/ubuntu-11.04-desktop-i386.iso                                             718583808             175436                  0             175436          718585856             100.00
> > ---
> > total cached size: 718585856
> > root@kernel:~/Documents/mm/tools/linux-ftools# ./linux-fadvise ../../../images/ubuntu-11.04-desktop-i386.iso DONTNEED 0,718585856
> > Going to fadvise ../../../images/ubuntu-11.04-desktop-i386.iso as mode DONTNEED
> > offset: 0
> > length: 718583808
> > Invalid mode DONTNEED
> > root@kernel:~/Documents/mm/tools/linux-ftools# ./linux-fincore -s ../../../images/ubuntu-11.04-desktop-i386.iso 
> > filename                                                                                       size        total_pages    min_cached page       cached_pages        cached_size        cached_perc
> > --------                                                                                       ----        -----------    ---------------       ------------        -----------        -----------
> > ../../../images/ubuntu-11.04-desktop-i386.iso                                             718583808             175436                  0             175436          718585856             100.00
> > ---
> > total cached size: 718585856
> > 
> 

root@kernel:~/Documents/mm/tools/linux-ftools# dd if=../../../images/ubuntu-11.04-desktop-i386.iso of=/tmpfs
1403484+0 records in
1403484+0 records out
718583808 bytes (719 MB) copied, 35.5144 s, 20.2 MB/s
root@hacker:~/Documents/mm/tools/linux-ftools# ./linux-fincore -s ../../../images/ubuntu-11.04-desktop-i386.iso
filename                                                                                       size        total_pages    min_cached page       cached_pages        cached_size        cached_perc
--------                                                                                       ----        -----------    ---------------       ------------        -----------        -----------
../../../images/ubuntu-11.04-desktop-i386.iso                                             718583808             175436                  0             175436          718585856             100.00
---
total cached size: 718585856
root@kernel:~/Documents/mm/tools/linux-ftools# sync
root@kernel:~/Documents/mm/tools/linux-ftools# ./linux-fincore -s ../../../images/ubuntu-11.04-desktop-i386.iso
filename                                                                                       size        total_pages    min_cached page       cached_pages        cached_size        cached_perc
--------                                                                                       ----        -----------    ---------------       ------------        -----------        -----------
../../../images/ubuntu-11.04-desktop-i386.iso                                             718583808             175436                  0             175436          718585856             100.00
---
total cached size: 718585856
root@kernel:~/Documents/mm/tools/linux-ftools# ./linux-fadvise ../../../images/ubuntu-11.04-desktop-i386.iso DONTNEED 0,718585856
Going to fadvise ../../../images/ubuntu-11.04-desktop-i386.iso as mode DONTNEED
offset: 0
length: 718583808
Invalid mode DONTNEED
root@kernel:~/Documents/mm/tools/linux-ftools# ./linux-fincore -s ../../../images/ubuntu-11.04-desktop-i386.iso
filename                                                                                       size        total_pages    min_cached page       cached_pages        cached_size        cached_perc
--------                                                                                       ----        -----------    ---------------       ------------        -----------        -----------
../../../images/ubuntu-11.04-desktop-i386.iso                                             718583808             175436                  0             175436          718585856             100.00
---
total cached size: 718585856


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]