Re: [v4 1/1] mm: Adaptive hash table scaling

2017-05-22 Thread Pasha Tatashin
This is just too ugly to live, really. If we do not need adaptive scaling then just make it #if __BITS_PER_LONG around the code. I would be fine with this. A big fat warning explaining why this is 64b only would be appropriate. OK, let me prettify it somehow, and I will send a new patch out.

Re: [v4 1/1] mm: Adaptive hash table scaling

2017-05-22 Thread Michal Hocko
On Mon 22-05-17 09:18:58, Pasha Tatashin wrote: > > > >I have only noticed this email today because my incoming emails stopped > >syncing since Friday. But this is _definitely_ not the right approachh. > >64G for 32b systems is _way_ off. We have only ~1G for the kernel. I've > >already proposed sc

Re: [v4 1/1] mm: Adaptive hash table scaling

2017-05-22 Thread Pasha Tatashin
I have only noticed this email today because my incoming emails stopped syncing since Friday. But this is _definitely_ not the right approachh. 64G for 32b systems is _way_ off. We have only ~1G for the kernel. I've already proposed scaling up to 32M for 32b systems and Andi seems to be suggestin

Re: [v4 1/1] mm: Adaptive hash table scaling

2017-05-22 Thread Michal Hocko
On Sat 20-05-17 13:06:53, Pavel Tatashin wrote: [...] > /* > + * Adaptive scale is meant to reduce sizes of hash tables on large memory > + * machines. As memory size is increased the scale is also increased but at > + * slower pace. Starting from ADAPT_SCALE_BASE (64G), every time memory > + * q

Re: [v4 1/1] mm: Adaptive hash table scaling

2017-05-21 Thread Michael Ellerman
Pavel Tatashin writes: > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 8afa63e81e73..15bba5c325a5 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -7169,6 +7169,17 @@ static unsigned long __init > arch_reserved_kernel_pages(void) > #endif > > /* > + * Adaptive scale is mea

Re: [v4 1/1] mm: Adaptive hash table scaling

2017-05-21 Thread Andi Kleen
On Sun, May 21, 2017 at 08:58:25AM -0400, Pasha Tatashin wrote: > Hi Andi, > > Thank you for looking at this. I mentioned earlier, I would not want to > impose a cap. However, if you think that for example dcache needs a cap, > there is already a mechanism for that via high_limit argument, so the

Re: [v4 1/1] mm: Adaptive hash table scaling

2017-05-21 Thread Pasha Tatashin
Hi Andi, Thank you for looking at this. I mentioned earlier, I would not want to impose a cap. However, if you think that for example dcache needs a cap, there is already a mechanism for that via high_limit argument, so the client can be changed to provide that cap. However, this particular p

Re: [v4 1/1] mm: Adaptive hash table scaling

2017-05-20 Thread Andi Kleen
Pavel Tatashin writes: > Allow hash tables to scale with memory but at slower pace, when HASH_ADAPT > is provided every time memory quadruples the sizes of hash tables will only > double instead of quadrupling as well. This algorithm starts working only > when memory size reaches a certain point,

[v4 1/1] mm: Adaptive hash table scaling

2017-05-20 Thread Pavel Tatashin
Allow hash tables to scale with memory but at slower pace, when HASH_ADAPT is provided every time memory quadruples the sizes of hash tables will only double instead of quadrupling as well. This algorithm starts working only when memory size reaches a certain point, currently set to 64G. This is e