From: Michal Hocko <mhocko@kernel.org>
To: Kyle Walker <kwalker@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Geliang Tang <geliangtang@163.com>,
Vlastimil Babka <vbabka@suse.cz>,
Roman Gushchin <klamm@yandex-team.ru>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] mm: Move readahead limit outside of readahead, and advisory syscalls
Date: Tue, 26 Jul 2016 11:31:46 +0200 [thread overview]
Message-ID: <20160726093146.GI32462@dhcp22.suse.cz> (raw)
In-Reply-To: <20160725134732.b21912c54ef1ffe820ccdbca@linux-foundation.org>
On Mon 25-07-16 13:47:32, Andrew Morton wrote:
> On Mon, 25 Jul 2016 10:39:25 -0400 Kyle Walker <kwalker@redhat.com> wrote:
>
> > Java workloads using the MappedByteBuffer library result in the fadvise()
> > and madvise() syscalls being used extensively. Following recent readahead
> > limiting alterations, such as 600e19af ("mm: use only per-device readahead
> > limit") and 6d2be915 ("mm/readahead.c: fix readahead failure for
> > memoryless NUMA nodes and limit readahead pages"), application performance
> > suffers in instances where small readahead is configured.
>
> Can this suffering be quantified please?
>
> > By moving this limit outside of the syscall codepaths, the syscalls are
> > able to advise an inordinately large amount of readahead when desired.
> > With a cap being imposed based on the half of NR_INACTIVE_FILE and
> > NR_FREE_PAGES. In essence, allowing performance tuning efforts to define a
> > small readahead limit, but then benefiting from large sequential readahead
> > values selectively.
> >
> > ...
> >
> > --- a/mm/readahead.c
> > +++ b/mm/readahead.c
> > @@ -211,7 +211,9 @@ int force_page_cache_readahead(struct address_space *mapping, struct file *filp,
> > if (unlikely(!mapping->a_ops->readpage && !mapping->a_ops->readpages))
> > return -EINVAL;
> >
> > - nr_to_read = min(nr_to_read, inode_to_bdi(mapping->host)->ra_pages);
> > + nr_to_read = min(nr_to_read, (global_page_state(NR_INACTIVE_FILE) +
> > + (global_page_state(NR_FREE_PAGES)) / 2));
> > +
> > while (nr_to_read) {
> > int err;
> >
> > @@ -484,6 +486,7 @@ void page_cache_sync_readahead(struct address_space *mapping,
> >
> > /* be dumb */
> > if (filp && (filp->f_mode & FMODE_RANDOM)) {
> > + req_size = min(req_size, inode_to_bdi(mapping->host)->ra_pages);
> > force_page_cache_readahead(mapping, filp, offset, req_size);
> > return;
> > }
>
> Linus probably has opinions ;)
Just for the reference a similar patch has been discussed already [1] or
from a different angle [2]
[1] http://lkml.kernel.org/r/1440087598-27185-1-git-send-email-klamm@yandex-team.ru
[2] http://lkml.kernel.org/r/1456277927-12044-1-git-send-email-hannes@cmpxchg.org
--
Michal Hocko
SUSE Labs
--
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>
next prev parent reply other threads:[~2016-07-26 9:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-25 14:39 Kyle Walker
2016-07-25 20:47 ` Andrew Morton
2016-07-26 9:31 ` Michal Hocko [this message]
2016-07-26 19:23 ` Kyle Walker
2016-08-03 15:24 ` Rafael Aquini
2016-08-25 14:59 ` Kyle Walker
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=20160726093146.GI32462@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=geliangtang@163.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=klamm@yandex-team.ru \
--cc=kwalker@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=torvalds@linux-foundation.org \
--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