Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-17 Thread Nishanth Aravamudan
On 17.02.2014 [15:14:06 -0800], David Rientjes wrote: > On Mon, 17 Feb 2014, Nishanth Aravamudan wrote: > > > Here is what I'm running into now: > > > > setup_arch -> > > do_init_bootmem -> > > cpu_numa_callback -> > > numa_setup_cpu -> > >

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-17 Thread David Rientjes
On Mon, 17 Feb 2014, Nishanth Aravamudan wrote: > Here is what I'm running into now: > > setup_arch -> > do_init_bootmem -> > cpu_numa_callback -> > numa_setup_cpu -> > map_cpu_to_node -> >

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-17 Thread Linus Torvalds
On Thu, Feb 13, 2014 at 8:32 PM, Nishanth Aravamudan wrote: > > Agreed that for the readahead case the above is probably more than > sufficient. > > Apologies for hijacking the thread, my comments below were purely about > the memoryless node support, not about readahead specifically. Ok, no prob

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-17 Thread Linus Torvalds
On Thu, Feb 13, 2014 at 11:43 PM, Jan Kara wrote: > > max_sane_readahead() is also used for limiting amount of readahead for > [fm]advice(2) WILLNEED and that is used e.g. by a dynamic linker to preload > shared libraries into memory. So I'm convinced this usecase *will* notice > the change - ef

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-17 Thread Nishanth Aravamudan
On 14.02.2014 [02:54:06 -0800], David Rientjes wrote: > On Thu, 13 Feb 2014, Nishanth Aravamudan wrote: > > > There is an open issue on powerpc with memoryless nodes (inasmuch as we > > can have them, but the kernel doesn't support it properly). There is a > > separate discussion going on on linux

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-14 Thread David Rientjes
On Thu, 13 Feb 2014, Nishanth Aravamudan wrote: > There is an open issue on powerpc with memoryless nodes (inasmuch as we > can have them, but the kernel doesn't support it properly). There is a > separate discussion going on on linuxppc-dev about what is necessary for > CONFIG_HAVE_MEMORYLESS_NOD

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-13 Thread Jan Kara
On Thu 13-02-14 16:37:53, Linus Torvalds wrote: > Is this whole thread still just for the crazy and pointless > "max_sane_readahead()"? > > Or is there some *real* reason we should care? > > Because if it really is just for max_sane_readahead(), then for the > love of God, let us just do this >

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-13 Thread Nishanth Aravamudan
On 13.02.2014 [14:41:04 -0800], David Rientjes wrote: > On Thu, 13 Feb 2014, Raghavendra K T wrote: > > > Thanks David, unfortunately even after applying that patch, I do not see > > the improvement. > > > > Interestingly numa_mem_id() seem to still return the value of a > > memoryless node. > >

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-13 Thread Nishanth Aravamudan
Hi Linus, On 13.02.2014 [16:37:53 -0800], Linus Torvalds wrote: > Is this whole thread still just for the crazy and pointless > "max_sane_readahead()"? > > Or is there some *real* reason we should care? There is an open issue on powerpc with memoryless nodes (inasmuch as we can have them, but th

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-13 Thread Andrew Morton
On Thu, 13 Feb 2014 16:37:53 -0800 Linus Torvalds wrote: > unsigned long max_sane_readahead(unsigned long nr) > { > return min(nr, 128); > } I bet nobody will notice. It should be 128*4096/PAGE_CACHE_SIZE so that variations in PAGE_SIZE don't affect readahead behaviour. -- To unsub

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-13 Thread Linus Torvalds
Is this whole thread still just for the crazy and pointless "max_sane_readahead()"? Or is there some *real* reason we should care? Because if it really is just for max_sane_readahead(), then for the love of God, let us just do this unsigned long max_sane_readahead(unsigned long nr) { r

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-13 Thread Nishanth Aravamudan
On 13.02.2014 [14:41:04 -0800], David Rientjes wrote: > On Thu, 13 Feb 2014, Raghavendra K T wrote: > > > Thanks David, unfortunately even after applying that patch, I do not see > > the improvement. > > > > Interestingly numa_mem_id() seem to still return the value of a > > memoryless node. > >

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-13 Thread David Rientjes
On Thu, 13 Feb 2014, Raghavendra K T wrote: > Thanks David, unfortunately even after applying that patch, I do not see > the improvement. > > Interestingly numa_mem_id() seem to still return the value of a > memoryless node. > May be per cpu _numa_mem_ values are not set properly. Need to dig ou

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-13 Thread Nishanth Aravamudan
On 13.02.2014 [13:06:43 -0800], Andrew Morton wrote: > On Thu, 13 Feb 2014 00:05:31 -0800 (PST) David Rientjes > wrote: > > > On Thu, 13 Feb 2014, Raghavendra K T wrote: > > > > > I was able to test (1) implementation on the system where readahead > > > problem > > > occurred. Unfortunately it

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-13 Thread Andrew Morton
On Thu, 13 Feb 2014 00:05:31 -0800 (PST) David Rientjes wrote: > On Thu, 13 Feb 2014, Raghavendra K T wrote: > > > I was able to test (1) implementation on the system where readahead problem > > occurred. Unfortunately it did not help. > > > > Reason seem to be that CONFIG_HAVE_MEMORYLESS_NODE

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-13 Thread Raghavendra K T
On 02/13/2014 01:35 PM, David Rientjes wrote: On Thu, 13 Feb 2014, Raghavendra K T wrote: I was able to test (1) implementation on the system where readahead problem occurred. Unfortunately it did not help. Reason seem to be that CONFIG_HAVE_MEMORYLESS_NODES dependency of numa_mem_id(). The PP

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-13 Thread David Rientjes
On Thu, 13 Feb 2014, Raghavendra K T wrote: > I was able to test (1) implementation on the system where readahead problem > occurred. Unfortunately it did not help. > > Reason seem to be that CONFIG_HAVE_MEMORYLESS_NODES dependency of > numa_mem_id(). The PPC machine I am facing problem has topol

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-12 Thread Raghavendra K T
On 02/11/2014 03:05 AM, David Rientjes wrote: 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

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-10 Thread David Rientjes
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_r

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-10 Thread Raghavendra K T
On 02/10/2014 03:35 PM, David Rientjes wrote: On Mon, 10 Feb 2014, Raghavendra K T wrote: As you rightly pointed , I 'll drop remote memory term and use something like : "* Ensure readahead success on a memoryless node cpu. But we limit * the readahead to 4k pages to avoid trashing page cac

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-10 Thread David Rientjes
On Mon, 10 Feb 2014, Raghavendra K T wrote: > As you rightly pointed , I 'll drop remote memory term and use > something like : > > "* Ensure readahead success on a memoryless node cpu. But we limit > * the readahead to 4k pages to avoid trashing page cache." .. > I don't know how to proceed

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-10 Thread Raghavendra K T
On 02/08/2014 02:11 AM, David Rientjes wrote: On Fri, 7 Feb 2014, Raghavendra K T wrote: 3) Change the "readahead into remote memory" part of the documentation which is misleading. ( I feel no need to add numa_mem_id() since we would specifically limit the readahead with MAX_REMOTE_READAHEAD in

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-07 Thread David Rientjes
On Fri, 7 Feb 2014, Raghavendra K T wrote: > So following discussion TODO for my patch is: > > 1) Update the changelog with user visible impact of the patch. > (Andrew's suggestion) > 2) Add ACCESS_ONCE to numa_node_id(). > 3) Change the "readahead into remote memory" part of the documentation >

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-07 Thread Raghavendra K T
On 02/07/2014 05:28 AM, David Rientjes wrote: On Thu, 6 Feb 2014, David Rientjes wrote: +#define MAX_REMOTE_READAHEAD 4096UL Normally it wouldn't matter because there's no significant downside to it racing, things like mempolicies which use numa_node_id() extensively would result in, oops,

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-06 Thread David Rientjes
On Thu, 6 Feb 2014, David Rientjes wrote: > > > > > +#define MAX_REMOTE_READAHEAD 4096UL > Normally it wouldn't matter because there's no significant downside to it > racing, things like mempolicies which use numa_node_id() extensively would > result in, oops, a page allocation on the wrong n

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-06 Thread David Rientjes
On Thu, 6 Feb 2014, Andrew Morton wrote: > On Thu, 6 Feb 2014 14:58:21 -0800 (PST) David Rientjes > wrote: > > > > > +#define MAX_REMOTE_READAHEAD 4096UL > > > > /* > > > > * Given a desired number of PAGE_CACHE_SIZE readahead pages, return a > > > > * sensible upper limit. > > > > */

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-06 Thread Andrew Morton
On Thu, 6 Feb 2014 14:58:21 -0800 (PST) David Rientjes wrote: > > > +#define MAX_REMOTE_READAHEAD 4096UL > > > /* > > > * Given a desired number of PAGE_CACHE_SIZE readahead pages, return a > > > * sensible upper limit. > > > */ > > > unsigned long max_sane_readahead(unsigned long nr)

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-06 Thread David Rientjes
On Thu, 6 Feb 2014, Andrew Morton wrote: > > --- a/mm/readahead.c > > +++ b/mm/readahead.c > > @@ -237,14 +237,32 @@ int force_page_cache_readahead(struct address_space > > *mapping, struct file *filp, > > return ret; > > } > > > > +#define MAX_REMOTE_READAHEAD 4096UL > > /* > > * Giv

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-06 Thread Andrew Morton
On Wed, 22 Jan 2014 16:23:45 +0530 Raghavendra K T wrote: > max_sane_readahead returns zero on the cpu having no local memory > node. Fix that by returning a sanitized number of pages viz., > minimum of (requested pages, 4k) um, fix what? The changelog should describe the user-visible impact o

Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-02-03 Thread Raghavendra K T
On 01/22/2014 04:23 PM, Raghavendra K T wrote: max_sane_readahead returns zero on the cpu having no local memory node. Fix that by returning a sanitized number of pages viz., minimum of (requested pages, 4k) Result: fadvise experiment with FADV_WILLNEED on a x240 machine with 1GB testfile 32GB*

[RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages

2014-01-22 Thread Raghavendra K T
max_sane_readahead returns zero on the cpu having no local memory node. Fix that by returning a sanitized number of pages viz., minimum of (requested pages, 4k) Result: fadvise experiment with FADV_WILLNEED on a x240 machine with 1GB testfile 32GB* 4G RAM numa machine ( 12 iterations) yielded Ke