All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Jeons <simon.jeons@gmail.com>
To: Fengguang Wu <fengguang.wu@intel.com>
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	hughd@google.com, riel@redhat.com,
	Johannes Weiner <hannes@cmpxchg.org>,
	mtk.manpages@gmail.com
Subject: Re: fadvise doesn't work well.
Date: Wed, 09 Jan 2013 02:18:28 -0600	[thread overview]
Message-ID: <1357719508.6568.5.camel@kernel.cn.ibm.com> (raw)
In-Reply-To: <20130109080917.GA21056@localhost>

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


  reply	other threads:[~2013-01-09  8:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2013-01-09  8:23     ` Fengguang Wu
2013-01-09  8:26     ` Fengguang Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1357719508.6568.5.camel@kernel.cn.ibm.com \
    --to=simon.jeons@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=fengguang.wu@intel.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=linux-mm@kvack.org \
    --cc=mtk.manpages@gmail.com \
    --cc=riel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.