Re: [PATCH v7 1/1] mm/page_alloc.c: refactor initialization of struct page for holes in memory layout

2021-02-26 Thread Vlastimil Babka
On 2/26/21 11:59 AM, Mike Rapoport wrote: > On Thu, Feb 25, 2021 at 07:38:44PM +0100, Vlastimil Babka wrote: >> On 2/25/21 7:05 PM, Mike Rapoport wrote: >> >> >> >> What if two zones are adjacent? I.e. if the hole was at a boundary >> >> between two >> >> zones. >> > >> > What do you mean by

Re: [PATCH v7 1/1] mm/page_alloc.c: refactor initialization of struct page for holes in memory layout

2021-02-26 Thread Mike Rapoport
On Thu, Feb 25, 2021 at 07:38:44PM +0100, Vlastimil Babka wrote: > On 2/25/21 7:05 PM, Mike Rapoport wrote: > >> > >> What if two zones are adjacent? I.e. if the hole was at a boundary between > >> two > >> zones. > > > > What do you mean by "adjacent zones"? If there is a hole near the zone >

Re: [PATCH v7 1/1] mm/page_alloc.c: refactor initialization of struct page for holes in memory layout

2021-02-25 Thread Vlastimil Babka
On 2/25/21 7:05 PM, Mike Rapoport wrote: > On Thu, Feb 25, 2021 at 06:51:53PM +0100, Vlastimil Babka wrote: >> > >> > unset zone link in struct page will trigger >> > >> >VM_BUG_ON_PAGE(!zone_spans_pfn(page_zone(page), pfn), page); >> >> ... in set_pfnblock_flags_mask() when called with a

Re: [PATCH v7 1/1] mm/page_alloc.c: refactor initialization of struct page for holes in memory layout

2021-02-25 Thread Mike Rapoport
On Thu, Feb 25, 2021 at 09:54:34AM -0800, Linus Torvalds wrote: > On Thu, Feb 25, 2021 at 9:07 AM Mike Rapoport wrote: > > > > > > > > We might still double-initialize PFNs when two zones overlap within a > > > section, correct? > > > > You mean that a section crosses zones boundary? > > I don't

Re: [PATCH v7 1/1] mm/page_alloc.c: refactor initialization of struct page for holes in memory layout

2021-02-25 Thread Mike Rapoport
On Thu, Feb 25, 2021 at 06:51:53PM +0100, Vlastimil Babka wrote: > On 2/24/21 4:39 PM, Mike Rapoport wrote: > > From: Mike Rapoport > > Hi, thanks for your efforts. I'll just nit pick on the description/comments > as I > don't feel confident about judging the implementation correctness, sorry

Re: [PATCH v7 1/1] mm/page_alloc.c: refactor initialization of struct page for holes in memory layout

2021-02-25 Thread Linus Torvalds
On Thu, Feb 25, 2021 at 9:07 AM Mike Rapoport wrote: > > > > > We might still double-initialize PFNs when two zones overlap within a > > section, correct? > > You mean that a section crosses zones boundary? > I don't think it's that important. What if there was a memory allocation in between

Re: [PATCH v7 1/1] mm/page_alloc.c: refactor initialization of struct page for holes in memory layout

2021-02-25 Thread David Hildenbrand
On 25.02.21 18:06, Mike Rapoport wrote: On Thu, Feb 25, 2021 at 04:59:06PM +0100, David Hildenbrand wrote: On 24.02.21 16:39, Mike Rapoport wrote: From: Mike Rapoport There could be struct pages that are not backed by actual physical memory. This can happen when the actual memory bank is not

Re: [PATCH v7 1/1] mm/page_alloc.c: refactor initialization of struct page for holes in memory layout

2021-02-25 Thread Vlastimil Babka
On 2/24/21 4:39 PM, Mike Rapoport wrote: > From: Mike Rapoport Hi, thanks for your efforts. I'll just nit pick on the description/comments as I don't feel confident about judging the implementation correctness, sorry :) > There could be struct pages that are not backed by actual physical

Re: [PATCH v7 1/1] mm/page_alloc.c: refactor initialization of struct page for holes in memory layout

2021-02-25 Thread Mike Rapoport
On Thu, Feb 25, 2021 at 04:59:06PM +0100, David Hildenbrand wrote: > On 24.02.21 16:39, Mike Rapoport wrote: > > From: Mike Rapoport > > > > There could be struct pages that are not backed by actual physical memory. > > This can happen when the actual memory bank is not a multiple of > >

Re: [PATCH v7 1/1] mm/page_alloc.c: refactor initialization of struct page for holes in memory layout

2021-02-25 Thread David Hildenbrand
On 24.02.21 16:39, Mike Rapoport wrote: From: Mike Rapoport There could be struct pages that are not backed by actual physical memory. This can happen when the actual memory bank is not a multiple of SECTION_SIZE or when an architecture does not register memory holes reserved by the firmware

[PATCH v7 1/1] mm/page_alloc.c: refactor initialization of struct page for holes in memory layout

2021-02-24 Thread Mike Rapoport
From: Mike Rapoport There could be struct pages that are not backed by actual physical memory. This can happen when the actual memory bank is not a multiple of SECTION_SIZE or when an architecture does not register memory holes reserved by the firmware as memblock.memory. Such pages are