Re: [PATCH 3/3] mm, page_alloc: reduce static keys in prep_new_page()

2020-10-29 Thread Alexander Potapenko
On Tue, Oct 27, 2020 at 2:32 PM Vlastimil Babka wrote: > > On 10/27/20 12:05 PM, Vlastimil Babka wrote: > > On 10/27/20 10:10 AM, David Hildenbrand wrote: > >> On 26.10.20 18:33, Vlastimil Babka wrote: > >>> prep_new_page() will always zero a new page (regardless of __GFP_ZERO) > >>> when > >>>

Re: [PATCH 3/3] mm, page_alloc: reduce static keys in prep_new_page()

2020-10-28 Thread David Hildenbrand
On 27.10.20 18:41, Vlastimil Babka wrote: On 10/27/20 2:32 PM, Vlastimil Babka wrote: So my conclusion: - We can remove PAGE_POISONING_NO_SANITY because it only makes sense with PAGE_POISONING_ZERO, and we can use init_on_free instead Note for this we first have to make sanity checking

Re: [PATCH 3/3] mm, page_alloc: reduce static keys in prep_new_page()

2020-10-27 Thread Vlastimil Babka
On 10/27/20 2:32 PM, Vlastimil Babka wrote: So my conclusion: - We can remove PAGE_POISONING_NO_SANITY because it only makes sense with PAGE_POISONING_ZERO, and we can use init_on_free instead Note for this we first have to make sanity checking compatible with hibernation, but that should be

Re: [PATCH 3/3] mm, page_alloc: reduce static keys in prep_new_page()

2020-10-27 Thread Vlastimil Babka
On 10/27/20 12:05 PM, Vlastimil Babka wrote: On 10/27/20 10:10 AM, David Hildenbrand wrote: On 26.10.20 18:33, Vlastimil Babka wrote: prep_new_page() will always zero a new page (regardless of __GFP_ZERO) when init_on_alloc is enabled, but will also always skip zeroing if the page was already

Re: [PATCH 3/3] mm, page_alloc: reduce static keys in prep_new_page()

2020-10-27 Thread Vlastimil Babka
On 10/27/20 10:10 AM, David Hildenbrand wrote: On 26.10.20 18:33, Vlastimil Babka wrote: prep_new_page() will always zero a new page (regardless of __GFP_ZERO) when init_on_alloc is enabled, but will also always skip zeroing if the page was already zeroed on free by init_on_free or page

Re: [PATCH 3/3] mm, page_alloc: reduce static keys in prep_new_page()

2020-10-27 Thread David Hildenbrand
On 26.10.20 18:33, Vlastimil Babka wrote: prep_new_page() will always zero a new page (regardless of __GFP_ZERO) when init_on_alloc is enabled, but will also always skip zeroing if the page was already zeroed on free by init_on_free or page poisoning. The latter check implemented by

[PATCH 3/3] mm, page_alloc: reduce static keys in prep_new_page()

2020-10-26 Thread Vlastimil Babka
prep_new_page() will always zero a new page (regardless of __GFP_ZERO) when init_on_alloc is enabled, but will also always skip zeroing if the page was already zeroed on free by init_on_free or page poisoning. The latter check implemented by free_pages_prezeroed() can involve two different static