lkml.org 
[lkml]   [2014]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages
On Mon, 10 Feb 2014, Raghavendra K T wrote:

> So I understood that you are suggesting implementations like below
>
> 1) I do not have problem with the below approach, I could post this in
> next version.
> ( But this did not include 4k limit Linus mentioned to apply)
>
> unsigned long max_sane_readahead(unsigned long nr)
> {
> unsigned long local_free_page;
> int nid;
>
> nid = numa_mem_id();
>
> /*
> * We sanitize readahead size depending on free memory in
> * the local node.
> */
> local_free_page = node_page_state(nid, NR_INACTIVE_FILE)
> + node_page_state(nid, NR_FREE_PAGES);
> return min(nr, local_free_page / 2);
> }
>
> 2) I did not go for below because Honza (Jan Kara) had some
> concerns for 4k limit for normal case, and since I am not
> the expert, I was waiting for opinions.
>
> unsigned long max_sane_readahead(unsigned long nr)
> {
> unsigned long local_free_page, sane_nr;
> int nid;
>
> nid = numa_mem_id();
> /* limit the max readahead to 4k pages */
> sane_nr = min(nr, MAX_REMOTE_READAHEAD);
>
> /*
> * We sanitize readahead size depending on free memory in
> * the local node.
> */
> local_free_page = node_page_state(nid, NR_INACTIVE_FILE)
> + node_page_state(nid, NR_FREE_PAGES);
> return min(sane_nr, local_free_page / 2);
> }
>

I have no opinion on the 4KB pages, either of the above is just fine.


\
 
 \ /
  Last update: 2014-02-10 23:21    [W:0.877 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site