Re: [RFC v2 PATCH 4/4] mm: pre zero out free pages to speed up page allocation for __GFP_ZERO

2021-01-05 Thread Michal Hocko
On Tue 05-01-21 10:29:45, David Hildenbrand wrote: > On 05.01.21 10:20, Michal Hocko wrote: [...] > > A global knob with all or nothing sounds like an easier to use and > > maintain solution to me. > > I mean, that brings me back to my original suggestion: just use > hugetlbfs and implement some

Re: [RFC v2 PATCH 4/4] mm: pre zero out free pages to speed up page allocation for __GFP_ZERO

2021-01-05 Thread Liang Li
On Tue, Jan 5, 2021 at 5:30 PM David Hildenbrand wrote: > > On 05.01.21 10:20, Michal Hocko wrote: > > On Mon 04-01-21 15:00:31, Dave Hansen wrote: > >> On 1/4/21 12:11 PM, David Hildenbrand wrote: > Yeah, it certainly can't be the default, but it *is* useful for > thing where we know

Re: [RFC v2 PATCH 4/4] mm: pre zero out free pages to speed up page allocation for __GFP_ZERO

2021-01-05 Thread David Hildenbrand
On 05.01.21 10:20, Michal Hocko wrote: > On Mon 04-01-21 15:00:31, Dave Hansen wrote: >> On 1/4/21 12:11 PM, David Hildenbrand wrote: Yeah, it certainly can't be the default, but it *is* useful for thing where we know that there are no cache benefits to zeroing close to where the

Re: [RFC v2 PATCH 4/4] mm: pre zero out free pages to speed up page allocation for __GFP_ZERO

2021-01-05 Thread Michal Hocko
On Mon 04-01-21 15:00:31, Dave Hansen wrote: > On 1/4/21 12:11 PM, David Hildenbrand wrote: > >> Yeah, it certainly can't be the default, but it *is* useful for > >> thing where we know that there are no cache benefits to zeroing > >> close to where the memory is allocated. > >> > >> The trick is

Re: [RFC v2 PATCH 4/4] mm: pre zero out free pages to speed up page allocation for __GFP_ZERO

2021-01-04 Thread Dan Williams
On Mon, Jan 4, 2021 at 12:11 PM David Hildenbrand wrote: > > > > Am 04.01.2021 um 20:52 schrieb Dave Hansen : > > > > On 1/4/21 11:27 AM, Matthew Wilcox wrote: > >>> On Mon, Jan 04, 2021 at 11:19:13AM -0800, Dave Hansen wrote: > >>> On 12/21/20 8:30 AM, Liang Li wrote: > ---

Re: [RFC v2 PATCH 4/4] mm: pre zero out free pages to speed up page allocation for __GFP_ZERO

2021-01-04 Thread Dave Hansen
On 1/4/21 12:11 PM, David Hildenbrand wrote: >> Yeah, it certainly can't be the default, but it *is* useful for >> thing where we know that there are no cache benefits to zeroing >> close to where the memory is allocated. >> >> The trick is opting into it somehow, either in a process or a VMA. >>

Re: [RFC v2 PATCH 4/4] mm: pre zero out free pages to speed up page allocation for __GFP_ZERO

2021-01-04 Thread David Hildenbrand
> Am 04.01.2021 um 20:52 schrieb Dave Hansen : > > On 1/4/21 11:27 AM, Matthew Wilcox wrote: >>> On Mon, Jan 04, 2021 at 11:19:13AM -0800, Dave Hansen wrote: >>> On 12/21/20 8:30 AM, Liang Li wrote: --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -137,6

Re: [RFC v2 PATCH 4/4] mm: pre zero out free pages to speed up page allocation for __GFP_ZERO

2021-01-04 Thread Dave Hansen
On 1/4/21 11:27 AM, Matthew Wilcox wrote: > On Mon, Jan 04, 2021 at 11:19:13AM -0800, Dave Hansen wrote: >> On 12/21/20 8:30 AM, Liang Li wrote: >>> --- a/include/linux/page-flags.h >>> +++ b/include/linux/page-flags.h >>> @@ -137,6 +137,9 @@ enum pageflags { >>> #endif >>> #ifdef CONFIG_64BIT

Re: [RFC v2 PATCH 4/4] mm: pre zero out free pages to speed up page allocation for __GFP_ZERO

2021-01-04 Thread Dan Williams
On Mon, Jan 4, 2021 at 11:28 AM Matthew Wilcox wrote: > > On Mon, Jan 04, 2021 at 11:19:13AM -0800, Dave Hansen wrote: > > On 12/21/20 8:30 AM, Liang Li wrote: > > > --- a/include/linux/page-flags.h > > > +++ b/include/linux/page-flags.h > > > @@ -137,6 +137,9 @@ enum pageflags { > > > #endif >

Re: [RFC v2 PATCH 4/4] mm: pre zero out free pages to speed up page allocation for __GFP_ZERO

2021-01-04 Thread Matthew Wilcox
On Mon, Jan 04, 2021 at 11:19:13AM -0800, Dave Hansen wrote: > On 12/21/20 8:30 AM, Liang Li wrote: > > --- a/include/linux/page-flags.h > > +++ b/include/linux/page-flags.h > > @@ -137,6 +137,9 @@ enum pageflags { > > #endif > > #ifdef CONFIG_64BIT > > PG_arch_2, > > +#endif > > +#ifdef

Re: [RFC v2 PATCH 4/4] mm: pre zero out free pages to speed up page allocation for __GFP_ZERO

2021-01-04 Thread Dave Hansen
On 12/21/20 8:30 AM, Liang Li wrote: > --- a/include/linux/page-flags.h > +++ b/include/linux/page-flags.h > @@ -137,6 +137,9 @@ enum pageflags { > #endif > #ifdef CONFIG_64BIT > PG_arch_2, > +#endif > +#ifdef CONFIG_PREZERO_PAGE > + PG_zero, > #endif > __NR_PAGEFLAGS, I don't

[RFC v2 PATCH 4/4] mm: pre zero out free pages to speed up page allocation for __GFP_ZERO

2020-12-21 Thread Liang Li
Zero out the page content usually happens when allocating pages with the flag of __GFP_ZERO, this is a time consuming operation, it makes the population of a large vma area very slowly. This patch introduce a new feature for zero out pages before page allocation, it can help to speed up page