Re: [PATCH 2/2] mm/vmalloc: Use kvmalloc to allocate the table of pages

2021-03-24 Thread Uladzislau Rezki
On Tue, Mar 23, 2021 at 09:39:24PM +0100, Uladzislau Rezki wrote: > > On Tue, Mar 23, 2021 at 01:04:36PM +0100, Uladzislau Rezki wrote: > > > On Mon, Mar 22, 2021 at 11:03:11PM +, Matthew Wilcox wrote: > > > > I suspect the vast majority of the time is spent calling > > > > alloc_pages_node()

Re: [PATCH 2/2] mm/vmalloc: Use kvmalloc to allocate the table of pages

2021-03-23 Thread Uladzislau Rezki
On Tue, Mar 23, 2021 at 02:07:22PM +, Matthew Wilcox wrote: > On Tue, Mar 23, 2021 at 02:39:48PM +0100, Uladzislau Rezki wrote: > > On Tue, Mar 23, 2021 at 12:39:13PM +, Matthew Wilcox wrote: > > > On Tue, Mar 23, 2021 at 01:04:36PM +0100, Uladzislau Rezki wrote: > > > > On Mon, Mar 22,

Re: [PATCH 2/2] mm/vmalloc: Use kvmalloc to allocate the table of pages

2021-03-23 Thread Uladzislau Rezki
> On Tue, Mar 23, 2021 at 01:04:36PM +0100, Uladzislau Rezki wrote: > > On Mon, Mar 22, 2021 at 11:03:11PM +, Matthew Wilcox wrote: > > > I suspect the vast majority of the time is spent calling > > > alloc_pages_node() > > > 1024 times. Have you looked at Mel's patch to do ... well, exactly

Re: [PATCH 2/2] mm/vmalloc: Use kvmalloc to allocate the table of pages

2021-03-23 Thread Matthew Wilcox
On Tue, Mar 23, 2021 at 02:39:48PM +0100, Uladzislau Rezki wrote: > On Tue, Mar 23, 2021 at 12:39:13PM +, Matthew Wilcox wrote: > > On Tue, Mar 23, 2021 at 01:04:36PM +0100, Uladzislau Rezki wrote: > > > On Mon, Mar 22, 2021 at 11:03:11PM +, Matthew Wilcox wrote: > > > > I suspect the vast

Re: [PATCH 2/2] mm/vmalloc: Use kvmalloc to allocate the table of pages

2021-03-23 Thread Uladzislau Rezki
On Tue, Mar 23, 2021 at 12:39:13PM +, Matthew Wilcox wrote: > On Tue, Mar 23, 2021 at 01:04:36PM +0100, Uladzislau Rezki wrote: > > On Mon, Mar 22, 2021 at 11:03:11PM +, Matthew Wilcox wrote: > > > I suspect the vast majority of the time is spent calling > > > alloc_pages_node() > > >

Re: [PATCH 2/2] mm/vmalloc: Use kvmalloc to allocate the table of pages

2021-03-23 Thread Matthew Wilcox
On Tue, Mar 23, 2021 at 01:04:36PM +0100, Uladzislau Rezki wrote: > On Mon, Mar 22, 2021 at 11:03:11PM +, Matthew Wilcox wrote: > > I suspect the vast majority of the time is spent calling alloc_pages_node() > > 1024 times. Have you looked at Mel's patch to do ... well, exactly what > >

Re: [PATCH 2/2] mm/vmalloc: Use kvmalloc to allocate the table of pages

2021-03-23 Thread Uladzislau Rezki
On Mon, Mar 22, 2021 at 11:03:11PM +, Matthew Wilcox wrote: > On Mon, Mar 22, 2021 at 11:36:19PM +0100, Uladzislau Rezki wrote: > > On Mon, Mar 22, 2021 at 07:38:20PM +, Matthew Wilcox (Oracle) wrote: > > > If we're trying to allocate 4MB of memory, the table will be 8KiB in size > > >

Re: [PATCH 2/2] mm/vmalloc: Use kvmalloc to allocate the table of pages

2021-03-22 Thread Matthew Wilcox
On Mon, Mar 22, 2021 at 11:36:19PM +0100, Uladzislau Rezki wrote: > On Mon, Mar 22, 2021 at 07:38:20PM +, Matthew Wilcox (Oracle) wrote: > > If we're trying to allocate 4MB of memory, the table will be 8KiB in size > > (1024 pointers * 8 bytes per pointer), which can usually be satisfied > >

Re: [PATCH 2/2] mm/vmalloc: Use kvmalloc to allocate the table of pages

2021-03-22 Thread Uladzislau Rezki
On Mon, Mar 22, 2021 at 07:38:20PM +, Matthew Wilcox (Oracle) wrote: > If we're trying to allocate 4MB of memory, the table will be 8KiB in size > (1024 pointers * 8 bytes per pointer), which can usually be satisfied > by a kmalloc (which is significantly faster). Instead of changing this >

[PATCH 2/2] mm/vmalloc: Use kvmalloc to allocate the table of pages

2021-03-22 Thread Matthew Wilcox (Oracle)
If we're trying to allocate 4MB of memory, the table will be 8KiB in size (1024 pointers * 8 bytes per pointer), which can usually be satisfied by a kmalloc (which is significantly faster). Instead of changing this open-coded implementation, just use kvmalloc(). Signed-off-by: Matthew Wilcox