linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Shakeel Butt <shakeelb@google.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Mel Gorman <mgorman@suse.de>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Hillf Danton <hillf.zj@alibaba-inc.com>,
	Vlastimil Babka <vbabka@suse.cz>
Cc: Hugh Dickins <hughd@google.com>, Greg Thelen <gthelen@google.com>,
	Shakeel Butt <shakeelb@google.com>, Linux MM <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] mm: fadvise: avoid fadvise for fs without backing device
Date: Thu, 17 Aug 2017 18:20:17 -0700	[thread overview]
Message-ID: <CALvZod444NZaw9wcdSMs5Y60a0cV4j9SEt-TLBJT34OJ_yg3CQ@mail.gmail.com> (raw)
In-Reply-To: <20170818011023.181465-1-shakeelb@google.com>

+linux-mm, linux-kernel

On Thu, Aug 17, 2017 at 6:10 PM, Shakeel Butt <shakeelb@google.com> wrote:
> The fadvise() manpage is silent on fadvise()'s effect on
> memory-based filesystems (shmem, hugetlbfs & ramfs) and pseudo
> file systems (procfs, sysfs, kernfs). The current implementaion
> of fadvise is mostly a noop for such filesystems except for
> FADV_DONTNEED which will trigger expensive remote LRU cache
> draining. This patch makes the noop of fadvise() on such file
> systems very explicit.
>
> However this change has two side effects for ramfs and one for
> tmpfs. First fadvise(FADV_DONTNEED) can remove the unmapped clean
> zero'ed pages of ramfs (allocated through read, readahead & read
> fault) and tmpfs (allocated through read fault). Also
> fadvise(FADV_WILLNEED) on create such clean zero'ed pages for
> ramfs. This change removes these two interfaces.
>
> Signed-off-by: Shakeel Butt <shakeelb@google.com>
> ---
>  mm/fadvise.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/mm/fadvise.c b/mm/fadvise.c
> index a43013112581..702f239cd6db 100644
> --- a/mm/fadvise.c
> +++ b/mm/fadvise.c
> @@ -52,7 +52,9 @@ SYSCALL_DEFINE4(fadvise64_64, int, fd, loff_t, offset, loff_t, len, int, advice)
>                 goto out;
>         }
>
> -       if (IS_DAX(inode)) {
> +       bdi = inode_to_bdi(mapping->host);
> +
> +       if (IS_DAX(inode) || (bdi == &noop_backing_dev_info)) {
>                 switch (advice) {
>                 case POSIX_FADV_NORMAL:
>                 case POSIX_FADV_RANDOM:
> @@ -75,8 +77,6 @@ SYSCALL_DEFINE4(fadvise64_64, int, fd, loff_t, offset, loff_t, len, int, advice)
>         else
>                 endbyte--;              /* inclusive */
>
> -       bdi = inode_to_bdi(mapping->host);
> -
>         switch (advice) {
>         case POSIX_FADV_NORMAL:
>                 f.file->f_ra.ra_pages = bdi->ra_pages;
> --
> 2.14.1.480.gb18f417b89-goog
>

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

       reply	other threads:[~2017-08-18  1:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170818011023.181465-1-shakeelb@google.com>
2017-08-18  1:20 ` Shakeel Butt [this message]
2017-08-18 21:34   ` [RFC PATCH] mm: fadvise: avoid fadvise for fs without backing device Andrew Morton
2017-08-18 23:17     ` Shakeel Butt
2017-08-23  0:25       ` Shakeel Butt
2017-08-25 21:49   ` Andrew Morton
2017-08-26  0:22     ` Shakeel Butt

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=CALvZod444NZaw9wcdSMs5Y60a0cV4j9SEt-TLBJT34OJ_yg3CQ@mail.gmail.com \
    --to=shakeelb@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=gthelen@google.com \
    --cc=hannes@cmpxchg.org \
    --cc=hillf.zj@alibaba-inc.com \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=vbabka@suse.cz \
    /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 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).