Re: [PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set

2018-04-23 Thread Christopher Lameter
On Sat, 21 Apr 2018, Vlastimil Babka wrote: > > The problem is that SLUB does not honor GFP_NORETRY. The semantics of > > GFP_NORETRY are not followed. > > The caller might want SLUB to try hard to get that high-order page that > will minimize memory waste (e.g. 2MB page for 3 640k objects), and

Re: [PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set

2018-04-23 Thread Christopher Lameter
On Sat, 21 Apr 2018, Vlastimil Babka wrote: > > The problem is that SLUB does not honor GFP_NORETRY. The semantics of > > GFP_NORETRY are not followed. > > The caller might want SLUB to try hard to get that high-order page that > will minimize memory waste (e.g. 2MB page for 3 640k objects), and

Re: [PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set

2018-04-21 Thread Vlastimil Babka
On 04/20/2018 04:53 PM, Christopher Lameter wrote: > On Thu, 19 Apr 2018, Michal Hocko wrote: > >> Overriding __GFP_NORETRY is just a bad idea. It will make the semantic >> of the flag just more confusing. Note there are users who use >> __GFP_NORETRY as a way to suppress heavy memory pressure

Re: [PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set

2018-04-21 Thread Vlastimil Babka
On 04/20/2018 04:53 PM, Christopher Lameter wrote: > On Thu, 19 Apr 2018, Michal Hocko wrote: > >> Overriding __GFP_NORETRY is just a bad idea. It will make the semantic >> of the flag just more confusing. Note there are users who use >> __GFP_NORETRY as a way to suppress heavy memory pressure

Re: [PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set

2018-04-20 Thread Christopher Lameter
On Thu, 19 Apr 2018, Michal Hocko wrote: > Overriding __GFP_NORETRY is just a bad idea. It will make the semantic > of the flag just more confusing. Note there are users who use > __GFP_NORETRY as a way to suppress heavy memory pressure and/or the OOM > killer. You do not want to change the

Re: [PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set

2018-04-20 Thread Christopher Lameter
On Thu, 19 Apr 2018, Michal Hocko wrote: > Overriding __GFP_NORETRY is just a bad idea. It will make the semantic > of the flag just more confusing. Note there are users who use > __GFP_NORETRY as a way to suppress heavy memory pressure and/or the OOM > killer. You do not want to change the

Re: [PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set

2018-04-19 Thread Michal Hocko
On Wed 18-04-18 09:45:39, Cristopher Lameter wrote: > Mikulas Patoka wants to ensure that no fallback to lower order happens. I > think __GFP_NORETRY should work correctly in that case too and not fall > back. Overriding __GFP_NORETRY is just a bad idea. It will make the semantic of the flag just

Re: [PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set

2018-04-19 Thread Michal Hocko
On Wed 18-04-18 09:45:39, Cristopher Lameter wrote: > Mikulas Patoka wants to ensure that no fallback to lower order happens. I > think __GFP_NORETRY should work correctly in that case too and not fall > back. Overriding __GFP_NORETRY is just a bad idea. It will make the semantic of the flag just

Re: [PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set

2018-04-18 Thread David Rientjes
On Wed, 18 Apr 2018, Mikulas Patocka wrote: > > Mikulas Patoka wants to ensure that no fallback to lower order happens. I > > think __GFP_NORETRY should work correctly in that case too and not fall > > back. > > > > > > > > Allocating at a smaller order is a retry operation and should not > >

Re: [PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set

2018-04-18 Thread David Rientjes
On Wed, 18 Apr 2018, Mikulas Patocka wrote: > > Mikulas Patoka wants to ensure that no fallback to lower order happens. I > > think __GFP_NORETRY should work correctly in that case too and not fall > > back. > > > > > > > > Allocating at a smaller order is a retry operation and should not > >

Re: [PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set

2018-04-18 Thread Christopher Lameter
On Wed, 18 Apr 2018, Mikulas Patocka wrote: > No, this would hit NULL pointer dereference if page is NULL and > __GFP_NORETRY is set. You want this: You are right Acked-by: Christoph Lameter

Re: [PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set

2018-04-18 Thread Christopher Lameter
On Wed, 18 Apr 2018, Mikulas Patocka wrote: > No, this would hit NULL pointer dereference if page is NULL and > __GFP_NORETRY is set. You want this: You are right Acked-by: Christoph Lameter

Re: [PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set

2018-04-18 Thread Mikulas Patocka
On Wed, 18 Apr 2018, Christopher Lameter wrote: > Mikulas Patoka wants to ensure that no fallback to lower order happens. I > think __GFP_NORETRY should work correctly in that case too and not fall > back. > > > > Allocating at a smaller order is a retry operation and should not > be

Re: [PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set

2018-04-18 Thread Mikulas Patocka
On Wed, 18 Apr 2018, Christopher Lameter wrote: > Mikulas Patoka wants to ensure that no fallback to lower order happens. I > think __GFP_NORETRY should work correctly in that case too and not fall > back. > > > > Allocating at a smaller order is a retry operation and should not > be

[PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set

2018-04-18 Thread Christopher Lameter
Mikulas Patoka wants to ensure that no fallback to lower order happens. I think __GFP_NORETRY should work correctly in that case too and not fall back. Allocating at a smaller order is a retry operation and should not be attempted. If the caller does not want retries then respect that.

[PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set

2018-04-18 Thread Christopher Lameter
Mikulas Patoka wants to ensure that no fallback to lower order happens. I think __GFP_NORETRY should work correctly in that case too and not fall back. Allocating at a smaller order is a retry operation and should not be attempted. If the caller does not want retries then respect that.