From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: andrea@betterlinux.com
Cc: akpm@linux-foundation.org, minchan.kim@gmail.com,
riel@redhat.com, peterz@infradead.org, hannes@cmpxchg.org,
kamezawa.hiroyu@jp.fujitsu.com, aarcange@redhat.com,
hughd@google.com, jamesjer@betterlinux.com, marcus@bluehost.com,
matt@bluehost.com, tytso@mit.edu, shaohua.li@intel.com,
P@draigBrady.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 0/2] fadvise: support POSIX_FADV_NOREUSE
Date: Mon, 27 Jun 2011 12:04:41 +0900 [thread overview]
Message-ID: <4E07F349.2040900@jp.fujitsu.com> (raw)
In-Reply-To: <1308923350-7932-1-git-send-email-andrea@betterlinux.com>
(2011/06/24 22:49), Andrea Righi wrote:
> There were some reported problems in the past about trashing page cache
> when a backup software (i.e., rsync) touches a huge amount of pages (see
> for example [1]).
>
> This problem has been almost fixed by the Minchan Kim's patch [2] and a
> proper use of fadvise() in the backup software. For example this patch
> set [3] has been proposed for inclusion in rsync.
>
> However, there can be still other similar trashing problems: when the
> backup software reads all the source files, some of them may be part of
> the actual working set of the system. When a POSIX_FADV_DONTNEED is
> performed _all_ pages are evicted from pagecache, both the working set
> and the use-once pages touched only by the backup software.
>
> A previous proposal [4] tried to resolve this problem being less
> agressive in invalidating active pages, moving them to the inactive list
> intead of just evict them from the page cache.
>
> However, this approach changed completely the old behavior of
> invalidate_mapping_pages(), that is not only used by fadvise.
>
> The new solution maps POSIX_FADV_NOREUSE to the less-agressive page
> invalidation policy.
>
> With POSIX_FADV_NOREUSE active pages are moved to the tail of the
> inactive list, and pages in the inactive list are just removed from page
> cache. Pages mapped by other processes or unevictable pages are not
> touched at all.
>
> In this way if the backup was the only user of a page, that page will be
> immediately removed from the page cache by calling POSIX_FADV_NOREUSE.
> If the page was also touched by other tasks it'll be moved to the
> inactive list, having another chance of being re-added to the working
> set, or simply reclaimed when memory is needed.
>
> In conclusion, now userspace applications that want to drop some page
> cache pages can choose between the following advices:
>
> POSIX_FADV_DONTNEED = drop page cache if possible
> POSIX_FADV_NOREUSE = reduce page cache eligibility
Eeek.
Your POSIX_FADV_NOREUSE is very different from POSIX definition.
POSIX says,
POSIX_FADV_NOREUSE
Specifies that the application expects to access the specified data once and then
not reuse it thereafter.
IfI understand correctly, it designed for calling _before_ data access
and to be expected may prevent lru activation. But your NORESE is designed
for calling _after_ data access. Big difference might makes a chance of
portability issue.
WARNING: multiple messages have this Message-ID (diff)
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: andrea@betterlinux.com
Cc: akpm@linux-foundation.org, minchan.kim@gmail.com,
riel@redhat.com, peterz@infradead.org, hannes@cmpxchg.org,
kamezawa.hiroyu@jp.fujitsu.com, aarcange@redhat.com,
hughd@google.com, jamesjer@betterlinux.com, marcus@bluehost.com,
matt@bluehost.com, tytso@mit.edu, shaohua.li@intel.com,
P@draigBrady.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 0/2] fadvise: support POSIX_FADV_NOREUSE
Date: Mon, 27 Jun 2011 12:04:41 +0900 [thread overview]
Message-ID: <4E07F349.2040900@jp.fujitsu.com> (raw)
In-Reply-To: <1308923350-7932-1-git-send-email-andrea@betterlinux.com>
(2011/06/24 22:49), Andrea Righi wrote:
> There were some reported problems in the past about trashing page cache
> when a backup software (i.e., rsync) touches a huge amount of pages (see
> for example [1]).
>
> This problem has been almost fixed by the Minchan Kim's patch [2] and a
> proper use of fadvise() in the backup software. For example this patch
> set [3] has been proposed for inclusion in rsync.
>
> However, there can be still other similar trashing problems: when the
> backup software reads all the source files, some of them may be part of
> the actual working set of the system. When a POSIX_FADV_DONTNEED is
> performed _all_ pages are evicted from pagecache, both the working set
> and the use-once pages touched only by the backup software.
>
> A previous proposal [4] tried to resolve this problem being less
> agressive in invalidating active pages, moving them to the inactive list
> intead of just evict them from the page cache.
>
> However, this approach changed completely the old behavior of
> invalidate_mapping_pages(), that is not only used by fadvise.
>
> The new solution maps POSIX_FADV_NOREUSE to the less-agressive page
> invalidation policy.
>
> With POSIX_FADV_NOREUSE active pages are moved to the tail of the
> inactive list, and pages in the inactive list are just removed from page
> cache. Pages mapped by other processes or unevictable pages are not
> touched at all.
>
> In this way if the backup was the only user of a page, that page will be
> immediately removed from the page cache by calling POSIX_FADV_NOREUSE.
> If the page was also touched by other tasks it'll be moved to the
> inactive list, having another chance of being re-added to the working
> set, or simply reclaimed when memory is needed.
>
> In conclusion, now userspace applications that want to drop some page
> cache pages can choose between the following advices:
>
> POSIX_FADV_DONTNEED = drop page cache if possible
> POSIX_FADV_NOREUSE = reduce page cache eligibility
Eeek.
Your POSIX_FADV_NOREUSE is very different from POSIX definition.
POSIX says,
POSIX_FADV_NOREUSE
Specifies that the application expects to access the specified data once and then
not reuse it thereafter.
IfI understand correctly, it designed for calling _before_ data access
and to be expected may prevent lru activation. But your NORESE is designed
for calling _after_ data access. Big difference might makes a chance of
portability issue.
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-06-27 3:05 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-24 13:49 [PATCH v3 0/2] fadvise: support POSIX_FADV_NOREUSE Andrea Righi
2011-06-24 13:49 ` Andrea Righi
2011-06-24 13:49 ` [PATCH v3 1/2] mm: introduce __invalidate_mapping_pages() Andrea Righi
2011-06-24 13:49 ` Andrea Righi
2011-06-26 22:46 ` Rik van Riel
2011-06-26 22:46 ` Rik van Riel
2011-06-27 7:05 ` Andrea Righi
2011-06-27 7:05 ` Andrea Righi
2011-06-24 13:49 ` [PATCH v3 2/2] fadvise: implement POSIX_FADV_NOREUSE Andrea Righi
2011-06-24 13:49 ` Andrea Righi
2011-06-26 22:47 ` Rik van Riel
2011-06-26 22:47 ` Rik van Riel
2011-06-27 7:05 ` Andrea Righi
2011-06-27 7:05 ` Andrea Righi
2011-06-27 3:04 ` KOSAKI Motohiro [this message]
2011-06-27 3:04 ` [PATCH v3 0/2] fadvise: support POSIX_FADV_NOREUSE KOSAKI Motohiro
2011-06-27 7:11 ` Andrea Righi
2011-06-27 7:11 ` Andrea Righi
2011-06-27 7:42 ` KOSAKI Motohiro
2011-06-27 7:42 ` KOSAKI Motohiro
2011-06-27 10:17 ` Pádraig Brady
2011-06-27 10:17 ` Pádraig Brady
2011-06-27 10:29 ` Andrea Righi
2011-06-27 10:29 ` Andrea Righi
2011-06-27 11:53 ` Pádraig Brady
2011-06-27 11:53 ` Pádraig Brady
2011-06-27 12:39 ` Andrea Righi
2011-06-27 12:39 ` Andrea Righi
2011-07-12 21:52 ` Patrick J. LoPresti
2011-07-12 22:22 ` Andrea Righi
2011-07-13 0:36 ` Patrick J. LoPresti
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=4E07F349.2040900@jp.fujitsu.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=P@draigBrady.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=andrea@betterlinux.com \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=jamesjer@betterlinux.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=marcus@bluehost.com \
--cc=matt@bluehost.com \
--cc=minchan.kim@gmail.com \
--cc=peterz@infradead.org \
--cc=riel@redhat.com \
--cc=shaohua.li@intel.com \
--cc=tytso@mit.edu \
/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.