Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1449793

Re: [PATCH] mm: Move readahead limit outside of readahead, and advisory syscalls

From Andrew Morton <akpm@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH] mm: Move readahead limit outside of readahead, and advisory syscalls
Date 2016-07-25 22:50 +0200
Message-ID <rYUZ3-Lt-11@gated-at.bofh.it> (permalink)
References <rYPd0-5I8-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] mm: Move readahead limit outside of readahead, and advisory syscalls Kyle Walker <kwalker@redhat.com> - 2016-07-25 16:40 +0200
  Re: [PATCH] mm: Move readahead limit outside of readahead, and  advisory syscalls Andrew Morton <akpm@linux-foundation.org> - 2016-07-25 22:50 +0200
    Re: [PATCH] mm: Move readahead limit outside of readahead, and  advisory syscalls Michal Hocko <mhocko@kernel.org> - 2016-07-26 11:40 +0200
    Re: [PATCH] mm: Move readahead limit outside of readahead, and  advisory syscalls Kyle Walker <kwalker@redhat.com> - 2016-07-26 21:30 +0200
    Re: [PATCH] mm: Move readahead limit outside of readahead, and  advisory syscalls Rafael Aquini <aquini@redhat.com> - 2016-08-03 17:40 +0200

csiph-web