linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* fadvise doesn't work well.
@ 2013-01-09  8:05 Simon Jeons
  2013-01-09  8:09 ` Fengguang Wu
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Jeons @ 2013-01-09  8:05 UTC (permalink / raw)
  To: linux-mm
  Cc: Andrew Morton, hughd, riel, Johannes Weiner, mtk.manpages,
	Fengguang Wu

[-- Attachment #1: Type: text/plain, Size: 16 bytes --]

In attanchment.

[-- Attachment #2: 11 --]
[-- Type: text/plain, Size: 1929 bytes --]

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, 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: fadvise doesn't work well.
  2013-01-09  8:05 fadvise doesn't work well Simon Jeons
@ 2013-01-09  8:09 ` Fengguang Wu
  2013-01-09  8:18   ` Simon Jeons
  0 siblings, 1 reply; 5+ messages in thread
From: Fengguang Wu @ 2013-01-09  8:09 UTC (permalink / raw)
  To: Simon Jeons
  Cc: linux-mm, Andrew Morton, hughd, riel, Johannes Weiner,
	mtk.manpages

Hi Simon,

Try run "sync" before doing fadvise, because fadvise won't drop
dirty/writeback/mapped pages.

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
> 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
> 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: fadvise doesn't work well.
  2013-01-09  8:09 ` Fengguang Wu
@ 2013-01-09  8:18   ` Simon Jeons
  2013-01-09  8:23     ` Fengguang Wu
  2013-01-09  8:26     ` Fengguang Wu
  0 siblings, 2 replies; 5+ messages in thread
From: Simon Jeons @ 2013-01-09  8:18 UTC (permalink / raw)
  To: Fengguang Wu
  Cc: linux-mm, Andrew Morton, hughd, riel, Johannes Weiner,
	mtk.manpages

[-- Attachment #1: Type: text/plain, Size: 2479 bytes --]

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
> > 
> 


[-- Attachment #2: 11 --]
[-- Type: text/plain, Size: 2709 bytes --]

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: fadvise doesn't work well.
  2013-01-09  8:18   ` Simon Jeons
@ 2013-01-09  8:23     ` Fengguang Wu
  2013-01-09  8:26     ` Fengguang Wu
  1 sibling, 0 replies; 5+ messages in thread
From: Fengguang Wu @ 2013-01-09  8:23 UTC (permalink / raw)
  To: Simon Jeons
  Cc: linux-mm, Andrew Morton, hughd, riel, Johannes Weiner,
	mtk.manpages

On Wed, Jan 09, 2013 at 02:18:28AM -0600, Simon Jeons wrote:
> 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?

You may check if anyone is using (hence possibly mapping) it with

        lsof | grep ubuntu-11.04-desktop-i386.iso

Thanks,
Fengguang

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: fadvise doesn't work well.
  2013-01-09  8:18   ` Simon Jeons
  2013-01-09  8:23     ` Fengguang Wu
@ 2013-01-09  8:26     ` Fengguang Wu
  1 sibling, 0 replies; 5+ messages in thread
From: Fengguang Wu @ 2013-01-09  8:26 UTC (permalink / raw)
  To: Simon Jeons
  Cc: linux-mm, Andrew Morton, hughd, riel, Johannes Weiner,
	mtk.manpages

> 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
~~~~~~~~~~~~~~~~~~~~~~~

Oops, that's invalid command. Use "dontneed" rather than "DONTNEED".

fadvise is case sensitive..

Thanks,
Fengguang

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-01-09  8:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-09  8:05 fadvise doesn't work well Simon Jeons
2013-01-09  8:09 ` Fengguang Wu
2013-01-09  8:18   ` Simon Jeons
2013-01-09  8:23     ` Fengguang Wu
2013-01-09  8:26     ` Fengguang Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).