Re: Use higher-order pages in vmalloc

2018-03-01 Thread Eric Dumazet
On Fri, 2018-02-23 at 13:13 +0100, Michal Hocko wrote: > On Thu 22-02-18 19:01:35, Andy Lutomirski wrote: > > On Thu, Feb 22, 2018 at 1:36 PM, Michal Hocko wrote: > > > On Thu 22-02-18 04:22:54, Matthew Wilcox wrote: > > > > On Thu, Feb 22, 2018 at 07:59:43AM +0100, Michal Hocko wrote: > > > > > O

Re: Use higher-order pages in vmalloc

2018-02-23 Thread Michal Hocko
On Thu 22-02-18 19:01:35, Andy Lutomirski wrote: > On Thu, Feb 22, 2018 at 1:36 PM, Michal Hocko wrote: > > On Thu 22-02-18 04:22:54, Matthew Wilcox wrote: > >> On Thu, Feb 22, 2018 at 07:59:43AM +0100, Michal Hocko wrote: > >> > On Wed 21-02-18 09:01:29, Matthew Wilcox wrote: > >> > > Right. It

Re: Use higher-order pages in vmalloc

2018-02-22 Thread Dave Hansen
On 02/22/2018 11:27 AM, Andy Lutomirski wrote: > On Thu, Feb 22, 2018 at 7:19 PM, Dave Hansen wrote: >> On 02/22/2018 11:01 AM, Andy Lutomirski wrote: >>> On x86, if you shoot down the PTE for the current stack, you're dead. >> >> *If* we were to go do this insanity for vmalloc()'d memory, we coul

Re: Use higher-order pages in vmalloc

2018-02-22 Thread Andy Lutomirski
On Thu, Feb 22, 2018 at 7:19 PM, Dave Hansen wrote: > On 02/22/2018 11:01 AM, Andy Lutomirski wrote: >> On x86, if you shoot down the PTE for the current stack, you're dead. > > *If* we were to go do this insanity for vmalloc()'d memory, we could > probably limit it to kswapd, and also make sure t

Re: Use higher-order pages in vmalloc

2018-02-22 Thread Dave Hansen
On 02/22/2018 11:01 AM, Andy Lutomirski wrote: > On x86, if you shoot down the PTE for the current stack, you're dead. *If* we were to go do this insanity for vmalloc()'d memory, we could probably limit it to kswapd, and also make sure that kernel threads don't get vmalloc()'d stacks or that we ma

Re: Use higher-order pages in vmalloc

2018-02-22 Thread Andy Lutomirski
On Thu, Feb 22, 2018 at 1:36 PM, Michal Hocko wrote: > On Thu 22-02-18 04:22:54, Matthew Wilcox wrote: >> On Thu, Feb 22, 2018 at 07:59:43AM +0100, Michal Hocko wrote: >> > On Wed 21-02-18 09:01:29, Matthew Wilcox wrote: >> > > Right. It helps with fragmentation if we can keep higher-order >> > >

Re: Use higher-order pages in vmalloc

2018-02-22 Thread Michal Hocko
On Thu 22-02-18 04:22:54, Matthew Wilcox wrote: > On Thu, Feb 22, 2018 at 07:59:43AM +0100, Michal Hocko wrote: > > On Wed 21-02-18 09:01:29, Matthew Wilcox wrote: > > > Right. It helps with fragmentation if we can keep higher-order > > > allocations together. > > > > Hmm, wouldn't it help if we

Re: Use higher-order pages in vmalloc

2018-02-22 Thread Matthew Wilcox
On Thu, Feb 22, 2018 at 07:59:43AM +0100, Michal Hocko wrote: > On Wed 21-02-18 09:01:29, Matthew Wilcox wrote: > > Right. It helps with fragmentation if we can keep higher-order > > allocations together. > > Hmm, wouldn't it help if we made vmalloc pages migrateable instead? That > would help th

Re: Use higher-order pages in vmalloc

2018-02-21 Thread Michal Hocko
On Wed 21-02-18 09:01:29, Matthew Wilcox wrote: > On Wed, Feb 21, 2018 at 08:16:22AM -0800, Dave Hansen wrote: > > On 02/21/2018 07:42 AM, Matthew Wilcox wrote: > > > This prompted me to write a patch I've been meaning to do for a while, > > > allocating large pages if they're available to satisfy

Re: Use higher-order pages in vmalloc

2018-02-21 Thread Matthew Wilcox
On Wed, Feb 21, 2018 at 08:16:22AM -0800, Dave Hansen wrote: > On 02/21/2018 07:42 AM, Matthew Wilcox wrote: > > This prompted me to write a patch I've been meaning to do for a while, > > allocating large pages if they're available to satisfy vmalloc. I thought > > it would save on touching multip

Re: Use higher-order pages in vmalloc

2018-02-21 Thread Matthew Wilcox
On Wed, Feb 21, 2018 at 04:11:16PM +, Andy Lutomirski wrote: > On Wed, Feb 21, 2018 at 3:42 PM, Matthew Wilcox wrote: > > +++ b/kernel/fork.c > > @@ -319,12 +319,12 @@ static void account_kernel_stack(struct task_struct > > *tsk, int account) > > if (vm) { > > int i; >

Re: Use higher-order pages in vmalloc

2018-02-21 Thread Dave Hansen
On 02/21/2018 07:42 AM, Matthew Wilcox wrote: > On Tue, Jan 23, 2018 at 01:55:32PM +0300, Konstantin Khlebnikov wrote: >> Virtually mapped stack have two bonuses: it eats order-0 pages and >> adds guard page at the end. But it slightly slower if system have >> plenty free high-order pages. >> >> Th

Re: Use higher-order pages in vmalloc

2018-02-21 Thread Andy Lutomirski
On Wed, Feb 21, 2018 at 3:42 PM, Matthew Wilcox wrote: > On Tue, Jan 23, 2018 at 01:55:32PM +0300, Konstantin Khlebnikov wrote: >> Virtually mapped stack have two bonuses: it eats order-0 pages and >> adds guard page at the end. But it slightly slower if system have >> plenty free high-order pages

Use higher-order pages in vmalloc

2018-02-21 Thread Matthew Wilcox
On Tue, Jan 23, 2018 at 01:55:32PM +0300, Konstantin Khlebnikov wrote: > Virtually mapped stack have two bonuses: it eats order-0 pages and > adds guard page at the end. But it slightly slower if system have > plenty free high-order pages. > > This patch adds option to use virtually bapped stack a